pulp_container_client 2.16.4 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -6
  3. data/docs/ContainerContainerDistribution.md +7 -7
  4. data/docs/ContainerContainerDistributionResponse.md +10 -8
  5. data/docs/ContainerContainerPullThroughDistribution.md +35 -0
  6. data/docs/ContainerContainerPullThroughDistributionResponse.md +41 -0
  7. data/docs/ContainerContainerPullThroughRemote.md +57 -0
  8. data/docs/ContainerContainerPullThroughRemoteResponse.md +55 -0
  9. data/docs/{ContainerContainerRemoteResponseHiddenFields.md → ContainerContainerPullThroughRemoteResponseHiddenFields.md} +2 -2
  10. data/docs/ContainerContainerPushRepository.md +5 -5
  11. data/docs/ContainerContainerPushRepositoryResponse.md +13 -13
  12. data/docs/ContainerContainerRemote.md +1 -1
  13. data/docs/ContainerContainerRemoteResponse.md +2 -2
  14. data/docs/ContentBlobsApi.md +2 -0
  15. data/docs/ContentManifestsApi.md +2 -0
  16. data/docs/ContentSignaturesApi.md +2 -0
  17. data/docs/ContentTagsApi.md +2 -0
  18. data/docs/DistributionsPullThroughApi.md +736 -0
  19. data/docs/PaginatedcontainerContainerPullThroughDistributionResponseList.md +23 -0
  20. data/docs/PaginatedcontainerContainerPullThroughRemoteResponseList.md +23 -0
  21. data/docs/PatchedcontainerContainerDistribution.md +7 -7
  22. data/docs/PatchedcontainerContainerPullThroughDistribution.md +35 -0
  23. data/docs/PatchedcontainerContainerPullThroughRemote.md +57 -0
  24. data/docs/PatchedcontainerContainerPushRepository.md +5 -5
  25. data/docs/PatchedcontainerContainerRemote.md +1 -1
  26. data/docs/{PolicyEnum.md → Policy762Enum.md} +2 -2
  27. data/docs/Policy8e2Enum.md +16 -0
  28. data/docs/RemotesPullThroughApi.md +734 -0
  29. data/lib/pulp_container_client/api/content_blobs_api.rb +3 -0
  30. data/lib/pulp_container_client/api/content_manifests_api.rb +3 -0
  31. data/lib/pulp_container_client/api/content_signatures_api.rb +3 -0
  32. data/lib/pulp_container_client/api/content_tags_api.rb +3 -0
  33. data/lib/pulp_container_client/api/distributions_pull_through_api.rb +907 -0
  34. data/lib/pulp_container_client/api/remotes_pull_through_api.rb +904 -0
  35. data/lib/pulp_container_client/models/container_container_distribution.rb +26 -26
  36. data/lib/pulp_container_client/models/container_container_distribution_response.rb +43 -33
  37. data/lib/pulp_container_client/models/container_container_pull_through_distribution.rb +373 -0
  38. data/lib/pulp_container_client/models/container_container_pull_through_distribution_response.rb +349 -0
  39. data/lib/pulp_container_client/models/container_container_pull_through_remote.rb +668 -0
  40. data/lib/pulp_container_client/models/container_container_pull_through_remote_response.rb +496 -0
  41. data/lib/pulp_container_client/models/{container_container_remote_response_hidden_fields.rb → container_container_pull_through_remote_response_hidden_fields.rb} +3 -3
  42. data/lib/pulp_container_client/models/container_container_push_repository.rb +47 -47
  43. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +56 -56
  44. data/lib/pulp_container_client/models/container_container_remote.rb +1 -1
  45. data/lib/pulp_container_client/models/container_container_remote_response.rb +2 -2
  46. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_distribution_response_list.rb +237 -0
  47. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_remote_response_list.rb +237 -0
  48. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +26 -26
  49. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_distribution.rb +350 -0
  50. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_remote.rb +650 -0
  51. data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +39 -39
  52. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +1 -1
  53. data/lib/pulp_container_client/models/{policy_enum.rb → policy762_enum.rb} +3 -3
  54. data/lib/pulp_container_client/models/policy8e2_enum.rb +35 -0
  55. data/lib/pulp_container_client/version.rb +1 -1
  56. data/lib/pulp_container_client.rb +13 -2
  57. data/spec/api/content_blobs_api_spec.rb +1 -0
  58. data/spec/api/content_manifests_api_spec.rb +1 -0
  59. data/spec/api/content_signatures_api_spec.rb +1 -0
  60. data/spec/api/content_tags_api_spec.rb +1 -0
  61. data/spec/api/distributions_pull_through_api_spec.rb +215 -0
  62. data/spec/api/remotes_pull_through_api_spec.rb +214 -0
  63. data/spec/models/container_container_distribution_response_spec.rb +12 -6
  64. data/spec/models/container_container_distribution_spec.rb +4 -4
  65. data/spec/models/container_container_pull_through_distribution_response_spec.rb +113 -0
  66. data/spec/models/container_container_pull_through_distribution_spec.rb +95 -0
  67. data/spec/models/{container_container_remote_response_hidden_fields_spec.rb → container_container_pull_through_remote_response_hidden_fields_spec.rb} +6 -6
  68. data/spec/models/container_container_pull_through_remote_response_spec.rb +155 -0
  69. data/spec/models/container_container_pull_through_remote_spec.rb +161 -0
  70. data/spec/models/container_container_push_repository_response_spec.rb +7 -7
  71. data/spec/models/container_container_push_repository_spec.rb +4 -4
  72. data/spec/models/paginatedcontainer_container_pull_through_distribution_response_list_spec.rb +59 -0
  73. data/spec/models/paginatedcontainer_container_pull_through_remote_response_list_spec.rb +59 -0
  74. data/spec/models/patchedcontainer_container_distribution_spec.rb +4 -4
  75. data/spec/models/patchedcontainer_container_pull_through_distribution_spec.rb +95 -0
  76. data/spec/models/patchedcontainer_container_pull_through_remote_spec.rb +161 -0
  77. data/spec/models/patchedcontainer_container_push_repository_spec.rb +4 -4
  78. data/spec/models/{policy_enum_spec.rb → policy762_enum_spec.rb} +6 -6
  79. data/spec/models/policy8e2_enum_spec.rb +35 -0
  80. metadata +103 -59
@@ -15,22 +15,22 @@ 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
20
+
18
21
  # 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
22
  attr_accessor :base_path
20
23
 
21
- # The latest RepositoryVersion for this Repository will be served.
22
- attr_accessor :repository
23
-
24
24
  # Whether this distribution should be shown in the content app.
25
25
  attr_accessor :hidden
26
26
 
27
- # An optional content-guard. If none is specified, a default one will be used.
28
- attr_accessor :content_guard
27
+ attr_accessor :pulp_labels
29
28
 
30
29
  # A unique name. Ex, `rawhide` and `stable`.
31
30
  attr_accessor :name
32
31
 
33
- attr_accessor :pulp_labels
32
+ # The latest RepositoryVersion for this Repository will be served.
33
+ attr_accessor :repository
34
34
 
35
35
  # RepositoryVersion to be served
36
36
  attr_accessor :repository_version
@@ -44,12 +44,12 @@ module PulpContainerClient
44
44
  # Attribute mapping from ruby-style variable name to JSON key.
45
45
  def self.attribute_map
46
46
  {
47
+ :'content_guard' => :'content_guard',
47
48
  :'base_path' => :'base_path',
48
- :'repository' => :'repository',
49
49
  :'hidden' => :'hidden',
50
- :'content_guard' => :'content_guard',
51
- :'name' => :'name',
52
50
  :'pulp_labels' => :'pulp_labels',
51
+ :'name' => :'name',
52
+ :'repository' => :'repository',
53
53
  :'repository_version' => :'repository_version',
54
54
  :'private' => :'private',
55
55
  :'description' => :'description'
@@ -59,12 +59,12 @@ module PulpContainerClient
59
59
  # Attribute type mapping.
60
60
  def self.openapi_types
61
61
  {
62
+ :'content_guard' => :'String',
62
63
  :'base_path' => :'String',
63
- :'repository' => :'String',
64
64
  :'hidden' => :'Boolean',
65
- :'content_guard' => :'String',
66
- :'name' => :'String',
67
65
  :'pulp_labels' => :'Hash<String, String>',
66
+ :'name' => :'String',
67
+ :'repository' => :'String',
68
68
  :'repository_version' => :'String',
69
69
  :'private' => :'Boolean',
70
70
  :'description' => :'String'
@@ -95,12 +95,12 @@ module PulpContainerClient
95
95
  h[k.to_sym] = v
96
96
  }
97
97
 
98
- if attributes.key?(:'base_path')
99
- self.base_path = attributes[:'base_path']
98
+ if attributes.key?(:'content_guard')
99
+ self.content_guard = attributes[:'content_guard']
100
100
  end
101
101
 
102
- if attributes.key?(:'repository')
103
- self.repository = attributes[:'repository']
102
+ if attributes.key?(:'base_path')
103
+ self.base_path = attributes[:'base_path']
104
104
  end
105
105
 
106
106
  if attributes.key?(:'hidden')
@@ -109,18 +109,18 @@ module PulpContainerClient
109
109
  self.hidden = false
110
110
  end
111
111
 
112
- if attributes.key?(:'content_guard')
113
- self.content_guard = attributes[:'content_guard']
112
+ if attributes.key?(:'pulp_labels')
113
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
114
+ self.pulp_labels = value
115
+ end
114
116
  end
115
117
 
116
118
  if attributes.key?(:'name')
117
119
  self.name = attributes[:'name']
118
120
  end
119
121
 
120
- if attributes.key?(:'pulp_labels')
121
- if (value = attributes[:'pulp_labels']).is_a?(Hash)
122
- self.pulp_labels = value
123
- end
122
+ if attributes.key?(:'repository')
123
+ self.repository = attributes[:'repository']
124
124
  end
125
125
 
126
126
  if attributes.key?(:'repository_version')
@@ -217,12 +217,12 @@ module PulpContainerClient
217
217
  def ==(o)
218
218
  return true if self.equal?(o)
219
219
  self.class == o.class &&
220
+ content_guard == o.content_guard &&
220
221
  base_path == o.base_path &&
221
- repository == o.repository &&
222
222
  hidden == o.hidden &&
223
- content_guard == o.content_guard &&
224
- name == o.name &&
225
223
  pulp_labels == o.pulp_labels &&
224
+ name == o.name &&
225
+ repository == o.repository &&
226
226
  repository_version == o.repository_version &&
227
227
  private == o.private &&
228
228
  description == o.description
@@ -237,7 +237,7 @@ module PulpContainerClient
237
237
  # Calculates hash code according to all attributes.
238
238
  # @return [Integer] Hash code
239
239
  def hash
240
- [base_path, repository, hidden, content_guard, name, pulp_labels, repository_version, private, description].hash
240
+ [content_guard, base_path, hidden, pulp_labels, name, repository, repository_version, private, description].hash
241
241
  end
242
242
 
243
243
  # Builds the object from hash
@@ -15,27 +15,27 @@ require 'date'
15
15
  module PulpContainerClient
16
16
  # A serializer for ContainerDistribution.
17
17
  class ContainerContainerDistributionResponse
18
- # Timestamp of creation.
19
- attr_accessor :pulp_created
18
+ # An optional content-guard. If none is specified, a default one will be used.
19
+ attr_accessor :content_guard
20
20
 
21
21
  # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
22
22
  attr_accessor :base_path
23
23
 
24
24
  attr_accessor :pulp_href
25
25
 
26
- # The latest RepositoryVersion for this Repository will be served.
27
- attr_accessor :repository
28
-
29
26
  # Whether this distribution should be shown in the content app.
30
27
  attr_accessor :hidden
31
28
 
32
- # An optional content-guard. If none is specified, a default one will be used.
33
- attr_accessor :content_guard
29
+ attr_accessor :pulp_labels
34
30
 
35
31
  # A unique name. Ex, `rawhide` and `stable`.
36
32
  attr_accessor :name
37
33
 
38
- attr_accessor :pulp_labels
34
+ # The latest RepositoryVersion for this Repository will be served.
35
+ attr_accessor :repository
36
+
37
+ # Timestamp of creation.
38
+ attr_accessor :pulp_created
39
39
 
40
40
  # RepositoryVersion to be served
41
41
  attr_accessor :repository_version
@@ -43,6 +43,9 @@ module PulpContainerClient
43
43
  # The Registry hostname/name/ to use with docker pull command defined by this distribution.
44
44
  attr_accessor :registry_path
45
45
 
46
+ # Remote that can be used to fetch content when using pull-through caching.
47
+ attr_accessor :remote
48
+
46
49
  # Namespace this distribution belongs to.
47
50
  attr_accessor :namespace
48
51
 
@@ -55,16 +58,17 @@ module PulpContainerClient
55
58
  # Attribute mapping from ruby-style variable name to JSON key.
56
59
  def self.attribute_map
57
60
  {
58
- :'pulp_created' => :'pulp_created',
61
+ :'content_guard' => :'content_guard',
59
62
  :'base_path' => :'base_path',
60
63
  :'pulp_href' => :'pulp_href',
61
- :'repository' => :'repository',
62
64
  :'hidden' => :'hidden',
63
- :'content_guard' => :'content_guard',
64
- :'name' => :'name',
65
65
  :'pulp_labels' => :'pulp_labels',
66
+ :'name' => :'name',
67
+ :'repository' => :'repository',
68
+ :'pulp_created' => :'pulp_created',
66
69
  :'repository_version' => :'repository_version',
67
70
  :'registry_path' => :'registry_path',
71
+ :'remote' => :'remote',
68
72
  :'namespace' => :'namespace',
69
73
  :'private' => :'private',
70
74
  :'description' => :'description'
@@ -74,16 +78,17 @@ module PulpContainerClient
74
78
  # Attribute type mapping.
75
79
  def self.openapi_types
76
80
  {
77
- :'pulp_created' => :'DateTime',
81
+ :'content_guard' => :'String',
78
82
  :'base_path' => :'String',
79
83
  :'pulp_href' => :'String',
80
- :'repository' => :'String',
81
84
  :'hidden' => :'Boolean',
82
- :'content_guard' => :'String',
83
- :'name' => :'String',
84
85
  :'pulp_labels' => :'Hash<String, String>',
86
+ :'name' => :'String',
87
+ :'repository' => :'String',
88
+ :'pulp_created' => :'DateTime',
85
89
  :'repository_version' => :'String',
86
90
  :'registry_path' => :'String',
91
+ :'remote' => :'String',
87
92
  :'namespace' => :'String',
88
93
  :'private' => :'Boolean',
89
94
  :'description' => :'String'
@@ -114,8 +119,8 @@ module PulpContainerClient
114
119
  h[k.to_sym] = v
115
120
  }
116
121
 
117
- if attributes.key?(:'pulp_created')
118
- self.pulp_created = attributes[:'pulp_created']
122
+ if attributes.key?(:'content_guard')
123
+ self.content_guard = attributes[:'content_guard']
119
124
  end
120
125
 
121
126
  if attributes.key?(:'base_path')
@@ -126,28 +131,28 @@ module PulpContainerClient
126
131
  self.pulp_href = attributes[:'pulp_href']
127
132
  end
128
133
 
129
- if attributes.key?(:'repository')
130
- self.repository = attributes[:'repository']
131
- end
132
-
133
134
  if attributes.key?(:'hidden')
134
135
  self.hidden = attributes[:'hidden']
135
136
  else
136
137
  self.hidden = false
137
138
  end
138
139
 
139
- if attributes.key?(:'content_guard')
140
- self.content_guard = attributes[:'content_guard']
140
+ if attributes.key?(:'pulp_labels')
141
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
142
+ self.pulp_labels = value
143
+ end
141
144
  end
142
145
 
143
146
  if attributes.key?(:'name')
144
147
  self.name = attributes[:'name']
145
148
  end
146
149
 
147
- if attributes.key?(:'pulp_labels')
148
- if (value = attributes[:'pulp_labels']).is_a?(Hash)
149
- self.pulp_labels = value
150
- end
150
+ if attributes.key?(:'repository')
151
+ self.repository = attributes[:'repository']
152
+ end
153
+
154
+ if attributes.key?(:'pulp_created')
155
+ self.pulp_created = attributes[:'pulp_created']
151
156
  end
152
157
 
153
158
  if attributes.key?(:'repository_version')
@@ -158,6 +163,10 @@ module PulpContainerClient
158
163
  self.registry_path = attributes[:'registry_path']
159
164
  end
160
165
 
166
+ if attributes.key?(:'remote')
167
+ self.remote = attributes[:'remote']
168
+ end
169
+
161
170
  if attributes.key?(:'namespace')
162
171
  self.namespace = attributes[:'namespace']
163
172
  end
@@ -199,16 +208,17 @@ module PulpContainerClient
199
208
  def ==(o)
200
209
  return true if self.equal?(o)
201
210
  self.class == o.class &&
202
- pulp_created == o.pulp_created &&
211
+ content_guard == o.content_guard &&
203
212
  base_path == o.base_path &&
204
213
  pulp_href == o.pulp_href &&
205
- repository == o.repository &&
206
214
  hidden == o.hidden &&
207
- content_guard == o.content_guard &&
208
- name == o.name &&
209
215
  pulp_labels == o.pulp_labels &&
216
+ name == o.name &&
217
+ repository == o.repository &&
218
+ pulp_created == o.pulp_created &&
210
219
  repository_version == o.repository_version &&
211
220
  registry_path == o.registry_path &&
221
+ remote == o.remote &&
212
222
  namespace == o.namespace &&
213
223
  private == o.private &&
214
224
  description == o.description
@@ -223,7 +233,7 @@ module PulpContainerClient
223
233
  # Calculates hash code according to all attributes.
224
234
  # @return [Integer] Hash code
225
235
  def hash
226
- [pulp_created, base_path, pulp_href, repository, hidden, content_guard, name, pulp_labels, repository_version, registry_path, namespace, private, description].hash
236
+ [content_guard, base_path, pulp_href, hidden, pulp_labels, name, repository, pulp_created, repository_version, registry_path, remote, namespace, private, description].hash
227
237
  end
228
238
 
229
239
  # Builds the object from hash
@@ -0,0 +1,373 @@
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 PulpContainerClient
16
+ # A serializer for a specialized pull-through distribution referencing sub-distributions.
17
+ class ContainerContainerPullThroughDistribution
18
+ # An optional content-guard. If none is specified, a default one will be used.
19
+ attr_accessor :content_guard
20
+
21
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
22
+ attr_accessor :base_path
23
+
24
+ # Whether this distribution should be shown in the content app.
25
+ attr_accessor :hidden
26
+
27
+ attr_accessor :pulp_labels
28
+
29
+ # A unique name. Ex, `rawhide` and `stable`.
30
+ attr_accessor :name
31
+
32
+ # The latest RepositoryVersion for this Repository will be served.
33
+ attr_accessor :repository
34
+
35
+ # Remote that can be used to fetch content when using pull-through caching.
36
+ attr_accessor :remote
37
+
38
+ # Distributions created after pulling content through cache
39
+ attr_accessor :distributions
40
+
41
+ # Restrict pull access to explicitly authorized users. Related distributions inherit this value. Defaults to unrestricted pull access.
42
+ attr_accessor :private
43
+
44
+ # An optional description.
45
+ attr_accessor :description
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'content_guard' => :'content_guard',
51
+ :'base_path' => :'base_path',
52
+ :'hidden' => :'hidden',
53
+ :'pulp_labels' => :'pulp_labels',
54
+ :'name' => :'name',
55
+ :'repository' => :'repository',
56
+ :'remote' => :'remote',
57
+ :'distributions' => :'distributions',
58
+ :'private' => :'private',
59
+ :'description' => :'description'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'content_guard' => :'String',
67
+ :'base_path' => :'String',
68
+ :'hidden' => :'Boolean',
69
+ :'pulp_labels' => :'Hash<String, String>',
70
+ :'name' => :'String',
71
+ :'repository' => :'String',
72
+ :'remote' => :'String',
73
+ :'distributions' => :'Array<String>',
74
+ :'private' => :'Boolean',
75
+ :'description' => :'String'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ :'repository',
83
+ :'description'
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerPullThroughDistribution` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerPullThroughDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'content_guard')
103
+ self.content_guard = attributes[:'content_guard']
104
+ end
105
+
106
+ if attributes.key?(:'base_path')
107
+ self.base_path = attributes[:'base_path']
108
+ end
109
+
110
+ if attributes.key?(:'hidden')
111
+ self.hidden = attributes[:'hidden']
112
+ else
113
+ self.hidden = false
114
+ end
115
+
116
+ if attributes.key?(:'pulp_labels')
117
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
118
+ self.pulp_labels = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'name')
123
+ self.name = attributes[:'name']
124
+ end
125
+
126
+ if attributes.key?(:'repository')
127
+ self.repository = attributes[:'repository']
128
+ end
129
+
130
+ if attributes.key?(:'remote')
131
+ self.remote = attributes[:'remote']
132
+ end
133
+
134
+ if attributes.key?(:'distributions')
135
+ if (value = attributes[:'distributions']).is_a?(Array)
136
+ self.distributions = value
137
+ end
138
+ end
139
+
140
+ if attributes.key?(:'private')
141
+ self.private = attributes[:'private']
142
+ end
143
+
144
+ if attributes.key?(:'description')
145
+ self.description = attributes[:'description']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = Array.new
153
+ if @base_path.nil?
154
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
155
+ end
156
+
157
+ if @base_path.to_s.length < 1
158
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
159
+ end
160
+
161
+ if @name.nil?
162
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
163
+ end
164
+
165
+ if @name.to_s.length < 1
166
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
167
+ end
168
+
169
+ if @remote.nil?
170
+ invalid_properties.push('invalid value for "remote", remote cannot be nil.')
171
+ end
172
+
173
+ if !@description.nil? && @description.to_s.length < 1
174
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
175
+ end
176
+
177
+ invalid_properties
178
+ end
179
+
180
+ # Check to see if the all the properties in the model are valid
181
+ # @return true if the model is valid
182
+ def valid?
183
+ return false if @base_path.nil?
184
+ return false if @base_path.to_s.length < 1
185
+ return false if @name.nil?
186
+ return false if @name.to_s.length < 1
187
+ return false if @remote.nil?
188
+ return false if !@description.nil? && @description.to_s.length < 1
189
+ true
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] base_path Value to be assigned
194
+ def base_path=(base_path)
195
+ if base_path.nil?
196
+ fail ArgumentError, 'base_path cannot be nil'
197
+ end
198
+
199
+ if base_path.to_s.length < 1
200
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
201
+ end
202
+
203
+ @base_path = base_path
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] name Value to be assigned
208
+ def name=(name)
209
+ if name.nil?
210
+ fail ArgumentError, 'name cannot be nil'
211
+ end
212
+
213
+ if name.to_s.length < 1
214
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
215
+ end
216
+
217
+ @name = name
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] description Value to be assigned
222
+ def description=(description)
223
+ if !description.nil? && description.to_s.length < 1
224
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
225
+ end
226
+
227
+ @description = description
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ content_guard == o.content_guard &&
236
+ base_path == o.base_path &&
237
+ hidden == o.hidden &&
238
+ pulp_labels == o.pulp_labels &&
239
+ name == o.name &&
240
+ repository == o.repository &&
241
+ remote == o.remote &&
242
+ distributions == o.distributions &&
243
+ private == o.private &&
244
+ description == o.description
245
+ end
246
+
247
+ # @see the `==` method
248
+ # @param [Object] Object to be compared
249
+ def eql?(o)
250
+ self == o
251
+ end
252
+
253
+ # Calculates hash code according to all attributes.
254
+ # @return [Integer] Hash code
255
+ def hash
256
+ [content_guard, base_path, hidden, pulp_labels, name, repository, remote, distributions, private, description].hash
257
+ end
258
+
259
+ # Builds the object from hash
260
+ # @param [Hash] attributes Model attributes in the form of hash
261
+ # @return [Object] Returns the model itself
262
+ def self.build_from_hash(attributes)
263
+ new.build_from_hash(attributes)
264
+ end
265
+
266
+ # Builds the object from hash
267
+ # @param [Hash] attributes Model attributes in the form of hash
268
+ # @return [Object] Returns the model itself
269
+ def build_from_hash(attributes)
270
+ return nil unless attributes.is_a?(Hash)
271
+ self.class.openapi_types.each_pair do |key, type|
272
+ if type =~ /\AArray<(.*)>/i
273
+ # check to ensure the input is an array given that the attribute
274
+ # is documented as an array but the input is not
275
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
276
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
277
+ end
278
+ elsif !attributes[self.class.attribute_map[key]].nil?
279
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
280
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
281
+ end
282
+
283
+ self
284
+ end
285
+
286
+ # Deserializes the data based on type
287
+ # @param string type Data type
288
+ # @param string value Value to be deserialized
289
+ # @return [Object] Deserialized data
290
+ def _deserialize(type, value)
291
+ case type.to_sym
292
+ when :DateTime
293
+ DateTime.parse(value)
294
+ when :Date
295
+ Date.parse(value)
296
+ when :String
297
+ value.to_s
298
+ when :Integer
299
+ value.to_i
300
+ when :Float
301
+ value.to_f
302
+ when :Boolean
303
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
304
+ true
305
+ else
306
+ false
307
+ end
308
+ when :Object
309
+ # generic object (usually a Hash), return directly
310
+ value
311
+ when /\AArray<(?<inner_type>.+)>\z/
312
+ inner_type = Regexp.last_match[:inner_type]
313
+ value.map { |v| _deserialize(inner_type, v) }
314
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
315
+ k_type = Regexp.last_match[:k_type]
316
+ v_type = Regexp.last_match[:v_type]
317
+ {}.tap do |hash|
318
+ value.each do |k, v|
319
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
320
+ end
321
+ end
322
+ else # model
323
+ PulpContainerClient.const_get(type).build_from_hash(value)
324
+ end
325
+ end
326
+
327
+ # Returns the string representation of the object
328
+ # @return [String] String presentation of the object
329
+ def to_s
330
+ to_hash.to_s
331
+ end
332
+
333
+ # to_body is an alias to to_hash (backward compatibility)
334
+ # @return [Hash] Returns the object in the form of hash
335
+ def to_body
336
+ to_hash
337
+ end
338
+
339
+ # Returns the object in the form of hash
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_hash
342
+ hash = {}
343
+ self.class.attribute_map.each_pair do |attr, param|
344
+ value = self.send(attr)
345
+ if value.nil?
346
+ is_nullable = self.class.openapi_nullable.include?(attr)
347
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
348
+ end
349
+
350
+ hash[param] = _to_hash(value)
351
+ end
352
+ hash
353
+ end
354
+
355
+ # Outputs non-array value in the form of hash
356
+ # For object, use to_hash. Otherwise, just return the value
357
+ # @param [Object] value Any valid value
358
+ # @return [Hash] Returns the value in the form of hash
359
+ def _to_hash(value)
360
+ if value.is_a?(Array)
361
+ value.compact.map { |v| _to_hash(v) }
362
+ elsif value.is_a?(Hash)
363
+ {}.tap do |hash|
364
+ value.each { |k, v| hash[k] = _to_hash(v) }
365
+ end
366
+ elsif value.respond_to? :to_hash
367
+ value.to_hash
368
+ else
369
+ value
370
+ end
371
+ end
372
+ end
373
+ end