PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateFirewallRuleWithAccountParameters.java

http://github.com/WindowsAzure/azure-sdk-for-java
Java | 128 lines | 58 code | 13 blank | 57 comment | 6 complexity | f864151d5060ce2bc895b84afd73dca9 MD5 | raw file
Possible License(s): MIT
  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.datalakestore.models;
  5. import com.azure.core.annotation.Fluent;
  6. import com.azure.core.annotation.JsonFlatten;
  7. import com.azure.core.util.logging.ClientLogger;
  8. import com.fasterxml.jackson.annotation.JsonIgnore;
  9. import com.fasterxml.jackson.annotation.JsonProperty;
  10. /** The parameters used to create a new firewall rule while creating a new Data Lake Store account. */
  11. @JsonFlatten
  12. @Fluent
  13. public class CreateFirewallRuleWithAccountParameters {
  14. @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateFirewallRuleWithAccountParameters.class);
  15. /*
  16. * The unique name of the firewall rule to create.
  17. */
  18. @JsonProperty(value = "name", required = true)
  19. private String name;
  20. /*
  21. * The start IP address for the firewall rule. This can be either ipv4 or
  22. * ipv6. Start and End should be in the same protocol.
  23. */
  24. @JsonProperty(value = "properties.startIpAddress", required = true)
  25. private String startIpAddress;
  26. /*
  27. * The end IP address for the firewall rule. This can be either ipv4 or
  28. * ipv6. Start and End should be in the same protocol.
  29. */
  30. @JsonProperty(value = "properties.endIpAddress", required = true)
  31. private String endIpAddress;
  32. /**
  33. * Get the name property: The unique name of the firewall rule to create.
  34. *
  35. * @return the name value.
  36. */
  37. public String name() {
  38. return this.name;
  39. }
  40. /**
  41. * Set the name property: The unique name of the firewall rule to create.
  42. *
  43. * @param name the name value to set.
  44. * @return the CreateFirewallRuleWithAccountParameters object itself.
  45. */
  46. public CreateFirewallRuleWithAccountParameters withName(String name) {
  47. this.name = name;
  48. return this;
  49. }
  50. /**
  51. * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6.
  52. * Start and End should be in the same protocol.
  53. *
  54. * @return the startIpAddress value.
  55. */
  56. public String startIpAddress() {
  57. return this.startIpAddress;
  58. }
  59. /**
  60. * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6.
  61. * Start and End should be in the same protocol.
  62. *
  63. * @param startIpAddress the startIpAddress value to set.
  64. * @return the CreateFirewallRuleWithAccountParameters object itself.
  65. */
  66. public CreateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) {
  67. this.startIpAddress = startIpAddress;
  68. return this;
  69. }
  70. /**
  71. * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start
  72. * and End should be in the same protocol.
  73. *
  74. * @return the endIpAddress value.
  75. */
  76. public String endIpAddress() {
  77. return this.endIpAddress;
  78. }
  79. /**
  80. * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start
  81. * and End should be in the same protocol.
  82. *
  83. * @param endIpAddress the endIpAddress value to set.
  84. * @return the CreateFirewallRuleWithAccountParameters object itself.
  85. */
  86. public CreateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) {
  87. this.endIpAddress = endIpAddress;
  88. return this;
  89. }
  90. /**
  91. * Validates the instance.
  92. *
  93. * @throws IllegalArgumentException thrown if the instance is not valid.
  94. */
  95. public void validate() {
  96. if (name() == null) {
  97. throw logger
  98. .logExceptionAsError(
  99. new IllegalArgumentException(
  100. "Missing required property name in model CreateFirewallRuleWithAccountParameters"));
  101. }
  102. if (startIpAddress() == null) {
  103. throw logger
  104. .logExceptionAsError(
  105. new IllegalArgumentException(
  106. "Missing required property startIpAddress in model CreateFirewallRuleWithAccountParameters"));
  107. }
  108. if (endIpAddress() == null) {
  109. throw logger
  110. .logExceptionAsError(
  111. new IllegalArgumentException(
  112. "Missing required property endIpAddress in model CreateFirewallRuleWithAccountParameters"));
  113. }
  114. }
  115. }