pulp_container_client 2.1.3 → 2.2.0.post0

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 (154) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +20 -13
  4. data/docs/ContainerContainerDistribution.md +7 -7
  5. data/docs/ContainerContainerDistributionResponse.md +9 -7
  6. data/docs/ContainerContainerNamespace.md +17 -0
  7. data/docs/ContainerContainerNamespaceResponse.md +21 -0
  8. data/docs/ContainerContainerRemote.md +8 -0
  9. data/docs/ContainerContainerRemoteResponse.md +8 -0
  10. data/docs/ContentBlobsApi.md +2 -2
  11. data/docs/ContentManifestsApi.md +2 -2
  12. data/docs/ContentTagsApi.md +2 -2
  13. data/docs/ContentguardsContentRedirectApi.md +2 -2
  14. data/docs/DistributionsContainerApi.md +4 -2
  15. data/docs/ManifestCopy.md +1 -1
  16. data/docs/{InlineResponse2008.md → PaginatedRepositoryVersionResponseList.md} +4 -4
  17. data/docs/{InlineResponse200.md → PaginatedcontainerBlobResponseList.md} +4 -4
  18. data/docs/{InlineResponse2004.md → PaginatedcontainerContainerDistributionResponseList.md} +4 -4
  19. data/docs/PaginatedcontainerContainerNamespaceResponseList.md +23 -0
  20. data/docs/{InlineResponse2007.md → PaginatedcontainerContainerPushRepositoryResponseList.md} +4 -4
  21. data/docs/{InlineResponse2005.md → PaginatedcontainerContainerRemoteResponseList.md} +4 -4
  22. data/docs/{InlineResponse2006.md → PaginatedcontainerContainerRepositoryResponseList.md} +4 -4
  23. data/docs/{InlineResponse2003.md → PaginatedcontainerContentRedirectContentGuardResponseList.md} +4 -4
  24. data/docs/{InlineResponse2001.md → PaginatedcontainerManifestResponseList.md} +4 -4
  25. data/docs/{InlineResponse2002.md → PaginatedcontainerTagResponseList.md} +4 -4
  26. data/docs/PatchedcontainerContainerDistribution.md +7 -7
  27. data/docs/PatchedcontainerContainerRemote.md +8 -0
  28. data/docs/PulpContainerNamespacesApi.md +239 -0
  29. data/docs/RecursiveManage.md +1 -1
  30. data/docs/RemotesContainerApi.md +2 -2
  31. data/docs/RepositoriesContainerApi.md +2 -2
  32. data/docs/RepositoriesContainerPushApi.md +2 -2
  33. data/docs/RepositoriesContainerVersionsApi.md +8 -8
  34. data/docs/TagCopy.md +1 -1
  35. data/lib/pulp_container_client/api/content_blobs_api.rb +4 -4
  36. data/lib/pulp_container_client/api/content_manifests_api.rb +4 -4
  37. data/lib/pulp_container_client/api/content_tags_api.rb +4 -4
  38. data/lib/pulp_container_client/api/contentguards_content_redirect_api.rb +4 -4
  39. data/lib/pulp_container_client/api/distributions_container_api.rb +7 -4
  40. data/lib/pulp_container_client/api/pulp_container_namespaces_api.rb +285 -0
  41. data/lib/pulp_container_client/api/remotes_container_api.rb +4 -4
  42. data/lib/pulp_container_client/api/repositories_container_api.rb +4 -4
  43. data/lib/pulp_container_client/api/repositories_container_push_api.rb +4 -4
  44. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +15 -15
  45. data/lib/pulp_container_client/api/token_api.rb +1 -1
  46. data/lib/pulp_container_client/api_client.rb +12 -13
  47. data/lib/pulp_container_client/api_error.rb +1 -1
  48. data/lib/pulp_container_client/configuration.rb +1 -9
  49. data/lib/pulp_container_client/models/async_operation_response.rb +1 -1
  50. data/lib/pulp_container_client/models/container_blob_response.rb +1 -1
  51. data/lib/pulp_container_client/models/container_container_distribution.rb +31 -31
  52. data/lib/pulp_container_client/models/container_container_distribution_response.rb +42 -32
  53. data/lib/pulp_container_client/models/container_container_namespace.rb +231 -0
  54. data/lib/pulp_container_client/models/container_container_namespace_response.rb +250 -0
  55. data/lib/pulp_container_client/models/container_container_push_repository.rb +1 -1
  56. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +1 -1
  57. data/lib/pulp_container_client/models/container_container_remote.rb +106 -2
  58. data/lib/pulp_container_client/models/container_container_remote_response.rb +106 -2
  59. data/lib/pulp_container_client/models/container_container_repository.rb +1 -1
  60. data/lib/pulp_container_client/models/container_container_repository_response.rb +1 -1
  61. data/lib/pulp_container_client/models/container_content_redirect_content_guard.rb +1 -1
  62. data/lib/pulp_container_client/models/container_content_redirect_content_guard_response.rb +1 -1
  63. data/lib/pulp_container_client/models/container_manifest_response.rb +1 -1
  64. data/lib/pulp_container_client/models/container_tag_response.rb +1 -1
  65. data/lib/pulp_container_client/models/content_summary.rb +1 -1
  66. data/lib/pulp_container_client/models/content_summary_response.rb +1 -1
  67. data/lib/pulp_container_client/models/manifest_copy.rb +2 -2
  68. data/lib/pulp_container_client/models/oci_build_image.rb +1 -1
  69. data/lib/pulp_container_client/models/{inline_response2008.rb → paginated_repository_version_response_list.rb} +4 -4
  70. data/lib/pulp_container_client/models/{inline_response200.rb → paginatedcontainer_blob_response_list.rb} +4 -4
  71. data/lib/pulp_container_client/models/{inline_response2004.rb → paginatedcontainer_container_distribution_response_list.rb} +4 -4
  72. data/lib/pulp_container_client/models/paginatedcontainer_container_namespace_response_list.rb +237 -0
  73. data/lib/pulp_container_client/models/{inline_response2007.rb → paginatedcontainer_container_push_repository_response_list.rb} +4 -4
  74. data/lib/pulp_container_client/models/{inline_response2005.rb → paginatedcontainer_container_remote_response_list.rb} +4 -4
  75. data/lib/pulp_container_client/models/{inline_response2006.rb → paginatedcontainer_container_repository_response_list.rb} +4 -4
  76. data/lib/pulp_container_client/models/{inline_response2003.rb → paginatedcontainer_content_redirect_content_guard_response_list.rb} +4 -4
  77. data/lib/pulp_container_client/models/{inline_response2001.rb → paginatedcontainer_manifest_response_list.rb} +4 -4
  78. data/lib/pulp_container_client/models/{inline_response2002.rb → paginatedcontainer_tag_response_list.rb} +4 -4
  79. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +31 -31
  80. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +106 -2
  81. data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +1 -1
  82. data/lib/pulp_container_client/models/patchedcontainer_content_redirect_content_guard.rb +1 -1
  83. data/lib/pulp_container_client/models/policy_enum.rb +1 -1
  84. data/lib/pulp_container_client/models/recursive_manage.rb +2 -2
  85. data/lib/pulp_container_client/models/repository_sync_url.rb +1 -1
  86. data/lib/pulp_container_client/models/repository_version.rb +1 -1
  87. data/lib/pulp_container_client/models/repository_version_response.rb +1 -1
  88. data/lib/pulp_container_client/models/tag_copy.rb +2 -2
  89. data/lib/pulp_container_client/models/tag_image.rb +22 -1
  90. data/lib/pulp_container_client/models/un_tag_image.rb +22 -1
  91. data/lib/pulp_container_client/version.rb +2 -2
  92. data/lib/pulp_container_client.rb +14 -10
  93. data/pulp_container_client.gemspec +2 -2
  94. data/spec/api/content_blobs_api_spec.rb +2 -2
  95. data/spec/api/content_manifests_api_spec.rb +2 -2
  96. data/spec/api/content_tags_api_spec.rb +2 -2
  97. data/spec/api/contentguards_content_redirect_api_spec.rb +2 -2
  98. data/spec/api/distributions_container_api_spec.rb +3 -2
  99. data/spec/api/pulp_container_namespaces_api_spec.rb +89 -0
  100. data/spec/api/remotes_container_api_spec.rb +2 -2
  101. data/spec/api/repositories_container_api_spec.rb +2 -2
  102. data/spec/api/repositories_container_push_api_spec.rb +2 -2
  103. data/spec/api/repositories_container_versions_api_spec.rb +7 -7
  104. data/spec/api/token_api_spec.rb +1 -1
  105. data/spec/api_client_spec.rb +2 -2
  106. data/spec/configuration_spec.rb +1 -1
  107. data/spec/models/async_operation_response_spec.rb +1 -1
  108. data/spec/models/container_blob_response_spec.rb +1 -1
  109. data/spec/models/container_container_distribution_response_spec.rb +13 -7
  110. data/spec/models/container_container_distribution_spec.rb +5 -5
  111. data/spec/models/{inline_response200_spec.rb → container_container_namespace_response_spec.rb} +10 -16
  112. data/spec/models/container_container_namespace_spec.rb +41 -0
  113. data/spec/models/container_container_push_repository_response_spec.rb +1 -1
  114. data/spec/models/container_container_push_repository_spec.rb +1 -1
  115. data/spec/models/container_container_remote_response_spec.rb +25 -1
  116. data/spec/models/container_container_remote_spec.rb +25 -1
  117. data/spec/models/container_container_repository_response_spec.rb +1 -1
  118. data/spec/models/container_container_repository_spec.rb +1 -1
  119. data/spec/models/container_content_redirect_content_guard_response_spec.rb +1 -1
  120. data/spec/models/container_content_redirect_content_guard_spec.rb +1 -1
  121. data/spec/models/container_manifest_response_spec.rb +1 -1
  122. data/spec/models/container_tag_response_spec.rb +1 -1
  123. data/spec/models/content_summary_response_spec.rb +1 -1
  124. data/spec/models/content_summary_spec.rb +1 -1
  125. data/spec/models/manifest_copy_spec.rb +1 -1
  126. data/spec/models/oci_build_image_spec.rb +1 -1
  127. data/spec/models/{inline_response2003_spec.rb → paginated_repository_version_response_list_spec.rb} +7 -7
  128. data/spec/models/{inline_response2002_spec.rb → paginatedcontainer_blob_response_list_spec.rb} +7 -7
  129. data/spec/models/paginatedcontainer_container_distribution_response_list_spec.rb +59 -0
  130. data/spec/models/paginatedcontainer_container_namespace_response_list_spec.rb +59 -0
  131. data/spec/models/paginatedcontainer_container_push_repository_response_list_spec.rb +59 -0
  132. data/spec/models/paginatedcontainer_container_remote_response_list_spec.rb +59 -0
  133. data/spec/models/paginatedcontainer_container_repository_response_list_spec.rb +59 -0
  134. data/spec/models/paginatedcontainer_content_redirect_content_guard_response_list_spec.rb +59 -0
  135. data/spec/models/{inline_response2004_spec.rb → paginatedcontainer_manifest_response_list_spec.rb} +7 -7
  136. data/spec/models/{inline_response2001_spec.rb → paginatedcontainer_tag_response_list_spec.rb} +7 -7
  137. data/spec/models/patchedcontainer_container_distribution_spec.rb +5 -5
  138. data/spec/models/patchedcontainer_container_remote_spec.rb +25 -1
  139. data/spec/models/patchedcontainer_container_repository_spec.rb +1 -1
  140. data/spec/models/patchedcontainer_content_redirect_content_guard_spec.rb +1 -1
  141. data/spec/models/policy_enum_spec.rb +1 -1
  142. data/spec/models/recursive_manage_spec.rb +1 -1
  143. data/spec/models/repository_sync_url_spec.rb +1 -1
  144. data/spec/models/repository_version_response_spec.rb +1 -1
  145. data/spec/models/repository_version_spec.rb +1 -1
  146. data/spec/models/tag_copy_spec.rb +1 -1
  147. data/spec/models/tag_image_spec.rb +1 -1
  148. data/spec/models/un_tag_image_spec.rb +1 -1
  149. data/spec/spec_helper.rb +1 -1
  150. metadata +87 -77
  151. data/spec/models/inline_response2005_spec.rb +0 -59
  152. data/spec/models/inline_response2006_spec.rb +0 -59
  153. data/spec/models/inline_response2007_spec.rb +0 -59
  154. data/spec/models/inline_response2008_spec.rb +0 -59
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -15,40 +15,40 @@ require 'date'
15
15
  module PulpContainerClient
16
16
  # A serializer for ContainerDistribution.
17
17
  class ContainerContainerDistribution
18
- # An optional content-guard. If none is specified, a default one will be used.
19
- attr_accessor :content_guard
18
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
19
+ attr_accessor :base_path
20
20
 
21
21
  # RepositoryVersion to be served
22
22
  attr_accessor :repository_version
23
23
 
24
- # The latest RepositoryVersion for this Repository will be served.
25
- attr_accessor :repository
26
-
27
- # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
28
- attr_accessor :base_path
29
-
30
24
  # A unique name. Ex, `rawhide` and `stable`.
31
25
  attr_accessor :name
32
26
 
27
+ # An optional content-guard. If none is specified, a default one will be used.
28
+ attr_accessor :content_guard
29
+
30
+ # The latest RepositoryVersion for this Repository will be served.
31
+ attr_accessor :repository
32
+
33
33
  # Attribute mapping from ruby-style variable name to JSON key.
34
34
  def self.attribute_map
35
35
  {
36
- :'content_guard' => :'content_guard',
37
- :'repository_version' => :'repository_version',
38
- :'repository' => :'repository',
39
36
  :'base_path' => :'base_path',
40
- :'name' => :'name'
37
+ :'repository_version' => :'repository_version',
38
+ :'name' => :'name',
39
+ :'content_guard' => :'content_guard',
40
+ :'repository' => :'repository'
41
41
  }
42
42
  end
43
43
 
44
44
  # Attribute type mapping.
45
45
  def self.openapi_types
46
46
  {
47
- :'content_guard' => :'String',
48
- :'repository_version' => :'String',
49
- :'repository' => :'String',
50
47
  :'base_path' => :'String',
51
- :'name' => :'String'
48
+ :'repository_version' => :'String',
49
+ :'name' => :'String',
50
+ :'content_guard' => :'String',
51
+ :'repository' => :'String'
52
52
  }
53
53
  end
54
54
 
@@ -56,7 +56,7 @@ module PulpContainerClient
56
56
  def self.openapi_nullable
57
57
  Set.new([
58
58
  :'repository_version',
59
- :'repository',
59
+ :'repository'
60
60
  ])
61
61
  end
62
62
 
@@ -75,24 +75,24 @@ module PulpContainerClient
75
75
  h[k.to_sym] = v
76
76
  }
77
77
 
78
- if attributes.key?(:'content_guard')
79
- self.content_guard = attributes[:'content_guard']
78
+ if attributes.key?(:'base_path')
79
+ self.base_path = attributes[:'base_path']
80
80
  end
81
81
 
82
82
  if attributes.key?(:'repository_version')
83
83
  self.repository_version = attributes[:'repository_version']
84
84
  end
85
85
 
86
- if attributes.key?(:'repository')
87
- self.repository = attributes[:'repository']
86
+ if attributes.key?(:'name')
87
+ self.name = attributes[:'name']
88
88
  end
89
89
 
90
- if attributes.key?(:'base_path')
91
- self.base_path = attributes[:'base_path']
90
+ if attributes.key?(:'content_guard')
91
+ self.content_guard = attributes[:'content_guard']
92
92
  end
93
93
 
94
- if attributes.key?(:'name')
95
- self.name = attributes[:'name']
94
+ if attributes.key?(:'repository')
95
+ self.repository = attributes[:'repository']
96
96
  end
97
97
  end
98
98
 
@@ -124,11 +124,11 @@ module PulpContainerClient
124
124
  def ==(o)
125
125
  return true if self.equal?(o)
126
126
  self.class == o.class &&
127
- content_guard == o.content_guard &&
128
- repository_version == o.repository_version &&
129
- repository == o.repository &&
130
127
  base_path == o.base_path &&
131
- name == o.name
128
+ repository_version == o.repository_version &&
129
+ name == o.name &&
130
+ content_guard == o.content_guard &&
131
+ repository == o.repository
132
132
  end
133
133
 
134
134
  # @see the `==` method
@@ -140,7 +140,7 @@ module PulpContainerClient
140
140
  # Calculates hash code according to all attributes.
141
141
  # @return [Integer] Hash code
142
142
  def hash
143
- [content_guard, repository_version, repository, base_path, name].hash
143
+ [base_path, repository_version, name, content_guard, repository].hash
144
144
  end
145
145
 
146
146
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -15,54 +15,59 @@ require 'date'
15
15
  module PulpContainerClient
16
16
  # A serializer for ContainerDistribution.
17
17
  class ContainerContainerDistributionResponse
18
- # An optional content-guard. If none is specified, a default one will be used.
19
- attr_accessor :content_guard
18
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
19
+ attr_accessor :base_path
20
20
 
21
21
  # RepositoryVersion to be served
22
22
  attr_accessor :repository_version
23
23
 
24
- # The latest RepositoryVersion for this Repository will be served.
25
- attr_accessor :repository
26
-
27
24
  attr_accessor :pulp_href
28
25
 
29
26
  # Timestamp of creation.
30
27
  attr_accessor :pulp_created
31
28
 
32
- # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
33
- attr_accessor :base_path
34
-
35
29
  # A unique name. Ex, `rawhide` and `stable`.
36
30
  attr_accessor :name
37
31
 
32
+ # An optional content-guard. If none is specified, a default one will be used.
33
+ attr_accessor :content_guard
34
+
35
+ # The latest RepositoryVersion for this Repository will be served.
36
+ attr_accessor :repository
37
+
38
38
  # The Registry hostame/name/ to use with docker pull command defined by this distribution.
39
39
  attr_accessor :registry_path
40
40
 
41
+ # Namespace this distribution belongs to.
42
+ attr_accessor :namespace
43
+
41
44
  # Attribute mapping from ruby-style variable name to JSON key.
42
45
  def self.attribute_map
43
46
  {
44
- :'content_guard' => :'content_guard',
47
+ :'base_path' => :'base_path',
45
48
  :'repository_version' => :'repository_version',
46
- :'repository' => :'repository',
47
49
  :'pulp_href' => :'pulp_href',
48
50
  :'pulp_created' => :'pulp_created',
49
- :'base_path' => :'base_path',
50
51
  :'name' => :'name',
51
- :'registry_path' => :'registry_path'
52
+ :'content_guard' => :'content_guard',
53
+ :'repository' => :'repository',
54
+ :'registry_path' => :'registry_path',
55
+ :'namespace' => :'namespace'
52
56
  }
53
57
  end
54
58
 
55
59
  # Attribute type mapping.
56
60
  def self.openapi_types
57
61
  {
58
- :'content_guard' => :'String',
62
+ :'base_path' => :'String',
59
63
  :'repository_version' => :'String',
60
- :'repository' => :'String',
61
64
  :'pulp_href' => :'String',
62
65
  :'pulp_created' => :'DateTime',
63
- :'base_path' => :'String',
64
66
  :'name' => :'String',
65
- :'registry_path' => :'String'
67
+ :'content_guard' => :'String',
68
+ :'repository' => :'String',
69
+ :'registry_path' => :'String',
70
+ :'namespace' => :'String'
66
71
  }
67
72
  end
68
73
 
@@ -89,18 +94,14 @@ module PulpContainerClient
89
94
  h[k.to_sym] = v
90
95
  }
91
96
 
92
- if attributes.key?(:'content_guard')
93
- self.content_guard = attributes[:'content_guard']
97
+ if attributes.key?(:'base_path')
98
+ self.base_path = attributes[:'base_path']
94
99
  end
95
100
 
96
101
  if attributes.key?(:'repository_version')
97
102
  self.repository_version = attributes[:'repository_version']
98
103
  end
99
104
 
100
- if attributes.key?(:'repository')
101
- self.repository = attributes[:'repository']
102
- end
103
-
104
105
  if attributes.key?(:'pulp_href')
105
106
  self.pulp_href = attributes[:'pulp_href']
106
107
  end
@@ -109,17 +110,25 @@ module PulpContainerClient
109
110
  self.pulp_created = attributes[:'pulp_created']
110
111
  end
111
112
 
112
- if attributes.key?(:'base_path')
113
- self.base_path = attributes[:'base_path']
114
- end
115
-
116
113
  if attributes.key?(:'name')
117
114
  self.name = attributes[:'name']
118
115
  end
119
116
 
117
+ if attributes.key?(:'content_guard')
118
+ self.content_guard = attributes[:'content_guard']
119
+ end
120
+
121
+ if attributes.key?(:'repository')
122
+ self.repository = attributes[:'repository']
123
+ end
124
+
120
125
  if attributes.key?(:'registry_path')
121
126
  self.registry_path = attributes[:'registry_path']
122
127
  end
128
+
129
+ if attributes.key?(:'namespace')
130
+ self.namespace = attributes[:'namespace']
131
+ end
123
132
  end
124
133
 
125
134
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -150,14 +159,15 @@ module PulpContainerClient
150
159
  def ==(o)
151
160
  return true if self.equal?(o)
152
161
  self.class == o.class &&
153
- content_guard == o.content_guard &&
162
+ base_path == o.base_path &&
154
163
  repository_version == o.repository_version &&
155
- repository == o.repository &&
156
164
  pulp_href == o.pulp_href &&
157
165
  pulp_created == o.pulp_created &&
158
- base_path == o.base_path &&
159
166
  name == o.name &&
160
- registry_path == o.registry_path
167
+ content_guard == o.content_guard &&
168
+ repository == o.repository &&
169
+ registry_path == o.registry_path &&
170
+ namespace == o.namespace
161
171
  end
162
172
 
163
173
  # @see the `==` method
@@ -169,7 +179,7 @@ module PulpContainerClient
169
179
  # Calculates hash code according to all attributes.
170
180
  # @return [Integer] Hash code
171
181
  def hash
172
- [content_guard, repository_version, repository, pulp_href, pulp_created, base_path, name, registry_path].hash
182
+ [base_path, repository_version, pulp_href, pulp_created, name, content_guard, repository, registry_path, namespace].hash
173
183
  end
174
184
 
175
185
  # Builds the object from hash
@@ -0,0 +1,231 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ # Serializer for ContainerNamespaces.
17
+ class ContainerContainerNamespace
18
+ attr_accessor :name
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'name' => :'name'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'name' => :'String'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerNamespace` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerNamespace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'name')
56
+ self.name = attributes[:'name']
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ if @name.nil?
65
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
66
+ end
67
+
68
+ if @name.to_s.length > 255
69
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
70
+ end
71
+
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return false if @name.nil?
79
+ return false if @name.to_s.length > 255
80
+ true
81
+ end
82
+
83
+ # Custom attribute writer method with validation
84
+ # @param [Object] name Value to be assigned
85
+ def name=(name)
86
+ if name.nil?
87
+ fail ArgumentError, 'name cannot be nil'
88
+ end
89
+
90
+ if name.to_s.length > 255
91
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
92
+ end
93
+
94
+ @name = name
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ name == o.name
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [name].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.openapi_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :Boolean
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ PulpContainerClient.const_get(type).build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end