pulp_container_client 2.0.0b3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +69 -57
  3. data/docs/{ContainerBlob.md → ContainerBlobResponse.md} +2 -2
  4. data/docs/ContainerContainerDistribution.md +6 -12
  5. data/docs/ContainerContainerDistributionResponse.md +31 -0
  6. data/docs/ContainerContainerPushRepository.md +4 -10
  7. data/docs/ContainerContainerPushRepositoryResponse.md +29 -0
  8. data/docs/ContainerContainerRemote.md +8 -12
  9. data/docs/ContainerContainerRemoteResponse.md +49 -0
  10. data/docs/ContainerContainerRepository.md +4 -10
  11. data/docs/ContainerContainerRepositoryResponse.md +29 -0
  12. data/docs/ContainerContentRedirectContentGuard.md +1 -5
  13. data/docs/ContainerContentRedirectContentGuardResponse.md +23 -0
  14. data/docs/{ContainerManifest.md → ContainerManifestResponse.md} +2 -2
  15. data/docs/{ContainerTag.md → ContainerTagResponse.md} +2 -4
  16. data/docs/ContentBlobsApi.md +24 -24
  17. data/docs/ContentManifestsApi.md +24 -24
  18. data/docs/ContentSummary.md +3 -3
  19. data/docs/ContentSummaryResponse.md +21 -0
  20. data/docs/ContentTagsApi.md +26 -26
  21. data/docs/ContentguardsContentRedirectApi.md +55 -55
  22. data/docs/DistributionsContainerApi.md +108 -60
  23. data/docs/InlineResponse200.md +3 -3
  24. data/docs/InlineResponse2001.md +3 -3
  25. data/docs/InlineResponse2002.md +3 -3
  26. data/docs/InlineResponse2003.md +3 -3
  27. data/docs/InlineResponse2004.md +3 -3
  28. data/docs/InlineResponse2005.md +3 -3
  29. data/docs/InlineResponse2006.md +3 -3
  30. data/docs/InlineResponse2007.md +3 -3
  31. data/docs/InlineResponse2008.md +3 -3
  32. data/docs/ManifestCopy.md +1 -1
  33. data/docs/OCIBuildImage.md +23 -0
  34. data/docs/PatchedcontainerContainerDistribution.md +25 -0
  35. data/docs/PatchedcontainerContainerRemote.md +43 -0
  36. data/docs/PatchedcontainerContainerRepository.md +21 -0
  37. data/docs/PatchedcontainerContentRedirectContentGuard.md +19 -0
  38. data/docs/PolicyEnum.md +16 -0
  39. data/docs/RecursiveManage.md +1 -1
  40. data/docs/RemotesContainerApi.md +125 -65
  41. data/docs/RepositoriesContainerApi.md +158 -134
  42. data/docs/RepositoriesContainerPushApi.md +44 -148
  43. data/docs/RepositoriesContainerVersionsApi.md +190 -126
  44. data/docs/RepositorySyncURL.md +1 -1
  45. data/docs/RepositoryVersion.md +1 -9
  46. data/docs/RepositoryVersionResponse.md +25 -0
  47. data/docs/TagCopy.md +1 -1
  48. data/docs/TokenApi.md +8 -16
  49. data/lib/pulp_container_client/api/content_blobs_api.rb +38 -34
  50. data/lib/pulp_container_client/api/content_manifests_api.rb +38 -34
  51. data/lib/pulp_container_client/api/content_tags_api.rb +41 -37
  52. data/lib/pulp_container_client/api/contentguards_content_redirect_api.rb +90 -90
  53. data/lib/pulp_container_client/api/distributions_container_api.rb +153 -90
  54. data/lib/pulp_container_client/api/remotes_container_api.rb +181 -100
  55. data/lib/pulp_container_client/api/repositories_container_api.rb +245 -222
  56. data/lib/pulp_container_client/api/repositories_container_push_api.rb +66 -197
  57. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +278 -188
  58. data/lib/pulp_container_client/api/token_api.rb +8 -14
  59. data/lib/pulp_container_client/api_client.rb +2 -2
  60. data/lib/pulp_container_client/api_error.rb +2 -2
  61. data/lib/pulp_container_client/configuration.rb +3 -3
  62. data/lib/pulp_container_client/models/async_operation_response.rb +3 -2
  63. data/lib/pulp_container_client/models/{container_blob.rb → container_blob_response.rb} +6 -43
  64. data/lib/pulp_container_client/models/container_container_distribution.rb +29 -110
  65. data/lib/pulp_container_client/models/container_container_distribution_response.rb +289 -0
  66. data/lib/pulp_container_client/models/container_container_push_repository.rb +18 -78
  67. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +271 -0
  68. data/lib/pulp_container_client/models/container_container_remote.rb +29 -227
  69. data/lib/pulp_container_client/models/container_container_remote_response.rb +409 -0
  70. data/lib/pulp_container_client/models/container_container_repository.rb +18 -78
  71. data/lib/pulp_container_client/models/container_container_repository_response.rb +271 -0
  72. data/lib/pulp_container_client/models/container_content_redirect_content_guard.rb +4 -56
  73. data/lib/pulp_container_client/models/container_content_redirect_content_guard_response.rb +243 -0
  74. data/lib/pulp_container_client/models/{container_manifest.rb → container_manifest_response.rb} +6 -43
  75. data/lib/pulp_container_client/models/{container_tag.rb → container_tag_response.rb} +7 -40
  76. data/lib/pulp_container_client/models/content_summary.rb +9 -15
  77. data/lib/pulp_container_client/models/content_summary_response.rb +240 -0
  78. data/lib/pulp_container_client/models/inline_response200.rb +3 -13
  79. data/lib/pulp_container_client/models/inline_response2001.rb +3 -13
  80. data/lib/pulp_container_client/models/inline_response2002.rb +3 -13
  81. data/lib/pulp_container_client/models/inline_response2003.rb +3 -13
  82. data/lib/pulp_container_client/models/inline_response2004.rb +3 -13
  83. data/lib/pulp_container_client/models/inline_response2005.rb +3 -13
  84. data/lib/pulp_container_client/models/inline_response2006.rb +3 -13
  85. data/lib/pulp_container_client/models/inline_response2007.rb +3 -13
  86. data/lib/pulp_container_client/models/inline_response2008.rb +3 -13
  87. data/lib/pulp_container_client/models/manifest_copy.rb +4 -3
  88. data/lib/pulp_container_client/models/oci_build_image.rb +240 -0
  89. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +250 -0
  90. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +365 -0
  91. data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +229 -0
  92. data/lib/pulp_container_client/models/patchedcontainer_content_redirect_content_guard.rb +219 -0
  93. data/lib/pulp_container_client/models/policy_enum.rb +37 -0
  94. data/lib/pulp_container_client/models/recursive_manage.rb +4 -3
  95. data/lib/pulp_container_client/models/repository_sync_url.rb +3 -8
  96. data/lib/pulp_container_client/models/repository_version.rb +7 -43
  97. data/lib/pulp_container_client/models/repository_version_response.rb +246 -0
  98. data/lib/pulp_container_client/models/tag_copy.rb +4 -3
  99. data/lib/pulp_container_client/models/tag_image.rb +3 -40
  100. data/lib/pulp_container_client/models/un_tag_image.rb +3 -21
  101. data/lib/pulp_container_client/version.rb +3 -3
  102. data/lib/pulp_container_client.rb +18 -5
  103. data/pulp_container_client.gemspec +4 -4
  104. data/spec/api/content_blobs_api_spec.rb +11 -11
  105. data/spec/api/content_manifests_api_spec.rb +11 -11
  106. data/spec/api/content_tags_api_spec.rb +12 -12
  107. data/spec/api/contentguards_content_redirect_api_spec.rb +17 -17
  108. data/spec/api/distributions_container_api_spec.rb +39 -18
  109. data/spec/api/remotes_container_api_spec.rb +48 -21
  110. data/spec/api/repositories_container_api_spec.rb +41 -32
  111. data/spec/api/repositories_container_push_api_spec.rb +17 -40
  112. data/spec/api/repositories_container_versions_api_spec.rb +76 -46
  113. data/spec/api/token_api_spec.rb +4 -6
  114. data/spec/api_client_spec.rb +2 -2
  115. data/spec/configuration_spec.rb +2 -2
  116. data/spec/models/async_operation_response_spec.rb +2 -2
  117. data/spec/models/{container_blob_spec.rb → container_blob_response_spec.rb} +8 -8
  118. data/spec/models/container_container_distribution_response_spec.rb +83 -0
  119. data/spec/models/container_container_distribution_spec.rb +5 -23
  120. data/spec/models/container_container_push_repository_response_spec.rb +77 -0
  121. data/spec/models/container_container_push_repository_spec.rb +5 -23
  122. data/spec/models/container_container_remote_response_spec.rb +137 -0
  123. data/spec/models/container_container_remote_spec.rb +7 -23
  124. data/spec/models/container_container_repository_response_spec.rb +77 -0
  125. data/spec/models/container_container_repository_spec.rb +5 -23
  126. data/spec/models/container_content_redirect_content_guard_response_spec.rb +59 -0
  127. data/spec/models/container_content_redirect_content_guard_spec.rb +2 -14
  128. data/spec/models/{container_manifest_spec.rb → container_manifest_response_spec.rb} +8 -8
  129. data/spec/models/{container_tag_spec.rb → container_tag_response_spec.rb} +8 -14
  130. data/spec/models/content_summary_response_spec.rb +53 -0
  131. data/spec/models/content_summary_spec.rb +2 -2
  132. data/spec/models/inline_response2001_spec.rb +2 -2
  133. data/spec/models/inline_response2002_spec.rb +2 -2
  134. data/spec/models/inline_response2003_spec.rb +2 -2
  135. data/spec/models/inline_response2004_spec.rb +2 -2
  136. data/spec/models/inline_response2005_spec.rb +2 -2
  137. data/spec/models/inline_response2006_spec.rb +2 -2
  138. data/spec/models/inline_response2007_spec.rb +2 -2
  139. data/spec/models/inline_response2008_spec.rb +2 -2
  140. data/spec/models/inline_response200_spec.rb +2 -2
  141. data/spec/models/manifest_copy_spec.rb +2 -2
  142. data/spec/models/oci_build_image_spec.rb +59 -0
  143. data/spec/models/patchedcontainer_container_distribution_spec.rb +65 -0
  144. data/spec/models/patchedcontainer_container_remote_spec.rb +119 -0
  145. data/spec/models/patchedcontainer_container_repository_spec.rb +53 -0
  146. data/spec/models/patchedcontainer_content_redirect_content_guard_spec.rb +47 -0
  147. data/spec/models/policy_enum_spec.rb +35 -0
  148. data/spec/models/recursive_manage_spec.rb +2 -2
  149. data/spec/models/repository_sync_url_spec.rb +2 -2
  150. data/spec/models/repository_version_response_spec.rb +65 -0
  151. data/spec/models/repository_version_spec.rb +2 -26
  152. data/spec/models/tag_copy_spec.rb +2 -2
  153. data/spec/models/tag_image_spec.rb +2 -2
  154. data/spec/models/un_tag_image_spec.rb +2 -2
  155. data/spec/spec_helper.rb +2 -2
  156. metadata +93 -41
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -38,7 +38,7 @@ module PulpContainerClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<ContainerContentRedirectContentGuard>'
41
+ :'results' => :'Array<ContainerContentRedirectContentGuardResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -88,22 +88,12 @@ module PulpContainerClient
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
90
  invalid_properties = Array.new
91
- if @count.nil?
92
- invalid_properties.push('invalid value for "count", count cannot be nil.')
93
- end
94
-
95
- if @results.nil?
96
- invalid_properties.push('invalid value for "results", results cannot be nil.')
97
- end
98
-
99
91
  invalid_properties
100
92
  end
101
93
 
102
94
  # Check to see if the all the properties in the model are valid
103
95
  # @return true if the model is valid
104
96
  def valid?
105
- return false if @count.nil?
106
- return false if @results.nil?
107
97
  true
108
98
  end
109
99
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -38,7 +38,7 @@ module PulpContainerClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<ContainerContainerDistribution>'
41
+ :'results' => :'Array<ContainerContainerDistributionResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -88,22 +88,12 @@ module PulpContainerClient
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
90
  invalid_properties = Array.new
91
- if @count.nil?
92
- invalid_properties.push('invalid value for "count", count cannot be nil.')
93
- end
94
-
95
- if @results.nil?
96
- invalid_properties.push('invalid value for "results", results cannot be nil.')
97
- end
98
-
99
91
  invalid_properties
100
92
  end
101
93
 
102
94
  # Check to see if the all the properties in the model are valid
103
95
  # @return true if the model is valid
104
96
  def valid?
105
- return false if @count.nil?
106
- return false if @results.nil?
107
97
  true
108
98
  end
109
99
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -38,7 +38,7 @@ module PulpContainerClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<ContainerContainerRemote>'
41
+ :'results' => :'Array<ContainerContainerRemoteResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -88,22 +88,12 @@ module PulpContainerClient
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
90
  invalid_properties = Array.new
91
- if @count.nil?
92
- invalid_properties.push('invalid value for "count", count cannot be nil.')
93
- end
94
-
95
- if @results.nil?
96
- invalid_properties.push('invalid value for "results", results cannot be nil.')
97
- end
98
-
99
91
  invalid_properties
100
92
  end
101
93
 
102
94
  # Check to see if the all the properties in the model are valid
103
95
  # @return true if the model is valid
104
96
  def valid?
105
- return false if @count.nil?
106
- return false if @results.nil?
107
97
  true
108
98
  end
109
99
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -38,7 +38,7 @@ module PulpContainerClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<ContainerContainerPushRepository>'
41
+ :'results' => :'Array<ContainerContainerRepositoryResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -88,22 +88,12 @@ module PulpContainerClient
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
90
  invalid_properties = Array.new
91
- if @count.nil?
92
- invalid_properties.push('invalid value for "count", count cannot be nil.')
93
- end
94
-
95
- if @results.nil?
96
- invalid_properties.push('invalid value for "results", results cannot be nil.')
97
- end
98
-
99
91
  invalid_properties
100
92
  end
101
93
 
102
94
  # Check to see if the all the properties in the model are valid
103
95
  # @return true if the model is valid
104
96
  def valid?
105
- return false if @count.nil?
106
- return false if @results.nil?
107
97
  true
108
98
  end
109
99
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -38,7 +38,7 @@ module PulpContainerClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<RepositoryVersion>'
41
+ :'results' => :'Array<ContainerContainerPushRepositoryResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -88,22 +88,12 @@ module PulpContainerClient
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
90
  invalid_properties = Array.new
91
- if @count.nil?
92
- invalid_properties.push('invalid value for "count", count cannot be nil.')
93
- end
94
-
95
- if @results.nil?
96
- invalid_properties.push('invalid value for "results", results cannot be nil.')
97
- end
98
-
99
91
  invalid_properties
100
92
  end
101
93
 
102
94
  # Check to see if the all the properties in the model are valid
103
95
  # @return true if the model is valid
104
96
  def valid?
105
- return false if @count.nil?
106
- return false if @results.nil?
107
97
  true
108
98
  end
109
99
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -38,7 +38,7 @@ module PulpContainerClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<ContainerContainerRepository>'
41
+ :'results' => :'Array<RepositoryVersionResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -88,22 +88,12 @@ module PulpContainerClient
88
88
  # @return Array for valid properties with the reasons
89
89
  def list_invalid_properties
90
90
  invalid_properties = Array.new
91
- if @count.nil?
92
- invalid_properties.push('invalid value for "count", count cannot be nil.')
93
- end
94
-
95
- if @results.nil?
96
- invalid_properties.push('invalid value for "results", results cannot be nil.')
97
- end
98
-
99
91
  invalid_properties
100
92
  end
101
93
 
102
94
  # Check to see if the all the properties in the model are valid
103
95
  # @return true if the model is valid
104
96
  def valid?
105
- return false if @count.nil?
106
- return false if @results.nil?
107
97
  true
108
98
  end
109
99
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
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
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -13,6 +13,7 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpContainerClient
16
+ # Serializer for copying manifests from a source repository to a destination repository.
16
17
  class ManifestCopy
17
18
  # A URI of the repository to copy content from.
18
19
  attr_accessor :source_repository
@@ -63,7 +64,7 @@ module PulpContainerClient
63
64
  {
64
65
  :'source_repository' => :'String',
65
66
  :'source_repository_version' => :'String',
66
- :'digests' => :'Array<String>',
67
+ :'digests' => :'Array<Object>',
67
68
  :'media_types' => :'Array<String>'
68
69
  }
69
70
  end
@@ -0,0 +1,240 @@
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 building an OCI container image from a Containerfile. The Containerfile can either be specified via an artifact url, or a new file can be uploaded. A repository must be specified, to which the container image content will be added.
17
+ class OCIBuildImage
18
+ # Artifact representing the Containerfile that should be used to run buildah.
19
+ attr_accessor :containerfile_artifact
20
+
21
+ # An uploaded Containerfile that should be used to run buildah.
22
+ attr_accessor :containerfile
23
+
24
+ # A tag name for the new image being built.
25
+ attr_accessor :tag
26
+
27
+ # A JSON string where each key is an artifact href and the value is it's relative path (name) inside the /pulp_working_directory of the build container executing the Containerfile.
28
+ attr_accessor :artifacts
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'containerfile_artifact' => :'containerfile_artifact',
34
+ :'containerfile' => :'containerfile',
35
+ :'tag' => :'tag',
36
+ :'artifacts' => :'artifacts'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'containerfile_artifact' => :'String',
44
+ :'containerfile' => :'File',
45
+ :'tag' => :'String',
46
+ :'artifacts' => :'Object'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::OCIBuildImage` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::OCIBuildImage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'containerfile_artifact')
72
+ self.containerfile_artifact = attributes[:'containerfile_artifact']
73
+ end
74
+
75
+ if attributes.key?(:'containerfile')
76
+ self.containerfile = attributes[:'containerfile']
77
+ end
78
+
79
+ if attributes.key?(:'tag')
80
+ self.tag = attributes[:'tag']
81
+ else
82
+ self.tag = 'latest'
83
+ end
84
+
85
+ if attributes.key?(:'artifacts')
86
+ self.artifacts = attributes[:'artifacts']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ containerfile_artifact == o.containerfile_artifact &&
109
+ containerfile == o.containerfile &&
110
+ tag == o.tag &&
111
+ artifacts == o.artifacts
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [containerfile_artifact, containerfile, tag, artifacts].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ PulpContainerClient.const_get(type).build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+ end
240
+ end