/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServiceCertificateOrderProperties.java

http://github.com/WindowsAzure/azure-sdk-for-java · Java · 449 lines · 180 code · 51 blank · 218 comment · 14 complexity · e17bc656734cb41e78e21cd586334adb MD5 · raw file

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. // Code generated by Microsoft (R) AutoRest Code Generator.
  4. package com.azure.resourcemanager.appservice.fluent.models;
  5. import com.azure.core.annotation.Fluent;
  6. import com.azure.core.util.logging.ClientLogger;
  7. import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem;
  8. import com.azure.resourcemanager.appservice.models.CertificateDetails;
  9. import com.azure.resourcemanager.appservice.models.CertificateOrderContact;
  10. import com.azure.resourcemanager.appservice.models.CertificateOrderStatus;
  11. import com.azure.resourcemanager.appservice.models.CertificateProductType;
  12. import com.azure.resourcemanager.appservice.models.ProvisioningState;
  13. import com.fasterxml.jackson.annotation.JsonIgnore;
  14. import com.fasterxml.jackson.annotation.JsonInclude;
  15. import com.fasterxml.jackson.annotation.JsonProperty;
  16. import java.time.OffsetDateTime;
  17. import java.util.List;
  18. import java.util.Map;
  19. /** AppServiceCertificateOrder resource specific properties. */
  20. @Fluent
  21. public final class AppServiceCertificateOrderProperties {
  22. @JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderProperties.class);
  23. /*
  24. * State of the Key Vault secret.
  25. */
  26. @JsonProperty(value = "certificates")
  27. @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
  28. private Map<String, AppServiceCertificateInner> certificates;
  29. /*
  30. * Certificate distinguished name.
  31. */
  32. @JsonProperty(value = "distinguishedName")
  33. private String distinguishedName;
  34. /*
  35. * Domain verification token.
  36. */
  37. @JsonProperty(value = "domainVerificationToken", access = JsonProperty.Access.WRITE_ONLY)
  38. private String domainVerificationToken;
  39. /*
  40. * Duration in years (must be 1).
  41. */
  42. @JsonProperty(value = "validityInYears")
  43. private Integer validityInYears;
  44. /*
  45. * Certificate key size.
  46. */
  47. @JsonProperty(value = "keySize")
  48. private Integer keySize;
  49. /*
  50. * Certificate product type.
  51. */
  52. @JsonProperty(value = "productType", required = true)
  53. private CertificateProductType productType;
  54. /*
  55. * <code>true</code> if the certificate should be automatically renewed
  56. * when it expires; otherwise, <code>false</code>.
  57. */
  58. @JsonProperty(value = "autoRenew")
  59. private Boolean autoRenew;
  60. /*
  61. * Status of certificate order.
  62. */
  63. @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
  64. private ProvisioningState provisioningState;
  65. /*
  66. * Current order status.
  67. */
  68. @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
  69. private CertificateOrderStatus status;
  70. /*
  71. * Signed certificate.
  72. */
  73. @JsonProperty(value = "signedCertificate", access = JsonProperty.Access.WRITE_ONLY)
  74. private CertificateDetails signedCertificate;
  75. /*
  76. * Last CSR that was created for this order.
  77. */
  78. @JsonProperty(value = "csr")
  79. private String csr;
  80. /*
  81. * Intermediate certificate.
  82. */
  83. @JsonProperty(value = "intermediate", access = JsonProperty.Access.WRITE_ONLY)
  84. private CertificateDetails intermediate;
  85. /*
  86. * Root certificate.
  87. */
  88. @JsonProperty(value = "root", access = JsonProperty.Access.WRITE_ONLY)
  89. private CertificateDetails root;
  90. /*
  91. * Current serial number of the certificate.
  92. */
  93. @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY)
  94. private String serialNumber;
  95. /*
  96. * Certificate last issuance time.
  97. */
  98. @JsonProperty(value = "lastCertificateIssuanceTime", access = JsonProperty.Access.WRITE_ONLY)
  99. private OffsetDateTime lastCertificateIssuanceTime;
  100. /*
  101. * Certificate expiration time.
  102. */
  103. @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY)
  104. private OffsetDateTime expirationTime;
  105. /*
  106. * <code>true</code> if private key is external; otherwise,
  107. * <code>false</code>.
  108. */
  109. @JsonProperty(value = "isPrivateKeyExternal", access = JsonProperty.Access.WRITE_ONLY)
  110. private Boolean isPrivateKeyExternal;
  111. /*
  112. * Reasons why App Service Certificate is not renewable at the current
  113. * moment.
  114. */
  115. @JsonProperty(value = "appServiceCertificateNotRenewableReasons", access = JsonProperty.Access.WRITE_ONLY)
  116. private List<AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem>
  117. appServiceCertificateNotRenewableReasons;
  118. /*
  119. * Time stamp when the certificate would be auto renewed next
  120. */
  121. @JsonProperty(value = "nextAutoRenewalTimeStamp", access = JsonProperty.Access.WRITE_ONLY)
  122. private OffsetDateTime nextAutoRenewalTimestamp;
  123. /*
  124. * Contact info
  125. */
  126. @JsonProperty(value = "contact", access = JsonProperty.Access.WRITE_ONLY)
  127. private CertificateOrderContact contact;
  128. /**
  129. * Get the certificates property: State of the Key Vault secret.
  130. *
  131. * @return the certificates value.
  132. */
  133. public Map<String, AppServiceCertificateInner> certificates() {
  134. return this.certificates;
  135. }
  136. /**
  137. * Set the certificates property: State of the Key Vault secret.
  138. *
  139. * @param certificates the certificates value to set.
  140. * @return the AppServiceCertificateOrderProperties object itself.
  141. */
  142. public AppServiceCertificateOrderProperties withCertificates(Map<String, AppServiceCertificateInner> certificates) {
  143. this.certificates = certificates;
  144. return this;
  145. }
  146. /**
  147. * Get the distinguishedName property: Certificate distinguished name.
  148. *
  149. * @return the distinguishedName value.
  150. */
  151. public String distinguishedName() {
  152. return this.distinguishedName;
  153. }
  154. /**
  155. * Set the distinguishedName property: Certificate distinguished name.
  156. *
  157. * @param distinguishedName the distinguishedName value to set.
  158. * @return the AppServiceCertificateOrderProperties object itself.
  159. */
  160. public AppServiceCertificateOrderProperties withDistinguishedName(String distinguishedName) {
  161. this.distinguishedName = distinguishedName;
  162. return this;
  163. }
  164. /**
  165. * Get the domainVerificationToken property: Domain verification token.
  166. *
  167. * @return the domainVerificationToken value.
  168. */
  169. public String domainVerificationToken() {
  170. return this.domainVerificationToken;
  171. }
  172. /**
  173. * Get the validityInYears property: Duration in years (must be 1).
  174. *
  175. * @return the validityInYears value.
  176. */
  177. public Integer validityInYears() {
  178. return this.validityInYears;
  179. }
  180. /**
  181. * Set the validityInYears property: Duration in years (must be 1).
  182. *
  183. * @param validityInYears the validityInYears value to set.
  184. * @return the AppServiceCertificateOrderProperties object itself.
  185. */
  186. public AppServiceCertificateOrderProperties withValidityInYears(Integer validityInYears) {
  187. this.validityInYears = validityInYears;
  188. return this;
  189. }
  190. /**
  191. * Get the keySize property: Certificate key size.
  192. *
  193. * @return the keySize value.
  194. */
  195. public Integer keySize() {
  196. return this.keySize;
  197. }
  198. /**
  199. * Set the keySize property: Certificate key size.
  200. *
  201. * @param keySize the keySize value to set.
  202. * @return the AppServiceCertificateOrderProperties object itself.
  203. */
  204. public AppServiceCertificateOrderProperties withKeySize(Integer keySize) {
  205. this.keySize = keySize;
  206. return this;
  207. }
  208. /**
  209. * Get the productType property: Certificate product type.
  210. *
  211. * @return the productType value.
  212. */
  213. public CertificateProductType productType() {
  214. return this.productType;
  215. }
  216. /**
  217. * Set the productType property: Certificate product type.
  218. *
  219. * @param productType the productType value to set.
  220. * @return the AppServiceCertificateOrderProperties object itself.
  221. */
  222. public AppServiceCertificateOrderProperties withProductType(CertificateProductType productType) {
  223. this.productType = productType;
  224. return this;
  225. }
  226. /**
  227. * Get the autoRenew property: &lt;code&gt;true&lt;/code&gt; if the certificate should be automatically renewed when
  228. * it expires; otherwise, &lt;code&gt;false&lt;/code&gt;.
  229. *
  230. * @return the autoRenew value.
  231. */
  232. public Boolean autoRenew() {
  233. return this.autoRenew;
  234. }
  235. /**
  236. * Set the autoRenew property: &lt;code&gt;true&lt;/code&gt; if the certificate should be automatically renewed when
  237. * it expires; otherwise, &lt;code&gt;false&lt;/code&gt;.
  238. *
  239. * @param autoRenew the autoRenew value to set.
  240. * @return the AppServiceCertificateOrderProperties object itself.
  241. */
  242. public AppServiceCertificateOrderProperties withAutoRenew(Boolean autoRenew) {
  243. this.autoRenew = autoRenew;
  244. return this;
  245. }
  246. /**
  247. * Get the provisioningState property: Status of certificate order.
  248. *
  249. * @return the provisioningState value.
  250. */
  251. public ProvisioningState provisioningState() {
  252. return this.provisioningState;
  253. }
  254. /**
  255. * Get the status property: Current order status.
  256. *
  257. * @return the status value.
  258. */
  259. public CertificateOrderStatus status() {
  260. return this.status;
  261. }
  262. /**
  263. * Get the signedCertificate property: Signed certificate.
  264. *
  265. * @return the signedCertificate value.
  266. */
  267. public CertificateDetails signedCertificate() {
  268. return this.signedCertificate;
  269. }
  270. /**
  271. * Get the csr property: Last CSR that was created for this order.
  272. *
  273. * @return the csr value.
  274. */
  275. public String csr() {
  276. return this.csr;
  277. }
  278. /**
  279. * Set the csr property: Last CSR that was created for this order.
  280. *
  281. * @param csr the csr value to set.
  282. * @return the AppServiceCertificateOrderProperties object itself.
  283. */
  284. public AppServiceCertificateOrderProperties withCsr(String csr) {
  285. this.csr = csr;
  286. return this;
  287. }
  288. /**
  289. * Get the intermediate property: Intermediate certificate.
  290. *
  291. * @return the intermediate value.
  292. */
  293. public CertificateDetails intermediate() {
  294. return this.intermediate;
  295. }
  296. /**
  297. * Get the root property: Root certificate.
  298. *
  299. * @return the root value.
  300. */
  301. public CertificateDetails root() {
  302. return this.root;
  303. }
  304. /**
  305. * Get the serialNumber property: Current serial number of the certificate.
  306. *
  307. * @return the serialNumber value.
  308. */
  309. public String serialNumber() {
  310. return this.serialNumber;
  311. }
  312. /**
  313. * Get the lastCertificateIssuanceTime property: Certificate last issuance time.
  314. *
  315. * @return the lastCertificateIssuanceTime value.
  316. */
  317. public OffsetDateTime lastCertificateIssuanceTime() {
  318. return this.lastCertificateIssuanceTime;
  319. }
  320. /**
  321. * Get the expirationTime property: Certificate expiration time.
  322. *
  323. * @return the expirationTime value.
  324. */
  325. public OffsetDateTime expirationTime() {
  326. return this.expirationTime;
  327. }
  328. /**
  329. * Get the isPrivateKeyExternal property: &lt;code&gt;true&lt;/code&gt; if private key is external; otherwise,
  330. * &lt;code&gt;false&lt;/code&gt;.
  331. *
  332. * @return the isPrivateKeyExternal value.
  333. */
  334. public Boolean isPrivateKeyExternal() {
  335. return this.isPrivateKeyExternal;
  336. }
  337. /**
  338. * Get the appServiceCertificateNotRenewableReasons property: Reasons why App Service Certificate is not renewable
  339. * at the current moment.
  340. *
  341. * @return the appServiceCertificateNotRenewableReasons value.
  342. */
  343. public List<AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem>
  344. appServiceCertificateNotRenewableReasons() {
  345. return this.appServiceCertificateNotRenewableReasons;
  346. }
  347. /**
  348. * Get the nextAutoRenewalTimestamp property: Time stamp when the certificate would be auto renewed next.
  349. *
  350. * @return the nextAutoRenewalTimestamp value.
  351. */
  352. public OffsetDateTime nextAutoRenewalTimestamp() {
  353. return this.nextAutoRenewalTimestamp;
  354. }
  355. /**
  356. * Get the contact property: Contact info.
  357. *
  358. * @return the contact value.
  359. */
  360. public CertificateOrderContact contact() {
  361. return this.contact;
  362. }
  363. /**
  364. * Validates the instance.
  365. *
  366. * @throws IllegalArgumentException thrown if the instance is not valid.
  367. */
  368. public void validate() {
  369. if (certificates() != null) {
  370. certificates()
  371. .values()
  372. .forEach(
  373. e -> {
  374. if (e != null) {
  375. e.validate();
  376. }
  377. });
  378. }
  379. if (productType() == null) {
  380. throw logger
  381. .logExceptionAsError(
  382. new IllegalArgumentException(
  383. "Missing required property productType in model AppServiceCertificateOrderProperties"));
  384. }
  385. if (signedCertificate() != null) {
  386. signedCertificate().validate();
  387. }
  388. if (intermediate() != null) {
  389. intermediate().validate();
  390. }
  391. if (root() != null) {
  392. root().validate();
  393. }
  394. if (contact() != null) {
  395. contact().validate();
  396. }
  397. }
  398. }