akeyless 5.0.21 → 5.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -1
  3. data/docs/AccountGeneralSettings.md +6 -0
  4. data/docs/ActiveDirectoryPayload.md +6 -0
  5. data/docs/Auth.md +2 -0
  6. data/docs/AuthMethodCreateCert.md +2 -0
  7. data/docs/AuthMethodCreateUniversalIdentity.md +4 -0
  8. data/docs/AuthMethodUpdateCert.md +2 -0
  9. data/docs/AuthMethodUpdateUniversalIdentity.md +4 -0
  10. data/docs/AwsStorage.md +2 -0
  11. data/docs/AzureADAccessRules.md +2 -0
  12. data/docs/AzureTargetDetails.md +2 -0
  13. data/docs/CertAccessRules.md +2 -0
  14. data/docs/CertificateChainInfo.md +2 -0
  15. data/docs/Configure.md +2 -0
  16. data/docs/ConjurMigration.md +20 -0
  17. data/docs/ConjurPayload.md +24 -0
  18. data/docs/CreateAuthMethodCert.md +2 -0
  19. data/docs/CreateAuthMethodUniversalIdentity.md +4 -0
  20. data/docs/CreateAzureTarget.md +2 -0
  21. data/docs/CreateRotatedSecret.md +3 -1
  22. data/docs/CreateSecret.md +2 -0
  23. data/docs/CreateUSC.md +10 -0
  24. data/docs/DSProducerDetails.md +2 -0
  25. data/docs/DefaultAuthMethodSettings.md +20 -0
  26. data/docs/DeleteRoleRule.md +1 -1
  27. data/docs/DescribePermissions.md +1 -1
  28. data/docs/DigiCertTargetDetails.md +42 -0
  29. data/docs/EsmListSecretsOutput.md +3 -1
  30. data/docs/GatewayCreateMigration.md +19 -1
  31. data/docs/GatewayUpdateMigration.md +18 -0
  32. data/docs/GatewayUpdateRemoteAccessRdpRecordings.md +2 -0
  33. data/docs/GeneralConfigPart.md +4 -0
  34. data/docs/GetPKICertificateOutput.md +2 -0
  35. data/docs/GithubMetadata.md +28 -0
  36. data/docs/GoogleTrustTargetDetails.md +42 -0
  37. data/docs/HTTPChallengeInfo.md +26 -0
  38. data/docs/HashiPayload.md +5 -1
  39. data/docs/IssuerOverviewInfo.md +22 -0
  40. data/docs/Item.md +2 -0
  41. data/docs/ItemGeneralInfo.md +2 -0
  42. data/docs/ItemLockingSetting.md +20 -0
  43. data/docs/LockItem.md +28 -0
  44. data/docs/LockTarget.md +28 -0
  45. data/docs/LockingInfo.md +24 -0
  46. data/docs/MigrationStatusReplyObj.md +4 -0
  47. data/docs/MigrationsConfigPart.md +2 -0
  48. data/docs/NetappStorage.md +30 -0
  49. data/docs/ReverseRBAC.md +1 -1
  50. data/docs/RotatedSecretCreateAws.md +3 -1
  51. data/docs/RotatedSecretCreateAzure.md +3 -1
  52. data/docs/RotatedSecretCreateCustom.md +3 -1
  53. data/docs/RotatedSecretCreateLdap.md +3 -1
  54. data/docs/RotatedSecretCreateMongodb.md +3 -1
  55. data/docs/RotatedSecretCreateMssql.md +3 -1
  56. data/docs/RotatedSecretCreateMysql.md +3 -1
  57. data/docs/RotatedSecretCreateOracledb.md +3 -1
  58. data/docs/RotatedSecretCreatePostgresql.md +3 -1
  59. data/docs/RotatedSecretCreateRedshift.md +3 -1
  60. data/docs/RotatedSecretCreateSsh.md +3 -1
  61. data/docs/RotatedSecretCreateWindows.md +3 -1
  62. data/docs/RotatedSecretUpdateAws.md +3 -1
  63. data/docs/RotatedSecretUpdateAzure.md +3 -1
  64. data/docs/RotatedSecretUpdateCustom.md +3 -1
  65. data/docs/RotatedSecretUpdateLdap.md +3 -1
  66. data/docs/RotatedSecretUpdateMongodb.md +3 -1
  67. data/docs/RotatedSecretUpdateMssql.md +3 -1
  68. data/docs/RotatedSecretUpdateMysql.md +3 -1
  69. data/docs/RotatedSecretUpdateOracledb.md +3 -1
  70. data/docs/RotatedSecretUpdatePostgresql.md +3 -1
  71. data/docs/RotatedSecretUpdateRedshift.md +3 -1
  72. data/docs/RotatedSecretUpdateSsh.md +3 -1
  73. data/docs/RotatedSecretUpdateWindows.md +3 -1
  74. data/docs/SecretInfo.md +4 -0
  75. data/docs/SecureRemoteAccess.md +4 -0
  76. data/docs/SetRoleRule.md +1 -1
  77. data/docs/SyncCounters.md +22 -0
  78. data/docs/Target.md +2 -0
  79. data/docs/TargetCreateAzure.md +2 -0
  80. data/docs/TargetCreateDigiCert.md +50 -0
  81. data/docs/TargetCreateGoogleTrust.md +50 -0
  82. data/docs/TargetCreateLetsEncrypt.md +1 -1
  83. data/docs/TargetCreateSplunk.md +3 -1
  84. data/docs/TargetTypeDetailsInput.md +4 -0
  85. data/docs/TargetUpdateAzure.md +2 -0
  86. data/docs/TargetUpdateDigiCert.md +54 -0
  87. data/docs/TargetUpdateGoogleTrust.md +54 -0
  88. data/docs/TargetUpdateLetsEncrypt.md +1 -1
  89. data/docs/UniversalIdentityAccessRules.md +4 -0
  90. data/docs/UnlockItem.md +24 -0
  91. data/docs/UnlockTarget.md +24 -0
  92. data/docs/UpdateAccountSettings.md +4 -0
  93. data/docs/UpdateAuthMethodCert.md +2 -0
  94. data/docs/UpdateAuthMethodUniversalIdentity.md +4 -0
  95. data/docs/UpdateAzureTarget.md +2 -0
  96. data/docs/UpdateItem.md +3 -1
  97. data/docs/UpdateRotatedSecret.md +3 -1
  98. data/docs/UscCreate.md +2 -0
  99. data/docs/UscDelete.md +4 -0
  100. data/docs/UscGet.md +4 -0
  101. data/docs/UscListSecretsOutput.md +3 -1
  102. data/docs/UscUpdate.md +4 -0
  103. data/docs/V2Api.md +632 -2
  104. data/docs/ValidateCertificateChallenge.md +30 -0
  105. data/docs/ValidateCertificateChallengeOutput.md +24 -0
  106. data/docs/VaultAddress.md +20 -0
  107. data/docs/VaultAddressOutput.md +20 -0
  108. data/docs/WebBastionRdpRecord.md +2 -0
  109. data/lib/akeyless/api/v2_api.rb +640 -0
  110. data/lib/akeyless/models/account_general_settings.rb +28 -1
  111. data/lib/akeyless/models/active_directory_payload.rb +30 -1
  112. data/lib/akeyless/models/auth.rb +13 -1
  113. data/lib/akeyless/models/auth_method_create_cert.rb +11 -1
  114. data/lib/akeyless/models/auth_method_create_universal_identity.rb +25 -1
  115. data/lib/akeyless/models/auth_method_update_cert.rb +11 -1
  116. data/lib/akeyless/models/auth_method_update_universal_identity.rb +25 -1
  117. data/lib/akeyless/models/aws_storage.rb +10 -1
  118. data/lib/akeyless/models/azure_ad_access_rules.rb +11 -1
  119. data/lib/akeyless/models/azure_target_details.rb +10 -1
  120. data/lib/akeyless/models/cert_access_rules.rb +11 -1
  121. data/lib/akeyless/models/certificate_chain_info.rb +11 -1
  122. data/lib/akeyless/models/configure.rb +13 -1
  123. data/lib/akeyless/models/conjur_migration.rb +223 -0
  124. data/lib/akeyless/models/conjur_payload.rb +241 -0
  125. data/lib/akeyless/models/create_auth_method_cert.rb +11 -1
  126. data/lib/akeyless/models/create_auth_method_universal_identity.rb +25 -1
  127. data/lib/akeyless/models/create_azure_target.rb +13 -1
  128. data/lib/akeyless/models/create_rotated_secret.rb +12 -4
  129. data/lib/akeyless/models/create_secret.rb +11 -1
  130. data/lib/akeyless/models/create_usc.rb +54 -1
  131. data/lib/akeyless/models/default_auth_method_settings.rb +223 -0
  132. data/lib/akeyless/models/delete_role_rule.rb +1 -1
  133. data/lib/akeyless/models/describe_permissions.rb +1 -1
  134. data/lib/akeyless/models/digi_cert_target_details.rb +333 -0
  135. data/lib/akeyless/models/ds_producer_details.rb +10 -1
  136. data/lib/akeyless/models/esm_list_secrets_output.rb +15 -4
  137. data/lib/akeyless/models/gateway_create_migration.rb +94 -2
  138. data/lib/akeyless/models/gateway_update_migration.rb +93 -1
  139. data/lib/akeyless/models/gateway_update_remote_access_rdp_recordings.rb +11 -1
  140. data/lib/akeyless/models/general_config_part.rb +19 -1
  141. data/lib/akeyless/models/get_pki_certificate_output.rb +10 -1
  142. data/lib/akeyless/models/github_metadata.rb +259 -0
  143. data/lib/akeyless/models/google_trust_target_details.rb +335 -0
  144. data/lib/akeyless/models/hashi_payload.rb +22 -4
  145. data/lib/akeyless/models/http_challenge_info.rb +251 -0
  146. data/lib/akeyless/models/issuer_overview_info.rb +232 -0
  147. data/lib/akeyless/models/item.rb +10 -1
  148. data/lib/akeyless/models/item_general_info.rb +10 -1
  149. data/lib/akeyless/models/item_locking_setting.rb +223 -0
  150. data/lib/akeyless/models/lock_item.rb +274 -0
  151. data/lib/akeyless/models/lock_target.rb +274 -0
  152. data/lib/akeyless/models/locking_info.rb +243 -0
  153. data/lib/akeyless/models/migration_status_reply_obj.rb +19 -1
  154. data/lib/akeyless/models/migrations_config_part.rb +12 -1
  155. data/lib/akeyless/models/netapp_storage.rb +268 -0
  156. data/lib/akeyless/models/reverse_rbac.rb +1 -1
  157. data/lib/akeyless/models/rotated_secret_create_aws.rb +12 -4
  158. data/lib/akeyless/models/rotated_secret_create_azure.rb +12 -4
  159. data/lib/akeyless/models/rotated_secret_create_custom.rb +12 -4
  160. data/lib/akeyless/models/rotated_secret_create_ldap.rb +12 -4
  161. data/lib/akeyless/models/rotated_secret_create_mongodb.rb +12 -4
  162. data/lib/akeyless/models/rotated_secret_create_mssql.rb +12 -4
  163. data/lib/akeyless/models/rotated_secret_create_mysql.rb +12 -4
  164. data/lib/akeyless/models/rotated_secret_create_oracledb.rb +12 -4
  165. data/lib/akeyless/models/rotated_secret_create_postgresql.rb +12 -4
  166. data/lib/akeyless/models/rotated_secret_create_redshift.rb +12 -4
  167. data/lib/akeyless/models/rotated_secret_create_ssh.rb +12 -4
  168. data/lib/akeyless/models/rotated_secret_create_windows.rb +12 -4
  169. data/lib/akeyless/models/rotated_secret_update_aws.rb +12 -4
  170. data/lib/akeyless/models/rotated_secret_update_azure.rb +12 -4
  171. data/lib/akeyless/models/rotated_secret_update_custom.rb +12 -4
  172. data/lib/akeyless/models/rotated_secret_update_ldap.rb +12 -4
  173. data/lib/akeyless/models/rotated_secret_update_mongodb.rb +12 -4
  174. data/lib/akeyless/models/rotated_secret_update_mssql.rb +12 -4
  175. data/lib/akeyless/models/rotated_secret_update_mysql.rb +12 -4
  176. data/lib/akeyless/models/rotated_secret_update_oracledb.rb +12 -4
  177. data/lib/akeyless/models/rotated_secret_update_postgresql.rb +12 -4
  178. data/lib/akeyless/models/rotated_secret_update_redshift.rb +12 -4
  179. data/lib/akeyless/models/rotated_secret_update_ssh.rb +12 -4
  180. data/lib/akeyless/models/rotated_secret_update_windows.rb +12 -4
  181. data/lib/akeyless/models/secret_info.rb +19 -1
  182. data/lib/akeyless/models/secure_remote_access.rb +19 -1
  183. data/lib/akeyless/models/set_role_rule.rb +1 -1
  184. data/lib/akeyless/models/sync_counters.rb +233 -0
  185. data/lib/akeyless/models/target.rb +10 -1
  186. data/lib/akeyless/models/target_create_azure.rb +13 -1
  187. data/lib/akeyless/models/target_create_digi_cert.rb +398 -0
  188. data/lib/akeyless/models/target_create_google_trust.rb +398 -0
  189. data/lib/akeyless/models/target_create_lets_encrypt.rb +7 -0
  190. data/lib/akeyless/models/target_create_splunk.rb +11 -1
  191. data/lib/akeyless/models/target_type_details_input.rb +19 -1
  192. data/lib/akeyless/models/target_update_azure.rb +13 -1
  193. data/lib/akeyless/models/target_update_digi_cert.rb +418 -0
  194. data/lib/akeyless/models/target_update_google_trust.rb +418 -0
  195. data/lib/akeyless/models/target_update_lets_encrypt.rb +7 -0
  196. data/lib/akeyless/models/universal_identity_access_rules.rb +19 -1
  197. data/lib/akeyless/models/unlock_item.rb +254 -0
  198. data/lib/akeyless/models/unlock_target.rb +254 -0
  199. data/lib/akeyless/models/update_account_settings.rb +21 -1
  200. data/lib/akeyless/models/update_auth_method_cert.rb +11 -1
  201. data/lib/akeyless/models/update_auth_method_universal_identity.rb +25 -1
  202. data/lib/akeyless/models/update_azure_target.rb +13 -1
  203. data/lib/akeyless/models/update_item.rb +12 -4
  204. data/lib/akeyless/models/update_rotated_secret.rb +12 -4
  205. data/lib/akeyless/models/usc_create.rb +10 -1
  206. data/lib/akeyless/models/usc_delete.rb +20 -1
  207. data/lib/akeyless/models/usc_get.rb +20 -1
  208. data/lib/akeyless/models/usc_list_secrets_output.rb +15 -4
  209. data/lib/akeyless/models/usc_update.rb +20 -1
  210. data/lib/akeyless/models/validate_certificate_challenge.rb +279 -0
  211. data/lib/akeyless/models/validate_certificate_challenge_output.rb +242 -0
  212. data/lib/akeyless/models/vault_address.rb +227 -0
  213. data/lib/akeyless/models/vault_address_output.rb +223 -0
  214. data/lib/akeyless/models/web_bastion_rdp_record.rb +10 -1
  215. data/lib/akeyless/version.rb +1 -1
  216. data/lib/akeyless.rb +24 -0
  217. data/spec/models/conjur_migration_spec.rb +42 -0
  218. data/spec/models/conjur_payload_spec.rb +54 -0
  219. data/spec/models/default_auth_method_settings_spec.rb +42 -0
  220. data/spec/models/digi_cert_target_details_spec.rb +108 -0
  221. data/spec/models/github_metadata_spec.rb +66 -0
  222. data/spec/models/google_trust_target_details_spec.rb +108 -0
  223. data/spec/models/http_challenge_info_spec.rb +60 -0
  224. data/spec/models/issuer_overview_info_spec.rb +48 -0
  225. data/spec/models/item_locking_setting_spec.rb +42 -0
  226. data/spec/models/lock_item_spec.rb +66 -0
  227. data/spec/models/lock_target_spec.rb +66 -0
  228. data/spec/models/locking_info_spec.rb +54 -0
  229. data/spec/models/netapp_storage_spec.rb +72 -0
  230. data/spec/models/sync_counters_spec.rb +48 -0
  231. data/spec/models/target_create_digi_cert_spec.rb +132 -0
  232. data/spec/models/target_create_google_trust_spec.rb +132 -0
  233. data/spec/models/target_update_digi_cert_spec.rb +144 -0
  234. data/spec/models/target_update_google_trust_spec.rb +144 -0
  235. data/spec/models/unlock_item_spec.rb +54 -0
  236. data/spec/models/unlock_target_spec.rb +54 -0
  237. data/spec/models/validate_certificate_challenge_output_spec.rb +54 -0
  238. data/spec/models/validate_certificate_challenge_spec.rb +72 -0
  239. data/spec/models/vault_address_output_spec.rb +42 -0
  240. data/spec/models/vault_address_spec.rb +42 -0
  241. metadata +1233 -1134
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class LockItem
18
+ # Comma-separated blocked actions (read, update)
19
+ attr_accessor :actions
20
+
21
+ # Set output format to JSON
22
+ attr_accessor :json
23
+
24
+ # Lock TTL in minutes
25
+ attr_accessor :lock_ttl
26
+
27
+ # Item name
28
+ attr_accessor :name
29
+
30
+ # Authentication token (see `/auth` and `/configure`)
31
+ attr_accessor :token
32
+
33
+ # The universal identity token, Required only for universal_identity authentication
34
+ attr_accessor :uid_token
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'actions' => :'actions',
40
+ :'json' => :'json',
41
+ :'lock_ttl' => :'lock-ttl',
42
+ :'name' => :'name',
43
+ :'token' => :'token',
44
+ :'uid_token' => :'uid-token'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'actions' => :'String',
57
+ :'json' => :'Boolean',
58
+ :'lock_ttl' => :'Integer',
59
+ :'name' => :'String',
60
+ :'token' => :'String',
61
+ :'uid_token' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::LockItem` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::LockItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'actions')
87
+ self.actions = attributes[:'actions']
88
+ end
89
+
90
+ if attributes.key?(:'json')
91
+ self.json = attributes[:'json']
92
+ else
93
+ self.json = false
94
+ end
95
+
96
+ if attributes.key?(:'lock_ttl')
97
+ self.lock_ttl = attributes[:'lock_ttl']
98
+ end
99
+
100
+ if attributes.key?(:'name')
101
+ self.name = attributes[:'name']
102
+ else
103
+ self.name = nil
104
+ end
105
+
106
+ if attributes.key?(:'token')
107
+ self.token = attributes[:'token']
108
+ end
109
+
110
+ if attributes.key?(:'uid_token')
111
+ self.uid_token = attributes[:'uid_token']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @name.nil?
121
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @name.nil?
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ actions == o.actions &&
141
+ json == o.json &&
142
+ lock_ttl == o.lock_ttl &&
143
+ name == o.name &&
144
+ token == o.token &&
145
+ uid_token == o.uid_token
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [actions, json, lock_ttl, name, token, uid_token].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def self._deserialize(type, value)
188
+ case type.to_sym
189
+ when :Time
190
+ Time.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ # models (e.g. Pet) or oneOf
221
+ klass = Akeyless.const_get(type)
222
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+
274
+ end
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class LockTarget
18
+ # Comma-separated blocked actions (read, update)
19
+ attr_accessor :actions
20
+
21
+ # Set output format to JSON
22
+ attr_accessor :json
23
+
24
+ # Lock TTL in minutes
25
+ attr_accessor :lock_ttl
26
+
27
+ # Target name
28
+ attr_accessor :name
29
+
30
+ # Authentication token (see `/auth` and `/configure`)
31
+ attr_accessor :token
32
+
33
+ # The universal identity token, Required only for universal_identity authentication
34
+ attr_accessor :uid_token
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'actions' => :'actions',
40
+ :'json' => :'json',
41
+ :'lock_ttl' => :'lock-ttl',
42
+ :'name' => :'name',
43
+ :'token' => :'token',
44
+ :'uid_token' => :'uid-token'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'actions' => :'String',
57
+ :'json' => :'Boolean',
58
+ :'lock_ttl' => :'Integer',
59
+ :'name' => :'String',
60
+ :'token' => :'String',
61
+ :'uid_token' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::LockTarget` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::LockTarget`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'actions')
87
+ self.actions = attributes[:'actions']
88
+ end
89
+
90
+ if attributes.key?(:'json')
91
+ self.json = attributes[:'json']
92
+ else
93
+ self.json = false
94
+ end
95
+
96
+ if attributes.key?(:'lock_ttl')
97
+ self.lock_ttl = attributes[:'lock_ttl']
98
+ end
99
+
100
+ if attributes.key?(:'name')
101
+ self.name = attributes[:'name']
102
+ else
103
+ self.name = nil
104
+ end
105
+
106
+ if attributes.key?(:'token')
107
+ self.token = attributes[:'token']
108
+ end
109
+
110
+ if attributes.key?(:'uid_token')
111
+ self.uid_token = attributes[:'uid_token']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @name.nil?
121
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @name.nil?
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ actions == o.actions &&
141
+ json == o.json &&
142
+ lock_ttl == o.lock_ttl &&
143
+ name == o.name &&
144
+ token == o.token &&
145
+ uid_token == o.uid_token
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [actions, json, lock_ttl, name, token, uid_token].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def self._deserialize(type, value)
188
+ case type.to_sym
189
+ when :Time
190
+ Time.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ # models (e.g. Pet) or oneOf
221
+ klass = Akeyless.const_get(type)
222
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+
274
+ end