pulp_container_client 2.22.2 → 2.23.0
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.
- checksums.yaml +4 -4
- data/README.md +17 -14
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContainerBlobResponse.md +18 -17
- data/docs/ContainerContainerDistribution.md +24 -23
- data/docs/ContainerContainerDistributionResponse.md +40 -39
- data/docs/ContainerContainerNamespace.md +8 -7
- data/docs/ContainerContainerNamespaceResponse.md +16 -15
- data/docs/ContainerContainerPullThroughDistribution.md +26 -25
- data/docs/ContainerContainerPullThroughDistributionResponse.md +38 -37
- data/docs/ContainerContainerPullThroughRemote.md +52 -51
- data/docs/ContainerContainerPullThroughRemoteResponse.md +52 -51
- data/docs/ContainerContainerPullThroughRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/ContainerContainerPushRepository.md +16 -15
- data/docs/ContainerContainerPushRepositoryResponse.md +28 -27
- data/docs/ContainerContainerRemote.md +56 -55
- data/docs/ContainerContainerRemoteResponse.md +56 -55
- data/docs/ContainerContainerRepository.md +18 -17
- data/docs/ContainerContainerRepositoryResponse.md +30 -29
- data/docs/ContainerManifestResponse.md +42 -41
- data/docs/ContainerManifestSignatureResponse.md +28 -27
- data/docs/ContainerRepositorySyncURL.md +12 -11
- data/docs/ContainerTagResponse.md +18 -17
- data/docs/ContentBlobsApi.md +82 -49
- data/docs/ContentManifestsApi.md +86 -53
- data/docs/ContentSignaturesApi.md +97 -64
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/ContentTagsApi.md +86 -53
- data/docs/DistributionsContainerApi.md +386 -183
- data/docs/DistributionsPullThroughApi.md +385 -182
- data/docs/ManifestCopy.md +14 -13
- data/docs/MediaTypesEnum.md +4 -5
- data/docs/MyPermissionsResponse.md +8 -7
- data/docs/NestedRole.md +12 -11
- data/docs/NestedRoleResponse.md +12 -11
- data/docs/ObjectRolesResponse.md +8 -7
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedcontainerBlobResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerDistributionResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerNamespaceResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerPullThroughDistributionResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerPullThroughRemoteResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerPushRepositoryResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerRemoteResponseList.md +14 -13
- data/docs/PaginatedcontainerContainerRepositoryResponseList.md +14 -13
- data/docs/PaginatedcontainerManifestResponseList.md +14 -13
- data/docs/PaginatedcontainerManifestSignatureResponseList.md +14 -13
- data/docs/PaginatedcontainerTagResponseList.md +14 -13
- data/docs/PatchedcontainerContainerDistribution.md +24 -23
- data/docs/PatchedcontainerContainerPullThroughDistribution.md +26 -25
- data/docs/PatchedcontainerContainerPullThroughRemote.md +52 -51
- data/docs/PatchedcontainerContainerPushRepository.md +16 -15
- data/docs/PatchedcontainerContainerRemote.md +56 -55
- data/docs/PatchedcontainerContainerRepository.md +18 -17
- data/docs/Policy692Enum.md +4 -5
- data/docs/Policy7e0Enum.md +4 -5
- data/docs/PulpContainerNamespacesApi.md +259 -124
- data/docs/RecursiveManage.md +8 -7
- data/docs/RemotesContainerApi.md +389 -184
- data/docs/RemotesPullThroughApi.md +389 -184
- data/docs/RemoveImage.md +8 -7
- data/docs/RemoveSignatures.md +8 -7
- data/docs/RemoveSignaturesResponse.md +8 -7
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesContainerApi.md +647 -291
- data/docs/RepositoriesContainerPushApi.md +419 -198
- data/docs/RepositoriesContainerPushVersionsApi.md +152 -82
- data/docs/RepositoriesContainerVersionsApi.md +152 -82
- data/docs/RepositorySign.md +12 -11
- data/docs/RepositoryVersionResponse.md +22 -21
- data/docs/SetLabel.md +10 -9
- data/docs/SetLabelResponse.md +10 -9
- data/docs/TagCopy.md +12 -11
- data/docs/TagImage.md +10 -9
- data/docs/TokenApi.md +25 -7
- data/docs/UnTagImage.md +8 -7
- data/docs/UnsetLabel.md +8 -7
- data/docs/UnsetLabelResponse.md +10 -9
- data/lib/pulp_container_client/api/content_blobs_api.rb +11 -9
- data/lib/pulp_container_client/api/content_manifests_api.rb +11 -9
- data/lib/pulp_container_client/api/content_signatures_api.rb +11 -9
- data/lib/pulp_container_client/api/content_tags_api.rb +11 -9
- data/lib/pulp_container_client/api/distributions_container_api.rb +89 -56
- data/lib/pulp_container_client/api/distributions_pull_through_api.rb +89 -56
- data/lib/pulp_container_client/api/pulp_container_namespaces_api.rb +53 -36
- data/lib/pulp_container_client/api/remotes_container_api.rb +104 -68
- data/lib/pulp_container_client/api/remotes_pull_through_api.rb +104 -68
- data/lib/pulp_container_client/api/repositories_container_api.rb +171 -102
- data/lib/pulp_container_client/api/repositories_container_push_api.rb +102 -62
- data/lib/pulp_container_client/api/repositories_container_push_versions_api.rb +40 -30
- data/lib/pulp_container_client/api/repositories_container_versions_api.rb +40 -30
- data/lib/pulp_container_client/api/token_api.rb +5 -4
- data/lib/pulp_container_client/api_client.rb +137 -102
- data/lib/pulp_container_client/api_error.rb +2 -1
- data/lib/pulp_container_client/configuration.rb +162 -21
- data/lib/pulp_container_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_container_client/models/container_blob_response.rb +37 -29
- data/lib/pulp_container_client/models/container_container_distribution.rb +66 -54
- data/lib/pulp_container_client/models/container_container_distribution_response.rb +95 -83
- data/lib/pulp_container_client/models/container_container_namespace.rb +32 -22
- data/lib/pulp_container_client/models/container_container_namespace_response.rb +34 -24
- data/lib/pulp_container_client/models/container_container_pull_through_distribution.rb +68 -54
- data/lib/pulp_container_client/models/container_container_pull_through_distribution_response.rb +97 -83
- data/lib/pulp_container_client/models/container_container_pull_through_remote.rb +56 -22
- data/lib/pulp_container_client/models/container_container_pull_through_remote_response.rb +59 -25
- data/lib/pulp_container_client/models/{container_container_pull_through_remote_response_hidden_fields.rb → container_container_pull_through_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_container_client/models/container_container_push_repository.rb +73 -63
- data/lib/pulp_container_client/models/container_container_push_repository_response.rb +88 -78
- data/lib/pulp_container_client/models/container_container_remote.rb +63 -23
- data/lib/pulp_container_client/models/container_container_remote_response.rb +61 -25
- data/lib/pulp_container_client/models/container_container_repository.rb +32 -22
- data/lib/pulp_container_client/models/container_container_repository_response.rb +34 -24
- data/lib/pulp_container_client/models/container_manifest_response.rb +42 -24
- data/lib/pulp_container_client/models/container_manifest_signature_response.rb +46 -24
- data/lib/pulp_container_client/models/container_repository_sync_url.rb +30 -22
- data/lib/pulp_container_client/models/container_tag_response.rb +36 -24
- data/lib/pulp_container_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_container_client/models/manifest_copy.rb +31 -23
- data/lib/pulp_container_client/models/media_types_enum.rb +8 -4
- data/lib/pulp_container_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_container_client/models/nested_role.rb +32 -22
- data/lib/pulp_container_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_container_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_container_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_blob_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_distribution_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_namespace_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_distribution_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_remote_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_push_repository_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_remote_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_container_repository_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_manifest_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_manifest_signature_response_list.rb +34 -22
- data/lib/pulp_container_client/models/paginatedcontainer_tag_response_list.rb +34 -22
- data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +72 -56
- data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_distribution.rb +72 -56
- data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_remote.rb +62 -24
- data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +76 -64
- data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +72 -26
- data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +35 -23
- data/lib/pulp_container_client/models/policy692_enum.rb +8 -4
- data/lib/pulp_container_client/models/policy7e0_enum.rb +8 -4
- data/lib/pulp_container_client/models/recursive_manage.rb +31 -23
- data/lib/pulp_container_client/models/remove_image.rb +32 -22
- data/lib/pulp_container_client/models/remove_signatures.rb +32 -22
- data/lib/pulp_container_client/models/remove_signatures_response.rb +32 -22
- data/lib/pulp_container_client/models/repair.rb +30 -22
- data/lib/pulp_container_client/models/repository_sign.rb +36 -24
- data/lib/pulp_container_client/models/repository_version_response.rb +32 -24
- data/lib/pulp_container_client/models/set_label.rb +34 -22
- data/lib/pulp_container_client/models/set_label_response.rb +34 -22
- data/lib/pulp_container_client/models/tag_copy.rb +31 -23
- data/lib/pulp_container_client/models/tag_image.rb +34 -22
- data/lib/pulp_container_client/models/un_tag_image.rb +32 -22
- data/lib/pulp_container_client/models/unset_label.rb +32 -22
- data/lib/pulp_container_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_container_client/version.rb +2 -2
- data/lib/pulp_container_client.rb +2 -3
- data/pulp_container_client.gemspec +9 -6
- data/spec/api/content_blobs_api_spec.rb +3 -3
- data/spec/api/content_manifests_api_spec.rb +3 -3
- data/spec/api/content_signatures_api_spec.rb +3 -3
- data/spec/api/content_tags_api_spec.rb +3 -3
- data/spec/api/distributions_container_api_spec.rb +13 -13
- data/spec/api/distributions_pull_through_api_spec.rb +13 -13
- data/spec/api/pulp_container_namespaces_api_spec.rb +9 -9
- data/spec/api/remotes_container_api_spec.rb +20 -19
- data/spec/api/remotes_pull_through_api_spec.rb +20 -19
- data/spec/api/repositories_container_api_spec.rb +22 -22
- data/spec/api/repositories_container_push_api_spec.rb +14 -14
- data/spec/api/repositories_container_push_versions_api_spec.rb +12 -11
- data/spec/api/repositories_container_versions_api_spec.rb +12 -11
- data/spec/api/token_api_spec.rb +2 -2
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/container_blob_response_spec.rb +12 -17
- data/spec/models/container_container_distribution_response_spec.rb +34 -39
- data/spec/models/container_container_distribution_spec.rb +20 -25
- data/spec/models/container_container_namespace_response_spec.rb +11 -16
- data/spec/models/container_container_namespace_spec.rb +7 -12
- data/spec/models/container_container_pull_through_distribution_response_spec.rb +33 -38
- data/spec/models/container_container_pull_through_distribution_spec.rb +21 -26
- data/spec/models/{container_container_pull_through_remote_response_hidden_fields_spec.rb → container_container_pull_through_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/container_container_pull_through_remote_response_spec.rb +29 -34
- data/spec/models/container_container_pull_through_remote_spec.rb +29 -34
- data/spec/models/container_container_push_repository_response_spec.rb +27 -32
- data/spec/models/container_container_push_repository_spec.rb +16 -21
- data/spec/models/container_container_remote_response_spec.rb +31 -36
- data/spec/models/container_container_remote_spec.rb +31 -36
- data/spec/models/container_container_repository_response_spec.rb +18 -23
- data/spec/models/container_container_repository_spec.rb +12 -17
- data/spec/models/container_manifest_response_spec.rb +24 -29
- data/spec/models/container_manifest_signature_response_spec.rb +17 -22
- data/spec/models/container_repository_sync_url_spec.rb +9 -14
- data/spec/models/container_tag_response_spec.rb +12 -17
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/manifest_copy_spec.rb +10 -15
- data/spec/models/media_types_enum_spec.rb +6 -11
- data/spec/models/my_permissions_response_spec.rb +7 -12
- data/spec/models/nested_role_response_spec.rb +9 -14
- data/spec/models/nested_role_spec.rb +9 -14
- data/spec/models/object_roles_response_spec.rb +7 -12
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_blob_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_namespace_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_pull_through_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_pull_through_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_push_repository_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_container_repository_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_manifest_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_manifest_signature_response_list_spec.rb +10 -15
- data/spec/models/paginatedcontainer_tag_response_list_spec.rb +10 -15
- data/spec/models/patchedcontainer_container_distribution_spec.rb +20 -25
- data/spec/models/patchedcontainer_container_pull_through_distribution_spec.rb +21 -26
- data/spec/models/patchedcontainer_container_pull_through_remote_spec.rb +29 -34
- data/spec/models/patchedcontainer_container_push_repository_spec.rb +16 -21
- data/spec/models/patchedcontainer_container_remote_spec.rb +31 -36
- data/spec/models/patchedcontainer_container_repository_spec.rb +12 -17
- data/spec/models/policy692_enum_spec.rb +6 -11
- data/spec/models/policy7e0_enum_spec.rb +6 -11
- data/spec/models/recursive_manage_spec.rb +7 -12
- data/spec/models/remove_image_spec.rb +7 -12
- data/spec/models/remove_signatures_response_spec.rb +7 -12
- data/spec/models/remove_signatures_spec.rb +7 -12
- data/spec/models/repair_spec.rb +7 -12
- data/spec/models/repository_sign_spec.rb +9 -14
- data/spec/models/repository_version_response_spec.rb +14 -19
- data/spec/models/set_label_response_spec.rb +8 -13
- data/spec/models/set_label_spec.rb +8 -13
- data/spec/models/tag_copy_spec.rb +9 -14
- data/spec/models/tag_image_spec.rb +8 -13
- data/spec/models/un_tag_image_spec.rb +7 -12
- data/spec/models/unset_label_response_spec.rb +8 -13
- data/spec/models/unset_label_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +105 -85
- data/docs/ContainerContainerPullThroughRemoteResponseHiddenFields.md +0 -19
- data/docs/OCIBuildImage.md +0 -23
- data/lib/pulp_container_client/models/oci_build_image.rb +0 -256
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/oci_build_image_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
|
-
|
9
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,6 +21,18 @@ module PulpContainerClient
|
|
21
21
|
# Defines url base path
|
22
22
|
attr_accessor :base_path
|
23
23
|
|
24
|
+
# Define server configuration index
|
25
|
+
attr_accessor :server_index
|
26
|
+
|
27
|
+
# Define server operation configuration index
|
28
|
+
attr_accessor :server_operation_index
|
29
|
+
|
30
|
+
# Default server variables
|
31
|
+
attr_accessor :server_variables
|
32
|
+
|
33
|
+
# Default server operation variables
|
34
|
+
attr_accessor :server_operation_variables
|
35
|
+
|
24
36
|
# Defines API keys used with API Key authentications.
|
25
37
|
#
|
26
38
|
# @return [Hash] key: parameter name, value: parameter value (API key)
|
@@ -50,6 +62,16 @@ module PulpContainerClient
|
|
50
62
|
# Defines the access token (Bearer) used with OAuth2.
|
51
63
|
attr_accessor :access_token
|
52
64
|
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
66
|
+
# Overrides the access_token if set
|
67
|
+
# @return [Proc]
|
68
|
+
attr_accessor :access_token_getter
|
69
|
+
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
72
|
+
# Default to false.
|
73
|
+
attr_accessor :return_binary_data
|
74
|
+
|
53
75
|
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
54
76
|
# details will be logged with `logger.debug` (see the `logger` attribute).
|
55
77
|
# Default to false.
|
@@ -57,6 +79,14 @@ module PulpContainerClient
|
|
57
79
|
# @return [true, false]
|
58
80
|
attr_accessor :debugging
|
59
81
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
86
|
+
# Default to false.
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :ignore_operation_servers
|
89
|
+
|
60
90
|
# Defines the logger used for debugging.
|
61
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
62
92
|
#
|
@@ -109,18 +139,17 @@ module PulpContainerClient
|
|
109
139
|
# Client private key file (for client certificate)
|
110
140
|
attr_accessor :ssl_client_key
|
111
141
|
|
142
|
+
### Proxy setting
|
143
|
+
# HTTP Proxy settings
|
144
|
+
attr_accessor :proxy
|
145
|
+
|
112
146
|
# Set this to customize parameters encoder of array parameter.
|
113
147
|
# Default to nil. Faraday uses NestedParamsEncoder when nil.
|
114
148
|
#
|
115
149
|
# @see The params_encoder option of Faraday. Related source code:
|
116
150
|
# https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
|
117
151
|
attr_accessor :params_encoder
|
118
|
-
|
119
|
-
# Default to nil.
|
120
|
-
#
|
121
|
-
# @see The params_encoding option of Ethon. Related source code:
|
122
|
-
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
123
|
-
attr_accessor :params_encoding
|
152
|
+
|
124
153
|
|
125
154
|
attr_accessor :inject_format
|
126
155
|
|
@@ -128,20 +157,28 @@ module PulpContainerClient
|
|
128
157
|
|
129
158
|
def initialize
|
130
159
|
@scheme = 'http'
|
131
|
-
@host = 'localhost'
|
160
|
+
@host = 'localhost:24817'
|
132
161
|
@base_path = ''
|
162
|
+
@server_index = nil
|
163
|
+
@server_operation_index = {}
|
164
|
+
@server_variables = {}
|
165
|
+
@server_operation_variables = {}
|
133
166
|
@api_key = {}
|
134
167
|
@api_key_prefix = {}
|
135
|
-
@timeout = 0
|
136
168
|
@client_side_validation = true
|
137
169
|
@ssl_verify = true
|
138
170
|
@ssl_verify_mode = nil
|
139
171
|
@ssl_ca_file = nil
|
140
172
|
@ssl_client_cert = nil
|
141
173
|
@ssl_client_key = nil
|
142
|
-
@
|
174
|
+
@middlewares = Hash.new { |h, k| h[k] = [] }
|
175
|
+
@configure_connection_blocks = []
|
143
176
|
@timeout = 60
|
177
|
+
# return data as binary instead of file
|
178
|
+
@return_binary_data = false
|
179
|
+
@params_encoder = nil
|
144
180
|
@debugging = false
|
181
|
+
@ignore_operation_servers = false
|
145
182
|
@inject_format = false
|
146
183
|
@force_ending_format = false
|
147
184
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
@@ -174,20 +211,35 @@ module PulpContainerClient
|
|
174
211
|
@base_path = '' if @base_path == '/'
|
175
212
|
end
|
176
213
|
|
177
|
-
|
178
|
-
|
214
|
+
# Returns base URL for specified operation based on server settings
|
215
|
+
def base_url(operation = nil)
|
216
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
217
|
+
if operation_server_settings.key?(operation) then
|
218
|
+
index = server_operation_index.fetch(operation, server_index)
|
219
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
220
|
+
else
|
221
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
222
|
+
end
|
179
223
|
end
|
180
224
|
|
181
225
|
# Gets API key (with prefix if set).
|
182
226
|
# @param [String] param_name the parameter name of API key auth
|
183
|
-
def api_key_with_prefix(param_name)
|
227
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
228
|
+
key = @api_key[param_name]
|
229
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
184
230
|
if @api_key_prefix[param_name]
|
185
|
-
"#{@api_key_prefix[param_name]} #{
|
231
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
186
232
|
else
|
187
|
-
|
233
|
+
key
|
188
234
|
end
|
189
235
|
end
|
190
236
|
|
237
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
238
|
+
def access_token_with_refresh
|
239
|
+
return access_token if access_token_getter.nil?
|
240
|
+
access_token_getter.call
|
241
|
+
end
|
242
|
+
|
191
243
|
# Gets Basic Auth token string
|
192
244
|
def basic_auth_token
|
193
245
|
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
@@ -210,31 +262,38 @@ module PulpContainerClient
|
|
210
262
|
def server_settings
|
211
263
|
[
|
212
264
|
{
|
213
|
-
url: "http://localhost:24817
|
265
|
+
url: "http://localhost:24817",
|
214
266
|
description: "No description provided",
|
215
267
|
}
|
216
268
|
]
|
217
269
|
end
|
218
270
|
|
271
|
+
def operation_server_settings
|
272
|
+
{
|
273
|
+
}
|
274
|
+
end
|
275
|
+
|
219
276
|
# Returns URL based on server settings
|
220
277
|
#
|
221
278
|
# @param index array index of the server settings
|
222
279
|
# @param variables hash of variable and the corresponding value
|
223
|
-
def server_url(index, variables = {})
|
224
|
-
servers = server_settings
|
280
|
+
def server_url(index, variables = {}, servers = nil)
|
281
|
+
servers = server_settings if servers == nil
|
225
282
|
|
226
283
|
# check array index out of bound
|
227
|
-
if (index < 0 || index >= servers.size)
|
228
|
-
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
284
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
285
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
229
286
|
end
|
230
287
|
|
231
288
|
server = servers[index]
|
232
289
|
url = server[:url]
|
233
290
|
|
291
|
+
return url unless server.key? :variables
|
292
|
+
|
234
293
|
# go through variable and assign a value
|
235
294
|
server[:variables].each do |name, variable|
|
236
295
|
if variables.key?(name)
|
237
|
-
if (server[:variables][name][:enum_values].include?
|
296
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
238
297
|
url.gsub! "{" + name.to_s + "}", variables[name]
|
239
298
|
else
|
240
299
|
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
@@ -247,5 +306,87 @@ module PulpContainerClient
|
|
247
306
|
|
248
307
|
url
|
249
308
|
end
|
309
|
+
|
310
|
+
# Configure Faraday connection directly.
|
311
|
+
#
|
312
|
+
# ```
|
313
|
+
# c.configure_faraday_connection do |conn|
|
314
|
+
# conn.use Faraday::HttpCache, shared_cache: false, logger: logger
|
315
|
+
# conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
|
316
|
+
# logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
|
317
|
+
# end
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
# c.configure_faraday_connection do |conn|
|
321
|
+
# conn.adapter :typhoeus
|
322
|
+
# end
|
323
|
+
# ```
|
324
|
+
#
|
325
|
+
# @param block [Proc] `#call`able object that takes one arg, the connection
|
326
|
+
def configure_faraday_connection(&block)
|
327
|
+
@configure_connection_blocks << block
|
328
|
+
end
|
329
|
+
|
330
|
+
def configure_connection(conn)
|
331
|
+
@configure_connection_blocks.each do |block|
|
332
|
+
block.call(conn)
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
# Adds middleware to the stack
|
337
|
+
def use(*middleware)
|
338
|
+
set_faraday_middleware(:use, *middleware)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Adds request middleware to the stack
|
342
|
+
def request(*middleware)
|
343
|
+
set_faraday_middleware(:request, *middleware)
|
344
|
+
end
|
345
|
+
|
346
|
+
# Adds response middleware to the stack
|
347
|
+
def response(*middleware)
|
348
|
+
set_faraday_middleware(:response, *middleware)
|
349
|
+
end
|
350
|
+
|
351
|
+
# Adds Faraday middleware setting information to the stack
|
352
|
+
#
|
353
|
+
# @example Use the `set_faraday_middleware` method to set middleware information
|
354
|
+
# config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
|
355
|
+
# config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
|
356
|
+
# config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
|
357
|
+
# config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
|
358
|
+
# config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
|
359
|
+
# config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
|
360
|
+
#
|
361
|
+
# @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
|
362
|
+
def set_faraday_middleware(operation, key, *args, &block)
|
363
|
+
unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
|
364
|
+
fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
|
365
|
+
" :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
|
366
|
+
end
|
367
|
+
|
368
|
+
@middlewares[operation] << [key, args, block]
|
369
|
+
end
|
370
|
+
ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
|
371
|
+
|
372
|
+
# Set up middleware on the connection
|
373
|
+
def configure_middleware(connection)
|
374
|
+
return if @middlewares.empty?
|
375
|
+
|
376
|
+
[:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
|
377
|
+
next unless @middlewares.key?(operation)
|
378
|
+
|
379
|
+
@middlewares[operation].each do |key, args, block|
|
380
|
+
connection.builder.send(operation, key, *args, &block)
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
if @middlewares.key?(:delete)
|
385
|
+
@middlewares[:delete].each do |key, _args, _block|
|
386
|
+
connection.builder.delete(key)
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
250
391
|
end
|
251
392
|
end
|
@@ -6,11 +6,12 @@
|
|
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
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpContainerClient
|
16
17
|
# Serializer for asynchronous operations.
|
@@ -25,6 +26,11 @@ module PulpContainerClient
|
|
25
26
|
}
|
26
27
|
end
|
27
28
|
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
28
34
|
# Attribute type mapping.
|
29
35
|
def self.openapi_types
|
30
36
|
{
|
@@ -55,12 +61,15 @@ module PulpContainerClient
|
|
55
61
|
|
56
62
|
if attributes.key?(:'task')
|
57
63
|
self.task = attributes[:'task']
|
64
|
+
else
|
65
|
+
self.task = nil
|
58
66
|
end
|
59
67
|
end
|
60
68
|
|
61
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
62
70
|
# @return Array for valid properties with the reasons
|
63
71
|
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
64
73
|
invalid_properties = Array.new
|
65
74
|
if @task.nil?
|
66
75
|
invalid_properties.push('invalid value for "task", task cannot be nil.')
|
@@ -72,6 +81,7 @@ module PulpContainerClient
|
|
72
81
|
# Check to see if the all the properties in the model are valid
|
73
82
|
# @return true if the model is valid
|
74
83
|
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
75
85
|
return false if @task.nil?
|
76
86
|
true
|
77
87
|
end
|
@@ -100,37 +110,33 @@ module PulpContainerClient
|
|
100
110
|
# @param [Hash] attributes Model attributes in the form of hash
|
101
111
|
# @return [Object] Returns the model itself
|
102
112
|
def self.build_from_hash(attributes)
|
103
|
-
new.build_from_hash(attributes)
|
104
|
-
end
|
105
|
-
|
106
|
-
# Builds the object from hash
|
107
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
-
# @return [Object] Returns the model itself
|
109
|
-
def build_from_hash(attributes)
|
110
113
|
return nil unless attributes.is_a?(Hash)
|
111
|
-
|
112
|
-
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
113
120
|
# check to ensure the input is an array given that the attribute
|
114
121
|
# is documented as an array but the input is not
|
115
|
-
if attributes[
|
116
|
-
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
117
124
|
end
|
118
|
-
elsif !attributes[
|
119
|
-
|
120
|
-
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
121
128
|
end
|
122
|
-
|
123
|
-
self
|
129
|
+
new(transformed_hash)
|
124
130
|
end
|
125
131
|
|
126
132
|
# Deserializes the data based on type
|
127
133
|
# @param string type Data type
|
128
134
|
# @param string value Value to be deserialized
|
129
135
|
# @return [Object] Deserialized data
|
130
|
-
def _deserialize(type, value)
|
136
|
+
def self._deserialize(type, value)
|
131
137
|
case type.to_sym
|
132
|
-
when :
|
133
|
-
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
134
140
|
when :Date
|
135
141
|
Date.parse(value)
|
136
142
|
when :String
|
@@ -160,7 +166,9 @@ module PulpContainerClient
|
|
160
166
|
end
|
161
167
|
end
|
162
168
|
else # model
|
163
|
-
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = PulpContainerClient.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
172
|
end
|
165
173
|
end
|
166
174
|
|
@@ -186,7 +194,7 @@ module PulpContainerClient
|
|
186
194
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
195
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
188
196
|
end
|
189
|
-
|
197
|
+
|
190
198
|
hash[param] = _to_hash(value)
|
191
199
|
end
|
192
200
|
hash
|
@@ -209,5 +217,7 @@ module PulpContainerClient
|
|
209
217
|
value
|
210
218
|
end
|
211
219
|
end
|
220
|
+
|
212
221
|
end
|
222
|
+
|
213
223
|
end
|
@@ -6,11 +6,12 @@
|
|
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
|
+
Generator version: 7.10.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module PulpContainerClient
|
16
17
|
# Serializer for Blobs.
|
@@ -44,13 +45,18 @@ module PulpContainerClient
|
|
44
45
|
}
|
45
46
|
end
|
46
47
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
47
53
|
# Attribute type mapping.
|
48
54
|
def self.openapi_types
|
49
55
|
{
|
50
56
|
:'pulp_href' => :'String',
|
51
57
|
:'prn' => :'String',
|
52
|
-
:'pulp_created' => :'
|
53
|
-
:'pulp_last_updated' => :'
|
58
|
+
:'pulp_created' => :'Time',
|
59
|
+
:'pulp_last_updated' => :'Time',
|
54
60
|
:'artifact' => :'String',
|
55
61
|
:'digest' => :'String'
|
56
62
|
}
|
@@ -59,6 +65,7 @@ module PulpContainerClient
|
|
59
65
|
# List of attributes with nullable: true
|
60
66
|
def self.openapi_nullable
|
61
67
|
Set.new([
|
68
|
+
:'artifact',
|
62
69
|
])
|
63
70
|
end
|
64
71
|
|
@@ -95,21 +102,22 @@ module PulpContainerClient
|
|
95
102
|
|
96
103
|
if attributes.key?(:'artifact')
|
97
104
|
self.artifact = attributes[:'artifact']
|
105
|
+
else
|
106
|
+
self.artifact = nil
|
98
107
|
end
|
99
108
|
|
100
109
|
if attributes.key?(:'digest')
|
101
110
|
self.digest = attributes[:'digest']
|
111
|
+
else
|
112
|
+
self.digest = nil
|
102
113
|
end
|
103
114
|
end
|
104
115
|
|
105
116
|
# Show invalid properties with the reasons. Usually used together with valid?
|
106
117
|
# @return Array for valid properties with the reasons
|
107
118
|
def list_invalid_properties
|
119
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
108
120
|
invalid_properties = Array.new
|
109
|
-
if @artifact.nil?
|
110
|
-
invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
|
111
|
-
end
|
112
|
-
|
113
121
|
if @digest.nil?
|
114
122
|
invalid_properties.push('invalid value for "digest", digest cannot be nil.')
|
115
123
|
end
|
@@ -120,7 +128,7 @@ module PulpContainerClient
|
|
120
128
|
# Check to see if the all the properties in the model are valid
|
121
129
|
# @return true if the model is valid
|
122
130
|
def valid?
|
123
|
-
|
131
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
124
132
|
return false if @digest.nil?
|
125
133
|
true
|
126
134
|
end
|
@@ -154,37 +162,33 @@ module PulpContainerClient
|
|
154
162
|
# @param [Hash] attributes Model attributes in the form of hash
|
155
163
|
# @return [Object] Returns the model itself
|
156
164
|
def self.build_from_hash(attributes)
|
157
|
-
new.build_from_hash(attributes)
|
158
|
-
end
|
159
|
-
|
160
|
-
# Builds the object from hash
|
161
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
-
# @return [Object] Returns the model itself
|
163
|
-
def build_from_hash(attributes)
|
164
165
|
return nil unless attributes.is_a?(Hash)
|
165
|
-
|
166
|
-
|
166
|
+
attributes = attributes.transform_keys(&:to_sym)
|
167
|
+
transformed_hash = {}
|
168
|
+
openapi_types.each_pair do |key, type|
|
169
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
170
|
+
transformed_hash["#{key}"] = nil
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
167
172
|
# check to ensure the input is an array given that the attribute
|
168
173
|
# is documented as an array but the input is not
|
169
|
-
if attributes[
|
170
|
-
|
174
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
175
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
171
176
|
end
|
172
|
-
elsif !attributes[
|
173
|
-
|
174
|
-
end
|
177
|
+
elsif !attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
179
|
+
end
|
175
180
|
end
|
176
|
-
|
177
|
-
self
|
181
|
+
new(transformed_hash)
|
178
182
|
end
|
179
183
|
|
180
184
|
# Deserializes the data based on type
|
181
185
|
# @param string type Data type
|
182
186
|
# @param string value Value to be deserialized
|
183
187
|
# @return [Object] Deserialized data
|
184
|
-
def _deserialize(type, value)
|
188
|
+
def self._deserialize(type, value)
|
185
189
|
case type.to_sym
|
186
|
-
when :
|
187
|
-
|
190
|
+
when :Time
|
191
|
+
Time.parse(value)
|
188
192
|
when :Date
|
189
193
|
Date.parse(value)
|
190
194
|
when :String
|
@@ -214,7 +218,9 @@ module PulpContainerClient
|
|
214
218
|
end
|
215
219
|
end
|
216
220
|
else # model
|
217
|
-
|
221
|
+
# models (e.g. Pet) or oneOf
|
222
|
+
klass = PulpContainerClient.const_get(type)
|
223
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
218
224
|
end
|
219
225
|
end
|
220
226
|
|
@@ -240,7 +246,7 @@ module PulpContainerClient
|
|
240
246
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
241
247
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
242
248
|
end
|
243
|
-
|
249
|
+
|
244
250
|
hash[param] = _to_hash(value)
|
245
251
|
end
|
246
252
|
hash
|
@@ -263,5 +269,7 @@ module PulpContainerClient
|
|
263
269
|
value
|
264
270
|
end
|
265
271
|
end
|
272
|
+
|
266
273
|
end
|
274
|
+
|
267
275
|
end
|