pulp_ansible_client 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -32
  3. data/docs/AnsibleAnsibleRepositoryResponse.md +1 -1
  4. data/docs/AnsibleCollectionRemoteResponse.md +1 -1
  5. data/docs/AnsibleCollectionVersion.md +2 -2
  6. data/docs/AnsibleCollectionVersionResponse.md +3 -3
  7. data/docs/AnsibleCollectionsApi.md +15 -9
  8. data/docs/AnsibleCopyApi.md +1 -1
  9. data/docs/AnsibleGitRemote.md +23 -23
  10. data/docs/AnsibleGitRemoteResponse.md +21 -21
  11. data/docs/AnsibleRole.md +3 -3
  12. data/docs/AnsibleRoleResponse.md +4 -4
  13. data/docs/ApiCollectionsApi.md +1 -1
  14. data/docs/ApiRolesApi.md +1 -1
  15. data/docs/CollectionImportApi.md +1 -1
  16. data/docs/CollectionVersionListResponse.md +1 -1
  17. data/docs/CollectionVersionResponse.md +1 -1
  18. data/docs/ContentCollectionDeprecationsApi.md +3 -1
  19. data/docs/ContentCollectionMarksApi.md +4 -2
  20. data/docs/ContentCollectionSignaturesApi.md +5 -3
  21. data/docs/ContentCollectionVersionsApi.md +3 -3
  22. data/docs/ContentNamespacesApi.md +19 -1
  23. data/docs/ContentRolesApi.md +3 -1
  24. data/docs/DistributionsAnsibleApi.md +136 -10
  25. data/docs/GalaxyDetailApi.md +1 -1
  26. data/docs/PatchedansibleGitRemote.md +23 -23
  27. data/docs/PulpAnsibleApiApi.md +1 -1
  28. data/docs/PulpAnsibleApiV2CollectionsVersionsApi.md +1 -1
  29. data/docs/PulpAnsibleApiV3Api.md +1 -1
  30. data/docs/PulpAnsibleApiV3ArtifactsCollectionsApi.md +1 -1
  31. data/docs/PulpAnsibleApiV3CollectionVersionsAllApi.md +1 -1
  32. data/docs/PulpAnsibleApiV3CollectionsAllApi.md +3 -1
  33. data/docs/PulpAnsibleApiV3CollectionsApi.md +3 -1
  34. data/docs/PulpAnsibleApiV3CollectionsVersionsApi.md +1 -1
  35. data/docs/PulpAnsibleApiV3CollectionsVersionsDocsBlobApi.md +1 -1
  36. data/docs/PulpAnsibleApiV3NamespacesApi.md +19 -1
  37. data/docs/PulpAnsibleApiV3PluginAnsibleClientConfigurationApi.md +1 -1
  38. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsAllCollectionsApi.md +3 -1
  39. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsAllVersionsApi.md +1 -1
  40. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsApi.md +1 -1
  41. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsArtifactsApi.md +1 -1
  42. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsIndexApi.md +3 -1
  43. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsIndexVersionsApi.md +1 -1
  44. data/docs/PulpAnsibleApiV3PluginAnsibleContentCollectionsIndexVersionsDocsBlobApi.md +1 -1
  45. data/docs/PulpAnsibleApiV3PluginAnsibleContentNamespacesApi.md +23 -5
  46. data/docs/PulpAnsibleApiV3PluginAnsibleSearchCollectionVersionsApi.md +1 -1
  47. data/docs/PulpAnsibleArtifactsCollectionsV3Api.md +1 -1
  48. data/docs/PulpAnsibleDefaultApiApi.md +1 -1
  49. data/docs/PulpAnsibleDefaultApiV3Api.md +1 -1
  50. data/docs/PulpAnsibleDefaultApiV3ArtifactsCollectionsApi.md +1 -1
  51. data/docs/PulpAnsibleDefaultApiV3CollectionVersionsAllApi.md +1 -1
  52. data/docs/PulpAnsibleDefaultApiV3CollectionsAllApi.md +3 -1
  53. data/docs/PulpAnsibleDefaultApiV3CollectionsApi.md +3 -1
  54. data/docs/PulpAnsibleDefaultApiV3CollectionsVersionsApi.md +1 -1
  55. data/docs/PulpAnsibleDefaultApiV3CollectionsVersionsDocsBlobApi.md +1 -1
  56. data/docs/PulpAnsibleDefaultApiV3NamespacesApi.md +19 -1
  57. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleClientConfigurationApi.md +1 -1
  58. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsAllCollectionsApi.md +3 -1
  59. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsAllVersionsApi.md +1 -1
  60. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsApi.md +1 -1
  61. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsArtifactsApi.md +1 -1
  62. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsIndexApi.md +3 -1
  63. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsIndexVersionsApi.md +1 -1
  64. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentCollectionsIndexVersionsDocsBlobApi.md +1 -1
  65. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleContentNamespacesApi.md +23 -5
  66. data/docs/PulpAnsibleDefaultApiV3PluginAnsibleSearchCollectionVersionsApi.md +1 -1
  67. data/docs/PulpAnsibleTagsApi.md +1 -1
  68. data/docs/RemotesCollectionApi.md +135 -9
  69. data/docs/RemotesGitApi.md +135 -9
  70. data/docs/RemotesRoleApi.md +135 -9
  71. data/docs/RepositoriesAnsibleApi.md +136 -10
  72. data/docs/RepositoriesAnsibleVersionsApi.md +3 -1
  73. data/docs/SetLabel.md +19 -0
  74. data/docs/SetLabelResponse.md +19 -0
  75. data/docs/UnpaginatedCollectionVersionResponse.md +1 -1
  76. data/docs/UnsetLabel.md +17 -0
  77. data/docs/UnsetLabelResponse.md +19 -0
  78. data/docs/VersionsApi.md +1 -1
  79. data/lib/pulp_ansible_client/api/ansible_collections_api.rb +11 -0
  80. data/lib/pulp_ansible_client/api/content_collection_deprecations_api.rb +3 -0
  81. data/lib/pulp_ansible_client/api/content_collection_marks_api.rb +3 -0
  82. data/lib/pulp_ansible_client/api/content_collection_signatures_api.rb +3 -0
  83. data/lib/pulp_ansible_client/api/content_collection_versions_api.rb +3 -3
  84. data/lib/pulp_ansible_client/api/content_namespaces_api.rb +27 -0
  85. data/lib/pulp_ansible_client/api/content_roles_api.rb +3 -0
  86. data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +163 -0
  87. data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_collections_all_api.rb +3 -0
  88. data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_collections_api.rb +3 -0
  89. data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_namespaces_api.rb +27 -0
  90. data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_collections_all_collections_api.rb +3 -0
  91. data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_collections_index_api.rb +3 -0
  92. data/lib/pulp_ansible_client/api/pulp_ansible_api_v3_plugin_ansible_content_namespaces_api.rb +35 -8
  93. data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_collections_all_api.rb +3 -0
  94. data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_collections_api.rb +3 -0
  95. data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_namespaces_api.rb +27 -0
  96. data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_all_collections_api.rb +3 -0
  97. data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_index_api.rb +3 -0
  98. data/lib/pulp_ansible_client/api/pulp_ansible_default_api_v3_plugin_ansible_content_namespaces_api.rb +35 -8
  99. data/lib/pulp_ansible_client/api/remotes_collection_api.rb +163 -0
  100. data/lib/pulp_ansible_client/api/remotes_git_api.rb +163 -0
  101. data/lib/pulp_ansible_client/api/remotes_role_api.rb +163 -0
  102. data/lib/pulp_ansible_client/api/repositories_ansible_api.rb +163 -0
  103. data/lib/pulp_ansible_client/api/repositories_ansible_versions_api.rb +3 -0
  104. data/lib/pulp_ansible_client/configuration.rb +2 -2
  105. data/lib/pulp_ansible_client/models/ansible_ansible_repository_response.rb +1 -1
  106. data/lib/pulp_ansible_client/models/ansible_collection_remote_response.rb +1 -1
  107. data/lib/pulp_ansible_client/models/ansible_collection_version.rb +11 -11
  108. data/lib/pulp_ansible_client/models/ansible_collection_version_response.rb +10 -10
  109. data/lib/pulp_ansible_client/models/ansible_git_remote.rb +203 -203
  110. data/lib/pulp_ansible_client/models/ansible_git_remote_response.rb +111 -111
  111. data/lib/pulp_ansible_client/models/ansible_role.rb +11 -11
  112. data/lib/pulp_ansible_client/models/ansible_role_response.rb +14 -14
  113. data/lib/pulp_ansible_client/models/collection_version_list_response.rb +24 -0
  114. data/lib/pulp_ansible_client/models/collection_version_response.rb +24 -0
  115. data/lib/pulp_ansible_client/models/patchedansible_git_remote.rb +198 -198
  116. data/lib/pulp_ansible_client/models/{progress_report_response.rb → set_label.rb} +52 -59
  117. data/lib/pulp_ansible_client/models/set_label_response.rb +243 -0
  118. data/lib/pulp_ansible_client/models/unpaginated_collection_version_response.rb +24 -0
  119. data/lib/pulp_ansible_client/models/{task.rb → unset_label.rb} +31 -55
  120. data/lib/pulp_ansible_client/models/unset_label_response.rb +242 -0
  121. data/lib/pulp_ansible_client/version.rb +1 -1
  122. data/lib/pulp_ansible_client.rb +4 -3
  123. data/spec/api/ansible_collections_api_spec.rb +5 -0
  124. data/spec/api/content_collection_deprecations_api_spec.rb +1 -0
  125. data/spec/api/content_collection_marks_api_spec.rb +1 -0
  126. data/spec/api/content_collection_signatures_api_spec.rb +1 -0
  127. data/spec/api/content_collection_versions_api_spec.rb +1 -1
  128. data/spec/api/content_namespaces_api_spec.rb +9 -0
  129. data/spec/api/content_roles_api_spec.rb +1 -0
  130. data/spec/api/distributions_ansible_api_spec.rb +35 -0
  131. data/spec/api/pulp_ansible_api_v3_collections_all_api_spec.rb +1 -0
  132. data/spec/api/pulp_ansible_api_v3_collections_api_spec.rb +1 -0
  133. data/spec/api/pulp_ansible_api_v3_namespaces_api_spec.rb +9 -0
  134. data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_collections_all_collections_api_spec.rb +1 -0
  135. data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_collections_index_api_spec.rb +1 -0
  136. data/spec/api/pulp_ansible_api_v3_plugin_ansible_content_namespaces_api_spec.rb +13 -4
  137. data/spec/api/pulp_ansible_default_api_v3_collections_all_api_spec.rb +1 -0
  138. data/spec/api/pulp_ansible_default_api_v3_collections_api_spec.rb +1 -0
  139. data/spec/api/pulp_ansible_default_api_v3_namespaces_api_spec.rb +9 -0
  140. data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_all_collections_api_spec.rb +1 -0
  141. data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_collections_index_api_spec.rb +1 -0
  142. data/spec/api/pulp_ansible_default_api_v3_plugin_ansible_content_namespaces_api_spec.rb +13 -4
  143. data/spec/api/remotes_collection_api_spec.rb +35 -0
  144. data/spec/api/remotes_git_api_spec.rb +35 -0
  145. data/spec/api/remotes_role_api_spec.rb +35 -0
  146. data/spec/api/repositories_ansible_api_spec.rb +35 -0
  147. data/spec/api/repositories_ansible_versions_api_spec.rb +1 -0
  148. data/spec/configuration_spec.rb +3 -3
  149. data/spec/models/ansible_collection_version_response_spec.rb +3 -3
  150. data/spec/models/ansible_collection_version_spec.rb +2 -2
  151. data/spec/models/ansible_git_remote_response_spec.rb +19 -19
  152. data/spec/models/ansible_git_remote_spec.rb +19 -19
  153. data/spec/models/ansible_role_response_spec.rb +2 -2
  154. data/spec/models/ansible_role_spec.rb +2 -2
  155. data/spec/models/patchedansible_git_remote_spec.rb +19 -19
  156. data/spec/models/set_label_response_spec.rb +47 -0
  157. data/spec/models/{task_spec.rb → set_label_spec.rb} +8 -8
  158. data/spec/models/unset_label_response_spec.rb +47 -0
  159. data/spec/models/unset_label_spec.rb +41 -0
  160. metadata +147 -143
  161. data/docs/ProgressReportResponse.md +0 -27
  162. data/docs/Task.md +0 -19
  163. data/docs/TaskResponse.md +0 -47
  164. data/lib/pulp_ansible_client/models/task_response.rb +0 -376
  165. data/spec/models/progress_report_response_spec.rb +0 -71
  166. data/spec/models/task_response_spec.rb +0 -131
@@ -13,54 +13,32 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module PulpAnsibleClient
16
- # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
17
- class ProgressReportResponse
18
- # The message shown to the user for the progress report.
19
- attr_accessor :message
16
+ # Serializer for synchronously setting a label.
17
+ class SetLabel
18
+ attr_accessor :key
20
19
 
21
- # Identifies the type of progress report'.
22
- attr_accessor :code
23
-
24
- # The current state of the progress report. The possible values are: 'waiting', 'skipped', 'running', 'completed', 'failed', 'canceled' and 'canceling'. The default is 'waiting'.
25
- attr_accessor :state
26
-
27
- # The total count of items.
28
- attr_accessor :total
29
-
30
- # The count of items already processed. Defaults to 0.
31
- attr_accessor :done
32
-
33
- # The suffix to be shown with the progress report.
34
- attr_accessor :suffix
20
+ attr_accessor :value
35
21
 
36
22
  # Attribute mapping from ruby-style variable name to JSON key.
37
23
  def self.attribute_map
38
24
  {
39
- :'message' => :'message',
40
- :'code' => :'code',
41
- :'state' => :'state',
42
- :'total' => :'total',
43
- :'done' => :'done',
44
- :'suffix' => :'suffix'
25
+ :'key' => :'key',
26
+ :'value' => :'value'
45
27
  }
46
28
  end
47
29
 
48
30
  # Attribute type mapping.
49
31
  def self.openapi_types
50
32
  {
51
- :'message' => :'String',
52
- :'code' => :'String',
53
- :'state' => :'String',
54
- :'total' => :'Integer',
55
- :'done' => :'Integer',
56
- :'suffix' => :'String'
33
+ :'key' => :'String',
34
+ :'value' => :'String'
57
35
  }
58
36
  end
59
37
 
60
38
  # List of attributes with nullable: true
61
39
  def self.openapi_nullable
62
40
  Set.new([
63
- :'suffix'
41
+ :'value'
64
42
  ])
65
43
  end
66
44
 
@@ -68,66 +46,81 @@ module PulpAnsibleClient
68
46
  # @param [Hash] attributes Model attributes in the form of hash
69
47
  def initialize(attributes = {})
70
48
  if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::ProgressReportResponse` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::SetLabel` initialize method"
72
50
  end
73
51
 
74
52
  # check to see if the attribute exists and convert string to symbol for hash key
75
53
  attributes = attributes.each_with_object({}) { |(k, v), h|
76
54
  if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::ProgressReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::SetLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
56
  end
79
57
  h[k.to_sym] = v
80
58
  }
81
59
 
82
- if attributes.key?(:'message')
83
- self.message = attributes[:'message']
84
- end
85
-
86
- if attributes.key?(:'code')
87
- self.code = attributes[:'code']
60
+ if attributes.key?(:'key')
61
+ self.key = attributes[:'key']
88
62
  end
89
63
 
90
- if attributes.key?(:'state')
91
- self.state = attributes[:'state']
64
+ if attributes.key?(:'value')
65
+ self.value = attributes[:'value']
92
66
  end
67
+ end
93
68
 
94
- if attributes.key?(:'total')
95
- self.total = attributes[:'total']
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @key.nil?
74
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
96
75
  end
97
76
 
98
- if attributes.key?(:'done')
99
- self.done = attributes[:'done']
77
+ if @key.to_s.length < 1
78
+ invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
100
79
  end
101
80
 
102
- if attributes.key?(:'suffix')
103
- self.suffix = attributes[:'suffix']
81
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
82
+ if @key !~ pattern
83
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
104
84
  end
105
- end
106
85
 
107
- # Show invalid properties with the reasons. Usually used together with valid?
108
- # @return Array for valid properties with the reasons
109
- def list_invalid_properties
110
- invalid_properties = Array.new
111
86
  invalid_properties
112
87
  end
113
88
 
114
89
  # Check to see if the all the properties in the model are valid
115
90
  # @return true if the model is valid
116
91
  def valid?
92
+ return false if @key.nil?
93
+ return false if @key.to_s.length < 1
94
+ return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
117
95
  true
118
96
  end
119
97
 
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] key Value to be assigned
100
+ def key=(key)
101
+ if key.nil?
102
+ fail ArgumentError, 'key cannot be nil'
103
+ end
104
+
105
+ if key.to_s.length < 1
106
+ fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
107
+ end
108
+
109
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
110
+ if key !~ pattern
111
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
112
+ end
113
+
114
+ @key = key
115
+ end
116
+
120
117
  # Checks equality by comparing each attribute.
121
118
  # @param [Object] Object to be compared
122
119
  def ==(o)
123
120
  return true if self.equal?(o)
124
121
  self.class == o.class &&
125
- message == o.message &&
126
- code == o.code &&
127
- state == o.state &&
128
- total == o.total &&
129
- done == o.done &&
130
- suffix == o.suffix
122
+ key == o.key &&
123
+ value == o.value
131
124
  end
132
125
 
133
126
  # @see the `==` method
@@ -139,7 +132,7 @@ module PulpAnsibleClient
139
132
  # Calculates hash code according to all attributes.
140
133
  # @return [Integer] Hash code
141
134
  def hash
142
- [message, code, state, total, done, suffix].hash
135
+ [key, value].hash
143
136
  end
144
137
 
145
138
  # Builds the object from hash
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpAnsibleClient
16
+ # Serializer for synchronously setting a label.
17
+ class SetLabelResponse
18
+ attr_accessor :key
19
+
20
+ attr_accessor :value
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'key' => :'key',
26
+ :'value' => :'value'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.openapi_types
32
+ {
33
+ :'key' => :'String',
34
+ :'value' => :'String'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ :'value'
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::SetLabelResponse` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::SetLabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'key')
61
+ self.key = attributes[:'key']
62
+ end
63
+
64
+ if attributes.key?(:'value')
65
+ self.value = attributes[:'value']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @key.nil?
74
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
75
+ end
76
+
77
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
78
+ if @key !~ pattern
79
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return false if @key.nil?
89
+ return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] key Value to be assigned
95
+ def key=(key)
96
+ if key.nil?
97
+ fail ArgumentError, 'key cannot be nil'
98
+ end
99
+
100
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
101
+ if key !~ pattern
102
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
103
+ end
104
+
105
+ @key = key
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ key == o.key &&
114
+ value == o.value
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [key, value].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.openapi_types.each_pair do |key, type|
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :Boolean
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ PulpAnsibleClient.const_get(type).build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ end
243
+ end
@@ -183,6 +183,14 @@ module PulpAnsibleClient
183
183
  # @return Array for valid properties with the reasons
184
184
  def list_invalid_properties
185
185
  invalid_properties = Array.new
186
+ if @version.nil?
187
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
188
+ end
189
+
190
+ if @version.to_s.length > 128
191
+ invalid_properties.push('invalid value for "version", the character length must be smaller than or equal to 128.')
192
+ end
193
+
186
194
  if @created_at.nil?
187
195
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
188
196
  end
@@ -205,6 +213,8 @@ module PulpAnsibleClient
205
213
  # Check to see if the all the properties in the model are valid
206
214
  # @return true if the model is valid
207
215
  def valid?
216
+ return false if @version.nil?
217
+ return false if @version.to_s.length > 128
208
218
  return false if @created_at.nil?
209
219
  return false if @updated_at.nil?
210
220
  return false if !@requires_ansible.nil? && @requires_ansible.to_s.length > 255
@@ -212,6 +222,20 @@ module PulpAnsibleClient
212
222
  true
213
223
  end
214
224
 
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] version Value to be assigned
227
+ def version=(version)
228
+ if version.nil?
229
+ fail ArgumentError, 'version cannot be nil'
230
+ end
231
+
232
+ if version.to_s.length > 128
233
+ fail ArgumentError, 'invalid value for "version", the character length must be smaller than or equal to 128.'
234
+ end
235
+
236
+ @version = version
237
+ end
238
+
215
239
  # Custom attribute writer method with validation
216
240
  # @param [Object] requires_ansible Value to be assigned
217
241
  def requires_ansible=(requires_ansible)
@@ -13,27 +13,21 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module PulpAnsibleClient
16
- # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
17
- class Task
18
- # The name of task.
19
- attr_accessor :name
20
-
21
- # The logging correlation id associated with this task
22
- attr_accessor :logging_cid
16
+ # Serializer for synchronously setting a label.
17
+ class UnsetLabel
18
+ attr_accessor :key
23
19
 
24
20
  # Attribute mapping from ruby-style variable name to JSON key.
25
21
  def self.attribute_map
26
22
  {
27
- :'name' => :'name',
28
- :'logging_cid' => :'logging_cid'
23
+ :'key' => :'key'
29
24
  }
30
25
  end
31
26
 
32
27
  # Attribute type mapping.
33
28
  def self.openapi_types
34
29
  {
35
- :'name' => :'String',
36
- :'logging_cid' => :'String'
30
+ :'key' => :'String'
37
31
  }
38
32
  end
39
33
 
@@ -47,23 +41,19 @@ module PulpAnsibleClient
47
41
  # @param [Hash] attributes Model attributes in the form of hash
48
42
  def initialize(attributes = {})
49
43
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::Task` initialize method"
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::UnsetLabel` initialize method"
51
45
  end
52
46
 
53
47
  # check to see if the attribute exists and convert string to symbol for hash key
54
48
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
49
  if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::Task`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::UnsetLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
51
  end
58
52
  h[k.to_sym] = v
59
53
  }
60
54
 
61
- if attributes.key?(:'name')
62
- self.name = attributes[:'name']
63
- end
64
-
65
- if attributes.key?(:'logging_cid')
66
- self.logging_cid = attributes[:'logging_cid']
55
+ if attributes.key?(:'key')
56
+ self.key = attributes[:'key']
67
57
  end
68
58
  end
69
59
 
@@ -71,20 +61,17 @@ module PulpAnsibleClient
71
61
  # @return Array for valid properties with the reasons
72
62
  def list_invalid_properties
73
63
  invalid_properties = Array.new
74
- if @name.nil?
75
- invalid_properties.push('invalid value for "name", name cannot be nil.')
76
- end
77
-
78
- if @name.to_s.length < 1
79
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
64
+ if @key.nil?
65
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
80
66
  end
81
67
 
82
- if @logging_cid.nil?
83
- invalid_properties.push('invalid value for "logging_cid", logging_cid cannot be nil.')
68
+ if @key.to_s.length < 1
69
+ invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
84
70
  end
85
71
 
86
- if @logging_cid.to_s.length < 1
87
- invalid_properties.push('invalid value for "logging_cid", the character length must be great than or equal to 1.')
72
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
73
+ if @key !~ pattern
74
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
88
75
  end
89
76
 
90
77
  invalid_properties
@@ -93,39 +80,29 @@ module PulpAnsibleClient
93
80
  # Check to see if the all the properties in the model are valid
94
81
  # @return true if the model is valid
95
82
  def valid?
96
- return false if @name.nil?
97
- return false if @name.to_s.length < 1
98
- return false if @logging_cid.nil?
99
- return false if @logging_cid.to_s.length < 1
83
+ return false if @key.nil?
84
+ return false if @key.to_s.length < 1
85
+ return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
100
86
  true
101
87
  end
102
88
 
103
89
  # Custom attribute writer method with validation
104
- # @param [Object] name Value to be assigned
105
- def name=(name)
106
- if name.nil?
107
- fail ArgumentError, 'name cannot be nil'
90
+ # @param [Object] key Value to be assigned
91
+ def key=(key)
92
+ if key.nil?
93
+ fail ArgumentError, 'key cannot be nil'
108
94
  end
109
95
 
110
- if name.to_s.length < 1
111
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
112
- end
113
-
114
- @name = name
115
- end
116
-
117
- # Custom attribute writer method with validation
118
- # @param [Object] logging_cid Value to be assigned
119
- def logging_cid=(logging_cid)
120
- if logging_cid.nil?
121
- fail ArgumentError, 'logging_cid cannot be nil'
96
+ if key.to_s.length < 1
97
+ fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
122
98
  end
123
99
 
124
- if logging_cid.to_s.length < 1
125
- fail ArgumentError, 'invalid value for "logging_cid", the character length must be great than or equal to 1.'
100
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
101
+ if key !~ pattern
102
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
126
103
  end
127
104
 
128
- @logging_cid = logging_cid
105
+ @key = key
129
106
  end
130
107
 
131
108
  # Checks equality by comparing each attribute.
@@ -133,8 +110,7 @@ module PulpAnsibleClient
133
110
  def ==(o)
134
111
  return true if self.equal?(o)
135
112
  self.class == o.class &&
136
- name == o.name &&
137
- logging_cid == o.logging_cid
113
+ key == o.key
138
114
  end
139
115
 
140
116
  # @see the `==` method
@@ -146,7 +122,7 @@ module PulpAnsibleClient
146
122
  # Calculates hash code according to all attributes.
147
123
  # @return [Integer] Hash code
148
124
  def hash
149
- [name, logging_cid].hash
125
+ [key].hash
150
126
  end
151
127
 
152
128
  # Builds the object from hash