diff --git a/ChangeLog.md b/ChangeLog.md index 6cbc46523f..23ee566359 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +## 2017.09.28 - Azure Container Registry version 0.13.0 +* Released [azure_mgmt_container_registry](https://rubygems.org/gems/azure_mgmt_container_registry) version 0.13.0. Refer [PR# 1007](https://github.com/Azure/azure-sdk-for-ruby/pull/1007) and latest [specification](https://github.com/Azure/azure-rest-api-specs/blob/65a45deed027ed8e428b18e7a6da8ea83bc68f21/specification/containerregistry/resource-manager/readme.md) for further details. + ## 2017.09.27 - Azure ARM version 0.13.0 * Regened all azure_mgmt_* sdks using [Autorest.2.0.4144](https://www.npmjs.com/package/autorest)(core) and [Autorest.Ruby.2.0.15](https://www.npmjs.com/package/@microsoft.azure/autorest.ruby) for release of ARM version 0.13.0 diff --git a/Gemfile b/Gemfile index 4d0b622686..4536105073 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'azure_mgmt_cdn', path: 'management/azure_mgmt_cdn' gem 'azure_mgmt_cognitive_services', path: 'management/azure_mgmt_cognitive_services' gem 'azure_mgmt_commerce', path: 'management/azure_mgmt_commerce' gem 'azure_mgmt_compute', path: 'management/azure_mgmt_compute' +gem 'azure_mgmt_container_registry', path: 'management/azure_mgmt_container_registry' gem 'azure_mgmt_datalake_analytics', path: 'management/azure_mgmt_datalake_analytics' gem 'azure_mgmt_datalake_store', path: 'management/azure_mgmt_datalake_store' gem 'azure_mgmt_devtestlabs', path: 'management/azure_mgmt_devtestlabs' diff --git a/README.md b/README.md index d3381fc877..2386eb6645 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Additional info on Azure deployment models [https://azure.microsoft.com/en-us/do * [Cognitive Services](https://rubygems.org/gems/azure_mgmt_cognitive_services) Azure Cognitive Services Account management * [Commerce](https://rubygems.org/gems/azure_mgmt_commerce) Azure Commerce Usage aggregates & Rate card management * [Compute](https://rubygems.org/gems/azure_mgmt_compute) Virtual Machines, Images, Extensions, Availability Sets, etc... +* [Container Registry](https://rubygems.org/gems/azure_mgmt_container_registry) Registries, Credentials, Replications, etc... * [Datalake Analytics](https://rubygems.org/gems/azure_mgmt_datalake_analytics) Azure Datalake Analytics Account, Catalog and Job management * [Datalake Store](https://rubygems.org/gems/azure_mgmt_datalake_store) Azure Datalake Store Account and FileSystem management * [DevTest Labs](https://rubygems.org/gems/azure_mgmt_devtestlabs) Azure DevTest Labs LabOperations, ArtifactSourceOperations, ArtifactOperations, CostOperations etc... diff --git a/Rakefile b/Rakefile index 96fa9d1aca..294e4e18e3 100644 --- a/Rakefile +++ b/Rakefile @@ -169,6 +169,11 @@ REGEN_METADATA = { ns: 'Azure::ARM::Compute', version: version }, + azure_mgmt_container_registry: { + spec_uri: 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/current/specification/containerregistry/resource-manager/readme.md', + ns: 'Azure::ARM::ContainerRegistry', + version: version + }, azure_mgmt_datalake_analytics: { spec_uri: 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/current/specification/datalake-analytics/resource-manager/readme.md', ns: 'Azure::ARM::DataLakeAnalytics', diff --git a/azure_sdk/azure_sdk.gemspec b/azure_sdk/azure_sdk.gemspec index f4fdf06571..9e33e2020e 100644 --- a/azure_sdk/azure_sdk.gemspec +++ b/azure_sdk/azure_sdk.gemspec @@ -37,6 +37,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'azure_mgmt_cognitive_services', "~>#{version}" spec.add_runtime_dependency 'azure_mgmt_commerce', "~>#{version}" spec.add_runtime_dependency 'azure_mgmt_compute', "~>#{version}" + spec.add_runtime_dependency 'azure_mgmt_container_registry', "~>#{version}" spec.add_runtime_dependency 'azure_mgmt_datalake_analytics', "~>#{version}" spec.add_runtime_dependency 'azure_mgmt_datalake_store', "~>#{version}" spec.add_runtime_dependency 'azure_mgmt_devtestlabs', "~>#{version}" diff --git a/azure_sdk/lib/azure_sdk/client.rb b/azure_sdk/lib/azure_sdk/client.rb index 8d755bf66d..ac7f8cc7c3 100644 --- a/azure_sdk/lib/azure_sdk/client.rb +++ b/azure_sdk/lib/azure_sdk/client.rb @@ -8,6 +8,7 @@ require 'azure_mgmt_cognitive_services' require 'azure_mgmt_commerce' require 'azure_mgmt_compute' +require 'azure_mgmt_container_registry' require 'azure_mgmt_datalake_analytics' require 'azure_mgmt_datalake_store' require 'azure_mgmt_devtestlabs' @@ -53,6 +54,7 @@ class Client :cognitive_services => 'Azure::ARM::CognitiveServices::CognitiveServicesManagementClient', :commerce => 'Azure::ARM::Commerce::UsageManagementClient', :compute => 'Azure::ARM::Compute::ComputeManagementClient', + :container_registry => 'Azure::ARM::ContainerRegistry::ContainerRegistry::ContainerRegistryManagementClient', :datalake_analytics => 'Azure::ARM::DataLakeAnalytics::DataLakeAnalyticsAccountManagementClient', :datalake_store => 'Azure::ARM::DataLakeStore::DataLakeStoreAccountManagementClient', :devtestlabs => 'Azure::ARM::DevTestLabs::DevTestLabsClient', diff --git a/management/azure_mgmt_container_registry/.rspec b/management/azure_mgmt_container_registry/.rspec new file mode 100644 index 0000000000..f6f85f5be0 --- /dev/null +++ b/management/azure_mgmt_container_registry/.rspec @@ -0,0 +1,3 @@ +--require spec_helper +--color +--format documentation \ No newline at end of file diff --git a/management/azure_mgmt_container_registry/LICENSE.txt b/management/azure_mgmt_container_registry/LICENSE.txt new file mode 100644 index 0000000000..d5b09a3830 --- /dev/null +++ b/management/azure_mgmt_container_registry/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/management/azure_mgmt_container_registry/Rakefile b/management/azure_mgmt_container_registry/Rakefile new file mode 100644 index 0000000000..ccbf835904 --- /dev/null +++ b/management/azure_mgmt_container_registry/Rakefile @@ -0,0 +1,5 @@ +# encoding: utf-8 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. + +require "bundler/gem_tasks" diff --git a/management/azure_mgmt_container_registry/azure_mgmt_container_registry.gemspec b/management/azure_mgmt_container_registry/azure_mgmt_container_registry.gemspec new file mode 100644 index 0000000000..e10021b500 --- /dev/null +++ b/management/azure_mgmt_container_registry/azure_mgmt_container_registry.gemspec @@ -0,0 +1,34 @@ +# encoding: utf-8 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) + +require 'generated/azure_mgmt_container_registry/module_definition' +require 'generated/azure_mgmt_container_registry/version' + +Gem::Specification.new do |spec| + spec.name = 'azure_mgmt_container_registry' + spec.version = Azure::ARM::ContainerRegistry::VERSION + spec.authors = 'Microsoft Corporation' + spec.email = 'azrubyteam@microsoft.com' + spec.description = 'Microsoft Azure Container Registry Management Client Library for Ruby' + spec.summary = 'Official Ruby client library to consume Microsoft Azure Container Registry Management services.' + spec.homepage = 'https://aka.ms/azure-sdk-for-ruby' + spec.license = 'MIT' + + spec.files = Dir["LICENSE.txt", "lib/**/*"] + spec.bindir = 'bin' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] + + spec.required_ruby_version = '>= 2.0.0' + + spec.add_development_dependency 'bundler', '~> 1.9' + spec.add_development_dependency 'rake', '~> 10' + spec.add_development_dependency 'rspec', '~> 3' + spec.add_development_dependency 'dotenv', '~> 2' + + spec.add_runtime_dependency 'ms_rest_azure', '~> 0.9.0' +end diff --git a/management/azure_mgmt_container_registry/lib/azure_mgmt_container_registry.rb b/management/azure_mgmt_container_registry/lib/azure_mgmt_container_registry.rb new file mode 100644 index 0000000000..6676217f74 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/azure_mgmt_container_registry.rb @@ -0,0 +1,5 @@ +# encoding: utf-8 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. + +require 'generated/azure_mgmt_container_registry' \ No newline at end of file diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry.rb new file mode 100644 index 0000000000..ea1fb3502c --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry.rb @@ -0,0 +1,72 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require 'generated/azure_mgmt_container_registry/module_definition' +require 'ms_rest_azure' + +module Azure::ARM::ContainerRegistry + autoload :Registries, 'generated/azure_mgmt_container_registry/registries.rb' + autoload :Operations, 'generated/azure_mgmt_container_registry/operations.rb' + autoload :Replications, 'generated/azure_mgmt_container_registry/replications.rb' + autoload :Webhooks, 'generated/azure_mgmt_container_registry/webhooks.rb' + autoload :ContainerRegistryManagementClient, 'generated/azure_mgmt_container_registry/container_registry_management_client.rb' + + module Models + autoload :ReplicationUpdateParameters, 'generated/azure_mgmt_container_registry/models/replication_update_parameters.rb' + autoload :ReplicationListResult, 'generated/azure_mgmt_container_registry/models/replication_list_result.rb' + autoload :RegistryNameStatus, 'generated/azure_mgmt_container_registry/models/registry_name_status.rb' + autoload :OperationDisplayDefinition, 'generated/azure_mgmt_container_registry/models/operation_display_definition.rb' + autoload :OperationDefinition, 'generated/azure_mgmt_container_registry/models/operation_definition.rb' + autoload :Sku, 'generated/azure_mgmt_container_registry/models/sku.rb' + autoload :WebhookCreateParameters, 'generated/azure_mgmt_container_registry/models/webhook_create_parameters.rb' + autoload :StorageAccountProperties, 'generated/azure_mgmt_container_registry/models/storage_account_properties.rb' + autoload :WebhookUpdateParameters, 'generated/azure_mgmt_container_registry/models/webhook_update_parameters.rb' + autoload :RegistryUpdateParameters, 'generated/azure_mgmt_container_registry/models/registry_update_parameters.rb' + autoload :WebhookListResult, 'generated/azure_mgmt_container_registry/models/webhook_list_result.rb' + autoload :RegistryPassword, 'generated/azure_mgmt_container_registry/models/registry_password.rb' + autoload :EventInfo, 'generated/azure_mgmt_container_registry/models/event_info.rb' + autoload :RegenerateCredentialParameters, 'generated/azure_mgmt_container_registry/models/regenerate_credential_parameters.rb' + autoload :CallbackConfig, 'generated/azure_mgmt_container_registry/models/callback_config.rb' + autoload :RegistryUsageListResult, 'generated/azure_mgmt_container_registry/models/registry_usage_list_result.rb' + autoload :Target, 'generated/azure_mgmt_container_registry/models/target.rb' + autoload :RegistryNameCheckRequest, 'generated/azure_mgmt_container_registry/models/registry_name_check_request.rb' + autoload :Request, 'generated/azure_mgmt_container_registry/models/request.rb' + autoload :Status, 'generated/azure_mgmt_container_registry/models/status.rb' + autoload :Actor, 'generated/azure_mgmt_container_registry/models/actor.rb' + autoload :RegistryListResult, 'generated/azure_mgmt_container_registry/models/registry_list_result.rb' + autoload :Source, 'generated/azure_mgmt_container_registry/models/source.rb' + autoload :RegistryUsage, 'generated/azure_mgmt_container_registry/models/registry_usage.rb' + autoload :EventContent, 'generated/azure_mgmt_container_registry/models/event_content.rb' + autoload :OperationListResult, 'generated/azure_mgmt_container_registry/models/operation_list_result.rb' + autoload :EventRequestMessage, 'generated/azure_mgmt_container_registry/models/event_request_message.rb' + autoload :RegistryListCredentialsResult, 'generated/azure_mgmt_container_registry/models/registry_list_credentials_result.rb' + autoload :EventResponseMessage, 'generated/azure_mgmt_container_registry/models/event_response_message.rb' + autoload :EventListResult, 'generated/azure_mgmt_container_registry/models/event_list_result.rb' + autoload :Registry, 'generated/azure_mgmt_container_registry/models/registry.rb' + autoload :Replication, 'generated/azure_mgmt_container_registry/models/replication.rb' + autoload :Webhook, 'generated/azure_mgmt_container_registry/models/webhook.rb' + autoload :Event, 'generated/azure_mgmt_container_registry/models/event.rb' + autoload :SkuName, 'generated/azure_mgmt_container_registry/models/sku_name.rb' + autoload :SkuTier, 'generated/azure_mgmt_container_registry/models/sku_tier.rb' + autoload :ProvisioningState, 'generated/azure_mgmt_container_registry/models/provisioning_state.rb' + autoload :PasswordName, 'generated/azure_mgmt_container_registry/models/password_name.rb' + autoload :RegistryUsageUnit, 'generated/azure_mgmt_container_registry/models/registry_usage_unit.rb' + autoload :WebhookStatus, 'generated/azure_mgmt_container_registry/models/webhook_status.rb' + autoload :WebhookAction, 'generated/azure_mgmt_container_registry/models/webhook_action.rb' + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/container_registry_management_client.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/container_registry_management_client.rb new file mode 100644 index 0000000000..8e88fa8ce6 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/container_registry_management_client.rb @@ -0,0 +1,141 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + # + # A service client - single point of access to the REST API. + # + class ContainerRegistryManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] The Microsoft Azure subscription ID. + attr_accessor :subscription_id + + # @return [String] The client API version. + attr_reader :api_version + + # @return [String] Gets or sets the preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] Gets or sets the retry timeout in seconds for Long + # Running Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] When set to true a unique x-ms-client-request-id value + # is generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [Registries] registries + attr_reader :registries + + # @return [Operations] operations + attr_reader :operations + + # @return [Replications] replications + attr_reader :replications + + # @return [Webhooks] webhooks + attr_reader :webhooks + + # + # Creates initializes a new instance of the ContainerRegistryManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @registries = Registries.new(self) + @operations = Operations.new(self) + @replications = Replications.new(self) + @webhooks = Webhooks.new(self) + @api_version = '2017-10-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_container_registry' + if defined? Azure::ARM::ContainerRegistry::VERSION + sdk_information = "#{sdk_information}/#{Azure::ARM::ContainerRegistry::VERSION}" + end + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/actor.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/actor.rb new file mode 100644 index 0000000000..c3f877f26e --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/actor.rb @@ -0,0 +1,47 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The agent that initiated the event. For most situations, this could be + # from the authorization context of the request. + # + class Actor + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The subject or username associated with the request + # context that generated the event. + attr_accessor :name + + + # + # Mapper for Actor class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Actor', + type: { + name: 'Composite', + class_name: 'Actor', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/callback_config.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/callback_config.rb new file mode 100644 index 0000000000..44846439f8 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/callback_config.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The configuration of service URI and custom headers for the webhook. + # + class CallbackConfig + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The service URI for the webhook to post notifications. + attr_accessor :service_uri + + # @return [Hash{String => String}] Custom headers that will be added to + # the webhook notifications. + attr_accessor :custom_headers + + + # + # Mapper for CallbackConfig class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'CallbackConfig', + type: { + name: 'Composite', + class_name: 'CallbackConfig', + model_properties: { + service_uri: { + required: true, + serialized_name: 'serviceUri', + type: { + name: 'String' + } + }, + custom_headers: { + required: false, + serialized_name: 'customHeaders', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event.rb new file mode 100644 index 0000000000..24d017cc06 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The event for a webhook. + # + class Event < EventInfo + + include MsRestAzure + + include MsRest::JSONable + # @return [EventRequestMessage] The event request message sent to the + # service URI. + attr_accessor :event_request_message + + # @return [EventResponseMessage] The event response message received from + # the service URI. + attr_accessor :event_response_message + + + # + # Mapper for Event class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Event', + type: { + name: 'Composite', + class_name: 'Event', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + event_request_message: { + required: false, + serialized_name: 'eventRequestMessage', + type: { + name: 'Composite', + class_name: 'EventRequestMessage' + } + }, + event_response_message: { + required: false, + serialized_name: 'eventResponseMessage', + type: { + name: 'Composite', + class_name: 'EventResponseMessage' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_content.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_content.rb new file mode 100644 index 0000000000..8c3115d65e --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_content.rb @@ -0,0 +1,113 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The content of the event request message. + # + class EventContent + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The event ID. + attr_accessor :id + + # @return [DateTime] The time at which the event occurred. + attr_accessor :timestamp + + # @return [String] The action that encompasses the provided event. + attr_accessor :action + + # @return [Target] The target of the event. + attr_accessor :target + + # @return [Request] The request that generated the event. + attr_accessor :request + + # @return [Actor] The agent that initiated the event. For most + # situations, this could be from the authorization context of the + # request. + attr_accessor :actor + + # @return [Source] The registry node that generated the event. Put + # differently, while the actor initiates the event, the source generates + # it. + attr_accessor :source + + + # + # Mapper for EventContent class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventContent', + type: { + name: 'Composite', + class_name: 'EventContent', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + timestamp: { + required: false, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + }, + action: { + required: false, + serialized_name: 'action', + type: { + name: 'String' + } + }, + target: { + required: false, + serialized_name: 'target', + type: { + name: 'Composite', + class_name: 'Target' + } + }, + request: { + required: false, + serialized_name: 'request', + type: { + name: 'Composite', + class_name: 'Request' + } + }, + actor: { + required: false, + serialized_name: 'actor', + type: { + name: 'Composite', + class_name: 'Actor' + } + }, + source: { + required: false, + serialized_name: 'source', + type: { + name: 'Composite', + class_name: 'Source' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_info.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_info.rb new file mode 100644 index 0000000000..a3836c378d --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_info.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The basic information of an event. + # + class EventInfo + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The event ID. + attr_accessor :id + + + # + # Mapper for EventInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventInfo', + type: { + name: 'Composite', + class_name: 'EventInfo', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_list_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_list_result.rb new file mode 100644 index 0000000000..a38292458f --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_list_result.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to list events for a webhook. + # + class EventListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of events. Since this list may be + # incomplete, the nextLink field should be used to request the next list + # of events. + attr_accessor :value + + # @return [String] The URI that can be used to request the next list of + # events. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [EventListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for EventListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventListResult', + type: { + name: 'Composite', + class_name: 'EventListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_request_message.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_request_message.rb new file mode 100644 index 0000000000..e75040f8b8 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_request_message.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The event request message sent to the service URI. + # + class EventRequestMessage + + include MsRestAzure + + include MsRest::JSONable + # @return [EventContent] The content of the event request message. + attr_accessor :content + + # @return [Hash{String => String}] The headers of the event request + # message. + attr_accessor :headers + + # @return [String] The HTTP method used to send the event request + # message. + attr_accessor :method + + # @return [String] The URI used to send the event request message. + attr_accessor :request_uri + + # @return [String] The HTTP message version. + attr_accessor :version + + + # + # Mapper for EventRequestMessage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventRequestMessage', + type: { + name: 'Composite', + class_name: 'EventRequestMessage', + model_properties: { + content: { + required: false, + serialized_name: 'content', + type: { + name: 'Composite', + class_name: 'EventContent' + } + }, + headers: { + required: false, + serialized_name: 'headers', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + method: { + required: false, + serialized_name: 'method', + type: { + name: 'String' + } + }, + request_uri: { + required: false, + serialized_name: 'requestUri', + type: { + name: 'String' + } + }, + version: { + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_response_message.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_response_message.rb new file mode 100644 index 0000000000..9268f00d4a --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/event_response_message.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The event response message received from the service URI. + # + class EventResponseMessage + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The content of the event response message. + attr_accessor :content + + # @return [Hash{String => String}] The headers of the event response + # message. + attr_accessor :headers + + # @return [String] The reason phrase of the event response message. + attr_accessor :reason_phrase + + # @return [String] The status code of the event response message. + attr_accessor :status_code + + # @return [String] The HTTP message version. + attr_accessor :version + + + # + # Mapper for EventResponseMessage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EventResponseMessage', + type: { + name: 'Composite', + class_name: 'EventResponseMessage', + model_properties: { + content: { + required: false, + serialized_name: 'content', + type: { + name: 'String' + } + }, + headers: { + required: false, + serialized_name: 'headers', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + reason_phrase: { + required: false, + serialized_name: 'reasonPhrase', + type: { + name: 'String' + } + }, + status_code: { + required: false, + serialized_name: 'statusCode', + type: { + name: 'String' + } + }, + version: { + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_definition.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_definition.rb new file mode 100644 index 0000000000..9c7c05d071 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_definition.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The definition of a container registry operation. + # + class OperationDefinition + + include MsRestAzure + + include MsRest::JSONable + # @return [String] Operation name: {provider}/{resource}/{operation}. + attr_accessor :name + + # @return [OperationDisplayDefinition] The display information for the + # container registry operation. + attr_accessor :display + + + # + # Mapper for OperationDefinition class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationDefinition', + type: { + name: 'Composite', + class_name: 'OperationDefinition', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplayDefinition' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_display_definition.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_display_definition.rb new file mode 100644 index 0000000000..9a2823585d --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_display_definition.rb @@ -0,0 +1,76 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The display information for a container registry operation. + # + class OperationDisplayDefinition + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The resource provider name: + # Microsoft.ContainerRegistry. + attr_accessor :provider + + # @return [String] The resource on which the operation is performed. + attr_accessor :resource + + # @return [String] The operation that users can perform. + attr_accessor :operation + + # @return [String] The description for the operation. + attr_accessor :description + + + # + # Mapper for OperationDisplayDefinition class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationDisplayDefinition', + type: { + name: 'Composite', + class_name: 'OperationDisplayDefinition', + model_properties: { + provider: { + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_list_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_list_result.rb new file mode 100644 index 0000000000..85c87d5427 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/operation_list_result.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to list container registry operations. + # + class OperationListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of container registry + # operations. Since this list may be incomplete, the nextLink field + # should be used to request the next list of operations. + attr_accessor :value + + # @return [String] The URI that can be used to request the next list of + # container registry operations. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [OperationListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationDefinitionElementType', + type: { + name: 'Composite', + class_name: 'OperationDefinition' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/password_name.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/password_name.rb new file mode 100644 index 0000000000..352697d16c --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/password_name.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for PasswordName + # + module PasswordName + Password = "password" + Password2 = "password2" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/provisioning_state.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/provisioning_state.rb new file mode 100644 index 0000000000..1eaa85ff8a --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/provisioning_state.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for ProvisioningState + # + module ProvisioningState + Creating = "Creating" + Updating = "Updating" + Deleting = "Deleting" + Succeeded = "Succeeded" + Failed = "Failed" + Canceled = "Canceled" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/regenerate_credential_parameters.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/regenerate_credential_parameters.rb new file mode 100644 index 0000000000..c1fdc791a1 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/regenerate_credential_parameters.rb @@ -0,0 +1,48 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The parameters used to regenerate the login credential. + # + class RegenerateCredentialParameters + + include MsRestAzure + + include MsRest::JSONable + # @return [PasswordName] Specifies name of the password which should be + # regenerated -- password or password2. Possible values include: + # 'password', 'password2' + attr_accessor :name + + + # + # Mapper for RegenerateCredentialParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegenerateCredentialParameters', + type: { + name: 'Composite', + class_name: 'RegenerateCredentialParameters', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'Enum', + module: 'PasswordName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry.rb new file mode 100644 index 0000000000..2f59bbf141 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry.rb @@ -0,0 +1,165 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # An object that represents a container registry. + # + class Registry < MsRestAzure::Resource + + include MsRestAzure + + include MsRest::JSONable + # @return [Sku] The SKU of the container registry. + attr_accessor :sku + + # @return [String] The URL that can be used to log into the container + # registry. + attr_accessor :login_server + + # @return [DateTime] The creation date of the container registry in + # ISO8601 format. + attr_accessor :creation_date + + # @return [ProvisioningState] The provisioning state of the container + # registry at the time the operation was called. Possible values include: + # 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + attr_accessor :provisioning_state + + # @return [Status] The status of the container registry at the time the + # operation was called. + attr_accessor :status + + # @return [Boolean] The value that indicates whether the admin user is + # enabled. Default value: false . + attr_accessor :admin_user_enabled + + # @return [StorageAccountProperties] The properties of the storage + # account for the container registry. Only applicable to Classic SKU. + attr_accessor :storage_account + + + # + # Mapper for Registry class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Registry', + type: { + name: 'Composite', + class_name: 'Registry', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: true, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'Sku' + } + }, + login_server: { + required: false, + read_only: true, + serialized_name: 'properties.loginServer', + type: { + name: 'String' + } + }, + creation_date: { + required: false, + read_only: true, + serialized_name: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + status: { + required: false, + read_only: true, + serialized_name: 'properties.status', + type: { + name: 'Composite', + class_name: 'Status' + } + }, + admin_user_enabled: { + required: false, + serialized_name: 'properties.adminUserEnabled', + default_value: false, + type: { + name: 'Boolean' + } + }, + storage_account: { + required: false, + serialized_name: 'properties.storageAccount', + type: { + name: 'Composite', + class_name: 'StorageAccountProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_list_credentials_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_list_credentials_result.rb new file mode 100644 index 0000000000..2fe842ad87 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_list_credentials_result.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The response from the ListCredentials operation. + # + class RegistryListCredentialsResult + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The username for a container registry. + attr_accessor :username + + # @return [Array] The list of passwords for a container + # registry. + attr_accessor :passwords + + + # + # Mapper for RegistryListCredentialsResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryListCredentialsResult', + type: { + name: 'Composite', + class_name: 'RegistryListCredentialsResult', + model_properties: { + username: { + required: false, + serialized_name: 'username', + type: { + name: 'String' + } + }, + passwords: { + required: false, + serialized_name: 'passwords', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RegistryPasswordElementType', + type: { + name: 'Composite', + class_name: 'RegistryPassword' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_list_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_list_result.rb new file mode 100644 index 0000000000..b12c43d741 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_list_result.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to list container registries. + # + class RegistryListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of container registries. Since this + # list may be incomplete, the nextLink field should be used to request + # the next list of container registries. + attr_accessor :value + + # @return [String] The URI that can be used to request the next list of + # container registries. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [RegistryListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for RegistryListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryListResult', + type: { + name: 'Composite', + class_name: 'RegistryListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RegistryElementType', + type: { + name: 'Composite', + class_name: 'Registry' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_name_check_request.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_name_check_request.rb new file mode 100644 index 0000000000..ab8bb4c516 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_name_check_request.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # A request to check whether a container registry name is available. + # + class RegistryNameCheckRequest + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The name of the container registry. + attr_accessor :name + + # @return [String] The resource type of the container registry. This + # field must be set to 'Microsoft.ContainerRegistry/registries'. Default + # value: 'Microsoft.ContainerRegistry/registries' . + attr_accessor :type + + + # + # Mapper for RegistryNameCheckRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryNameCheckRequest', + type: { + name: 'Composite', + class_name: 'RegistryNameCheckRequest', + model_properties: { + name: { + required: true, + serialized_name: 'name', + constraints: { + MaxLength: 50, + MinLength: 5, + Pattern: '^[a-zA-Z0-9]*$' + }, + type: { + name: 'String' + } + }, + type: { + required: true, + is_constant: true, + serialized_name: 'type', + default_value: 'Microsoft.ContainerRegistry/registries', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_name_status.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_name_status.rb new file mode 100644 index 0000000000..f084039ed0 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_name_status.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to check the availability of a container registry + # name. + # + class RegistryNameStatus + + include MsRestAzure + + include MsRest::JSONable + # @return [Boolean] The value that indicates whether the name is + # available. + attr_accessor :name_available + + # @return [String] If any, the reason that the name is not available. + attr_accessor :reason + + # @return [String] If any, the error message that provides more detail + # for the reason that the name is not available. + attr_accessor :message + + + # + # Mapper for RegistryNameStatus class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryNameStatus', + type: { + name: 'Composite', + class_name: 'RegistryNameStatus', + model_properties: { + name_available: { + required: false, + serialized_name: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + serialized_name: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_password.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_password.rb new file mode 100644 index 0000000000..43ff531066 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_password.rb @@ -0,0 +1,57 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The login password for the container registry. + # + class RegistryPassword + + include MsRestAzure + + include MsRest::JSONable + # @return [PasswordName] The password name. Possible values include: + # 'password', 'password2' + attr_accessor :name + + # @return [String] The password value. + attr_accessor :value + + + # + # Mapper for RegistryPassword class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryPassword', + type: { + name: 'Composite', + class_name: 'RegistryPassword', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'Enum', + module: 'PasswordName' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_update_parameters.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_update_parameters.rb new file mode 100644 index 0000000000..cfab29a2b3 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_update_parameters.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The parameters for updating a container registry. + # + class RegistryUpdateParameters + + include MsRestAzure + + include MsRest::JSONable + # @return [Hash{String => String}] The tags for the container registry. + attr_accessor :tags + + # @return [Sku] The SKU of the container registry. + attr_accessor :sku + + # @return [Boolean] The value that indicates whether the admin user is + # enabled. + attr_accessor :admin_user_enabled + + # @return [StorageAccountProperties] The parameters of a storage account + # for the container registry. Only applicable to Classic SKU. If + # specified, the storage account must be in the same physical location as + # the container registry. + attr_accessor :storage_account + + + # + # Mapper for RegistryUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryUpdateParameters', + type: { + name: 'Composite', + class_name: 'RegistryUpdateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serialized_name: 'sku', + type: { + name: 'Composite', + class_name: 'Sku' + } + }, + admin_user_enabled: { + required: false, + serialized_name: 'properties.adminUserEnabled', + type: { + name: 'Boolean' + } + }, + storage_account: { + required: false, + serialized_name: 'properties.storageAccount', + type: { + name: 'Composite', + class_name: 'StorageAccountProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage.rb new file mode 100644 index 0000000000..486763d530 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage.rb @@ -0,0 +1,76 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The quota usage for a container registry. + # + class RegistryUsage + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The name of the usage. + attr_accessor :name + + # @return [Integer] The limit of the usage. + attr_accessor :limit + + # @return [Integer] The current value of the usage. + attr_accessor :current_value + + # @return [RegistryUsageUnit] The unit of measurement. Possible values + # include: 'Count', 'Bytes' + attr_accessor :unit + + + # + # Mapper for RegistryUsage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryUsage', + type: { + name: 'Composite', + class_name: 'RegistryUsage', + model_properties: { + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + limit: { + required: false, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + current_value: { + required: false, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + unit: { + required: false, + serialized_name: 'unit', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage_list_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage_list_result.rb new file mode 100644 index 0000000000..a09152a473 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage_list_result.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to get container registry quota usages. + # + class RegistryUsageListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of container registry quota + # usages. + attr_accessor :value + + + # + # Mapper for RegistryUsageListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'RegistryUsageListResult', + type: { + name: 'Composite', + class_name: 'RegistryUsageListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'RegistryUsageElementType', + type: { + name: 'Composite', + class_name: 'RegistryUsage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage_unit.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage_unit.rb new file mode 100644 index 0000000000..3178e94e67 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/registry_usage_unit.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for RegistryUsageUnit + # + module RegistryUsageUnit + Count = "Count" + Bytes = "Bytes" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication.rb new file mode 100644 index 0000000000..562ce7e2d8 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # An object that represents a replication for a container registry. + # + class Replication < MsRestAzure::Resource + + include MsRestAzure + + include MsRest::JSONable + # @return [ProvisioningState] The provisioning state of the replication + # at the time the operation was called. Possible values include: + # 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + attr_accessor :provisioning_state + + # @return [Status] The status of the replication at the time the + # operation was called. + attr_accessor :status + + + # + # Mapper for Replication class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Replication', + type: { + name: 'Composite', + class_name: 'Replication', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + status: { + required: false, + read_only: true, + serialized_name: 'properties.status', + type: { + name: 'Composite', + class_name: 'Status' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication_list_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication_list_result.rb new file mode 100644 index 0000000000..bfa2ae2d73 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication_list_result.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to list replications for a container registry. + # + class ReplicationListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of replications. Since this list + # may be incomplete, the nextLink field should be used to request the + # next list of replications. + attr_accessor :value + + # @return [String] The URI that can be used to request the next list of + # replications. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ReplicationListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ReplicationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ReplicationListResult', + type: { + name: 'Composite', + class_name: 'ReplicationListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ReplicationElementType', + type: { + name: 'Composite', + class_name: 'Replication' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication_update_parameters.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication_update_parameters.rb new file mode 100644 index 0000000000..fbc5843281 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/replication_update_parameters.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The parameters for updating a replication. + # + class ReplicationUpdateParameters + + include MsRestAzure + + include MsRest::JSONable + # @return [Hash{String => String}] The tags for the replication. + attr_accessor :tags + + + # + # Mapper for ReplicationUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ReplicationUpdateParameters', + type: { + name: 'Composite', + class_name: 'ReplicationUpdateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/request.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/request.rb new file mode 100644 index 0000000000..4c52a86e7e --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/request.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The request that generated the event. + # + class Request + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The ID of the request that initiated the event. + attr_accessor :id + + # @return [String] The IP or hostname and possibly port of the client + # connection that initiated the event. This is the RemoteAddr from the + # standard http request. + attr_accessor :addr + + # @return [String] The externally accessible hostname of the registry + # instance, as specified by the http host header on incoming requests. + attr_accessor :host + + # @return [String] The request method that generated the event. + attr_accessor :method + + # @return [String] The user agent header of the request. + attr_accessor :useragent + + + # + # Mapper for Request class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Request', + type: { + name: 'Composite', + class_name: 'Request', + model_properties: { + id: { + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + addr: { + required: false, + serialized_name: 'addr', + type: { + name: 'String' + } + }, + host: { + required: false, + serialized_name: 'host', + type: { + name: 'String' + } + }, + method: { + required: false, + serialized_name: 'method', + type: { + name: 'String' + } + }, + useragent: { + required: false, + serialized_name: 'useragent', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku.rb new file mode 100644 index 0000000000..be58068cdd --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The SKU of a container registry. + # + class Sku + + include MsRestAzure + + include MsRest::JSONable + # @return [SkuName] The SKU name of the container registry. Required for + # registry creation. Possible values include: 'Classic', 'Managed_Basic', + # 'Managed_Standard', 'Managed_Premium' + attr_accessor :name + + # @return [SkuTier] The SKU tier based on the SKU name. Possible values + # include: 'Classic', 'Managed' + attr_accessor :tier + + + # + # Mapper for Sku class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Sku', + type: { + name: 'Composite', + class_name: 'Sku', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + read_only: true, + serialized_name: 'tier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku_name.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku_name.rb new file mode 100644 index 0000000000..dc5f123da0 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku_name.rb @@ -0,0 +1,18 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for SkuName + # + module SkuName + Classic = "Classic" + ManagedBasic = "Managed_Basic" + ManagedStandard = "Managed_Standard" + ManagedPremium = "Managed_Premium" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku_tier.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku_tier.rb new file mode 100644 index 0000000000..63b414772f --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/sku_tier.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for SkuTier + # + module SkuTier + Classic = "Classic" + Managed = "Managed" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/source.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/source.rb new file mode 100644 index 0000000000..e66229ba26 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/source.rb @@ -0,0 +1,59 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The registry node that generated the event. Put differently, while the + # actor initiates the event, the source generates it. + # + class Source + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The IP or hostname and the port of the registry node + # that generated the event. Generally, this will be resolved by + # os.Hostname() along with the running port. + attr_accessor :addr + + # @return [String] The running instance of an application. Changes after + # each restart. + attr_accessor :instance_id + + + # + # Mapper for Source class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Source', + type: { + name: 'Composite', + class_name: 'Source', + model_properties: { + addr: { + required: false, + serialized_name: 'addr', + type: { + name: 'String' + } + }, + instance_id: { + required: false, + serialized_name: 'instanceID', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/status.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/status.rb new file mode 100644 index 0000000000..8c573bfbde --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/status.rb @@ -0,0 +1,70 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The status of an Azure resource at the time the operation was called. + # + class Status + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The short label for the status. + attr_accessor :display_status + + # @return [String] The detailed message for the status, including alerts + # and error messages. + attr_accessor :message + + # @return [DateTime] The timestamp when the status was changed to the + # current value. + attr_accessor :timestamp + + + # + # Mapper for Status class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Status', + type: { + name: 'Composite', + class_name: 'Status', + model_properties: { + display_status: { + required: false, + read_only: true, + serialized_name: 'displayStatus', + type: { + name: 'String' + } + }, + message: { + required: false, + read_only: true, + serialized_name: 'message', + type: { + name: 'String' + } + }, + timestamp: { + required: false, + read_only: true, + serialized_name: 'timestamp', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/storage_account_properties.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/storage_account_properties.rb new file mode 100644 index 0000000000..656559bca3 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/storage_account_properties.rb @@ -0,0 +1,46 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The properties of a storage account for a container registry. Only + # applicable to Classic SKU. + # + class StorageAccountProperties + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The resource ID of the storage account. + attr_accessor :id + + + # + # Mapper for StorageAccountProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'StorageAccountProperties', + type: { + name: 'Composite', + class_name: 'StorageAccountProperties', + model_properties: { + id: { + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/target.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/target.rb new file mode 100644 index 0000000000..1f89e99b59 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/target.rb @@ -0,0 +1,108 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The target of the event. + # + class Target + + include MsRestAzure + + include MsRest::JSONable + # @return [String] The MIME type of the referenced object. + attr_accessor :media_type + + # @return [Integer] The number of bytes of the content. Same as Length + # field. + attr_accessor :size + + # @return [String] The digest of the content, as defined by the Registry + # V2 HTTP API Specificiation. + attr_accessor :digest + + # @return [Integer] The number of bytes of the content. Same as Size + # field. + attr_accessor :length + + # @return [String] The repository name. + attr_accessor :repository + + # @return [String] The direct URL to the content. + attr_accessor :url + + # @return [String] The tag name. + attr_accessor :tag + + + # + # Mapper for Target class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Target', + type: { + name: 'Composite', + class_name: 'Target', + model_properties: { + media_type: { + required: false, + serialized_name: 'mediaType', + type: { + name: 'String' + } + }, + size: { + required: false, + serialized_name: 'size', + type: { + name: 'Number' + } + }, + digest: { + required: false, + serialized_name: 'digest', + type: { + name: 'String' + } + }, + length: { + required: false, + serialized_name: 'length', + type: { + name: 'Number' + } + }, + repository: { + required: false, + serialized_name: 'repository', + type: { + name: 'String' + } + }, + url: { + required: false, + serialized_name: 'url', + type: { + name: 'String' + } + }, + tag: { + required: false, + serialized_name: 'tag', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook.rb new file mode 100644 index 0000000000..4f7630460c --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook.rb @@ -0,0 +1,135 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # An object that represents a webhook for a container registry. + # + class Webhook < MsRestAzure::Resource + + include MsRestAzure + + include MsRest::JSONable + # @return [WebhookStatus] The status of the webhook at the time the + # operation was called. Possible values include: 'enabled', 'disabled' + attr_accessor :status + + # @return [String] The scope of repositories where the event can be + # triggered. For example, 'foo:*' means events for all tags under + # repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + # equivalent to 'foo:latest'. Empty means all events. + attr_accessor :scope + + # @return [Array] The list of actions that trigger the + # webhook to post notifications. + attr_accessor :actions + + # @return [ProvisioningState] The provisioning state of the webhook at + # the time the operation was called. Possible values include: 'Creating', + # 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + attr_accessor :provisioning_state + + + # + # Mapper for Webhook class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Webhook', + type: { + name: 'Composite', + class_name: 'Webhook', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + scope: { + required: false, + serialized_name: 'properties.scope', + type: { + name: 'String' + } + }, + actions: { + required: true, + serialized_name: 'properties.actions', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'WebhookActionElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_action.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_action.rb new file mode 100644 index 0000000000..389708d7a7 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_action.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for WebhookAction + # + module WebhookAction + Push = "push" + Delete = "delete" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_create_parameters.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_create_parameters.rb new file mode 100644 index 0000000000..a1308e1d7e --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_create_parameters.rb @@ -0,0 +1,133 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The parameters for creating a webhook. + # + class WebhookCreateParameters + + include MsRestAzure + + include MsRest::JSONable + # @return [Hash{String => String}] The tags for the webhook. + attr_accessor :tags + + # @return [String] The location of the webhook. This cannot be changed + # after the resource is created. + attr_accessor :location + + # @return [String] The service URI for the webhook to post notifications. + attr_accessor :service_uri + + # @return [Hash{String => String}] Custom headers that will be added to + # the webhook notifications. + attr_accessor :custom_headers + + # @return [WebhookStatus] The status of the webhook at the time the + # operation was called. Possible values include: 'enabled', 'disabled' + attr_accessor :status + + # @return [String] The scope of repositories where the event can be + # triggered. For example, 'foo:*' means events for all tags under + # repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + # equivalent to 'foo:latest'. Empty means all events. + attr_accessor :scope + + # @return [Array] The list of actions that trigger the + # webhook to post notifications. + attr_accessor :actions + + + # + # Mapper for WebhookCreateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'WebhookCreateParameters', + type: { + name: 'Composite', + class_name: 'WebhookCreateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serialized_name: 'location', + type: { + name: 'String' + } + }, + service_uri: { + required: true, + serialized_name: 'properties.serviceUri', + type: { + name: 'String' + } + }, + custom_headers: { + required: false, + serialized_name: 'properties.customHeaders', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + scope: { + required: false, + serialized_name: 'properties.scope', + type: { + name: 'String' + } + }, + actions: { + required: true, + serialized_name: 'properties.actions', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'WebhookActionElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_list_result.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_list_result.rb new file mode 100644 index 0000000000..f8dfddfab8 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_list_result.rb @@ -0,0 +1,97 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The result of a request to list webhooks for a container registry. + # + class WebhookListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of webhooks. Since this list may be + # incomplete, the nextLink field should be used to request the next list + # of webhooks. + attr_accessor :value + + # @return [String] The URI that can be used to request the next list of + # webhooks. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [WebhookListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for WebhookListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'WebhookListResult', + type: { + name: 'Composite', + class_name: 'WebhookListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'WebhookElementType', + type: { + name: 'Composite', + class_name: 'Webhook' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_status.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_status.rb new file mode 100644 index 0000000000..ca86429fd2 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_status.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # Defines values for WebhookStatus + # + module WebhookStatus + Enabled = "enabled" + Disabled = "disabled" + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_update_parameters.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_update_parameters.rb new file mode 100644 index 0000000000..7686915369 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/models/webhook_update_parameters.rb @@ -0,0 +1,122 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + module Models + # + # The parameters for updating a webhook. + # + class WebhookUpdateParameters + + include MsRestAzure + + include MsRest::JSONable + # @return [Hash{String => String}] The tags for the webhook. + attr_accessor :tags + + # @return [String] The service URI for the webhook to post notifications. + attr_accessor :service_uri + + # @return [Hash{String => String}] Custom headers that will be added to + # the webhook notifications. + attr_accessor :custom_headers + + # @return [WebhookStatus] The status of the webhook at the time the + # operation was called. Possible values include: 'enabled', 'disabled' + attr_accessor :status + + # @return [String] The scope of repositories where the event can be + # triggered. For example, 'foo:*' means events for all tags under + # repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + # equivalent to 'foo:latest'. Empty means all events. + attr_accessor :scope + + # @return [Array] The list of actions that trigger the + # webhook to post notifications. + attr_accessor :actions + + + # + # Mapper for WebhookUpdateParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'WebhookUpdateParameters', + type: { + name: 'Composite', + class_name: 'WebhookUpdateParameters', + model_properties: { + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + service_uri: { + required: false, + serialized_name: 'properties.serviceUri', + type: { + name: 'String' + } + }, + custom_headers: { + required: false, + serialized_name: 'properties.customHeaders', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + scope: { + required: false, + serialized_name: 'properties.scope', + type: { + name: 'String' + } + }, + actions: { + required: false, + serialized_name: 'properties.actions', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'WebhookActionElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/module_definition.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/module_definition.rb new file mode 100644 index 0000000000..d9cd502f1d --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/module_definition.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::ARM end +module Azure::ARM::ContainerRegistry end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/operations.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/operations.rb new file mode 100644 index 0000000000..024187bc53 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/operations.rb @@ -0,0 +1,213 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + # + # Operations + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient + attr_reader :client + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.ContainerRegistry/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all of the available Azure Container Registry REST API operations. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/registries.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/registries.rb new file mode 100644 index 0000000000..fe2cb7ed15 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/registries.rb @@ -0,0 +1,1371 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + # + # Registries + # + class Registries + include MsRestAzure + + # + # Creates and initializes a new instance of the Registries class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient + attr_reader :client + + # + # Checks whether the container registry name is available for use. The name + # must contain only alphanumeric characters, be globally unique, and between 5 + # and 50 characters in length. + # + # @param registry_name_check_request [RegistryNameCheckRequest] The object + # containing information for the availability request. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryNameStatus] operation results. + # + def check_name_availability(registry_name_check_request, custom_headers = nil) + response = check_name_availability_async(registry_name_check_request, custom_headers).value! + response.body unless response.nil? + end + + # + # Checks whether the container registry name is available for use. The name + # must contain only alphanumeric characters, be globally unique, and between 5 + # and 50 characters in length. + # + # @param registry_name_check_request [RegistryNameCheckRequest] The object + # containing information for the availability request. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def check_name_availability_with_http_info(registry_name_check_request, custom_headers = nil) + check_name_availability_async(registry_name_check_request, custom_headers).value! + end + + # + # Checks whether the container registry name is available for use. The name + # must contain only alphanumeric characters, be globally unique, and between 5 + # and 50 characters in length. + # + # @param registry_name_check_request [RegistryNameCheckRequest] The object + # containing information for the availability request. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def check_name_availability_async(registry_name_check_request, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'registry_name_check_request is nil' if registry_name_check_request.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::RegistryNameCheckRequest.mapper() + request_content = @client.serialize(request_mapper, registry_name_check_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryNameStatus.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the properties of the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Registry] operation results. + # + def get(resource_group_name, registry_name, custom_headers = nil) + response = get_async(resource_group_name, registry_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the properties of the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, registry_name, custom_headers = nil) + get_async(resource_group_name, registry_name, custom_headers).value! + end + + # + # Gets the properties of the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, registry_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry [Registry] The parameters for creating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Registry] operation results. + # + def create(resource_group_name, registry_name, registry, custom_headers = nil) + response = create_async(resource_group_name, registry_name, registry, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry [Registry] The parameters for creating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_async(resource_group_name, registry_name, registry, custom_headers = nil) + # Send request + promise = begin_create_async(resource_group_name, registry_name, registry, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, registry_name, custom_headers = nil) + response = delete_async(resource_group_name, registry_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, registry_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, registry_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Updates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry_update_parameters [RegistryUpdateParameters] The parameters + # for updating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Registry] operation results. + # + def update(resource_group_name, registry_name, registry_update_parameters, custom_headers = nil) + response = update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry_update_parameters [RegistryUpdateParameters] The parameters + # for updating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all the container registries under the specified resource group. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) + first_page.get_all_items + end + + # + # Lists all the container registries under the specified resource group. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! + end + + # + # Lists all the container registries under the specified resource group. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the container registries under the specified subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Lists all the container registries under the specified subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Lists all the container registries under the specified subscription. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists the login credentials for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryListCredentialsResult] operation results. + # + def list_credentials(resource_group_name, registry_name, custom_headers = nil) + response = list_credentials_async(resource_group_name, registry_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the login credentials for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_credentials_with_http_info(resource_group_name, registry_name, custom_headers = nil) + list_credentials_async(resource_group_name, registry_name, custom_headers).value! + end + + # + # Lists the login credentials for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_credentials_async(resource_group_name, registry_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryListCredentialsResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Regenerates one of the login credentials for the specified container + # registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param regenerate_credential_parameters [RegenerateCredentialParameters] + # Specifies name of the password which should be regenerated -- password or + # password2. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryListCredentialsResult] operation results. + # + def regenerate_credential(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers = nil) + response = regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Regenerates one of the login credentials for the specified container + # registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param regenerate_credential_parameters [RegenerateCredentialParameters] + # Specifies name of the password which should be regenerated -- password or + # password2. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def regenerate_credential_with_http_info(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers = nil) + regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers).value! + end + + # + # Regenerates one of the login credentials for the specified container + # registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param regenerate_credential_parameters [RegenerateCredentialParameters] + # Specifies name of the password which should be regenerated -- password or + # password2. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'regenerate_credential_parameters is nil' if regenerate_credential_parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::RegenerateCredentialParameters.mapper() + request_content = @client.serialize(request_mapper, regenerate_credential_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryListCredentialsResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the quota usages for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryUsageListResult] operation results. + # + def list_usages(resource_group_name, registry_name, custom_headers = nil) + response = list_usages_async(resource_group_name, registry_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the quota usages for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_usages_with_http_info(resource_group_name, registry_name, custom_headers = nil) + list_usages_async(resource_group_name, registry_name, custom_headers).value! + end + + # + # Gets the quota usages for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_usages_async(resource_group_name, registry_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryUsageListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry [Registry] The parameters for creating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Registry] operation results. + # + def begin_create(resource_group_name, registry_name, registry, custom_headers = nil) + response = begin_create_async(resource_group_name, registry_name, registry, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry [Registry] The parameters for creating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_with_http_info(resource_group_name, registry_name, registry, custom_headers = nil) + begin_create_async(resource_group_name, registry_name, registry, custom_headers).value! + end + + # + # Creates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry [Registry] The parameters for creating a container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_async(resource_group_name, registry_name, registry, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'registry is nil' if registry.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + request_content = @client.serialize(request_mapper, registry) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, registry_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, registry_name, custom_headers).value! + nil + end + + # + # Deletes a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, registry_name, custom_headers = nil) + begin_delete_async(resource_group_name, registry_name, custom_headers).value! + end + + # + # Deletes a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, registry_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Updates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry_update_parameters [RegistryUpdateParameters] The parameters + # for updating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Registry] operation results. + # + def begin_update(resource_group_name, registry_name, registry_update_parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry_update_parameters [RegistryUpdateParameters] The parameters + # for updating a container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, registry_name, registry_update_parameters, custom_headers = nil) + begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers).value! + end + + # + # Updates a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param registry_update_parameters [RegistryUpdateParameters] The parameters + # for updating a container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'registry_update_parameters is nil' if registry_update_parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::RegistryUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, registry_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Registry.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the container registries under the specified resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the container registries under the specified resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all the container registries under the specified resource group. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the container registries under the specified subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the container registries under the specified subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all the container registries under the specified subscription. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::RegistryListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the container registries under the specified resource group. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists all the container registries under the specified subscription. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RegistryListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/replications.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/replications.rb new file mode 100644 index 0000000000..bbed7c308d --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/replications.rb @@ -0,0 +1,799 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + # + # Replications + # + class Replications + include MsRestAzure + + # + # Creates and initializes a new instance of the Replications class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient + attr_reader :client + + # + # Gets the properties of the specified replication. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Replication] operation results. + # + def get(resource_group_name, registry_name, replication_name, custom_headers = nil) + response = get_async(resource_group_name, registry_name, replication_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the properties of the specified replication. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, registry_name, replication_name, custom_headers = nil) + get_async(resource_group_name, registry_name, replication_name, custom_headers).value! + end + + # + # Gets the properties of the specified replication. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, registry_name, replication_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'replication_name is nil' if replication_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'replicationName' => replication_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication [Replication] The parameters for creating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Replication] operation results. + # + def create(resource_group_name, registry_name, replication_name, replication, custom_headers = nil) + response = create_async(resource_group_name, registry_name, replication_name, replication, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication [Replication] The parameters for creating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_async(resource_group_name, registry_name, replication_name, replication, custom_headers = nil) + # Send request + promise = begin_create_async(resource_group_name, registry_name, replication_name, replication, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes a replication from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, registry_name, replication_name, custom_headers = nil) + response = delete_async(resource_group_name, registry_name, replication_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, registry_name, replication_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, registry_name, replication_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Updates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication_update_parameters [ReplicationUpdateParameters] The + # parameters for updating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Replication] operation results. + # + def update(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers = nil) + response = update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication_update_parameters [ReplicationUpdateParameters] The + # parameters for updating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all the replications for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, registry_name, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, registry_name, custom_headers) + first_page.get_all_items + end + + # + # Lists all the replications for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(resource_group_name, registry_name, custom_headers = nil) + list_async(resource_group_name, registry_name, custom_headers).value! + end + + # + # Lists all the replications for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(resource_group_name, registry_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::ReplicationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication [Replication] The parameters for creating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Replication] operation results. + # + def begin_create(resource_group_name, registry_name, replication_name, replication, custom_headers = nil) + response = begin_create_async(resource_group_name, registry_name, replication_name, replication, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication [Replication] The parameters for creating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_with_http_info(resource_group_name, registry_name, replication_name, replication, custom_headers = nil) + begin_create_async(resource_group_name, registry_name, replication_name, replication, custom_headers).value! + end + + # + # Creates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication [Replication] The parameters for creating a replication. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_async(resource_group_name, registry_name, replication_name, replication, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'replication_name is nil' if replication_name.nil? + fail ArgumentError, 'replication is nil' if replication.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + request_content = @client.serialize(request_mapper, replication) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'replicationName' => replication_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes a replication from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, registry_name, replication_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, registry_name, replication_name, custom_headers).value! + nil + end + + # + # Deletes a replication from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, registry_name, replication_name, custom_headers = nil) + begin_delete_async(resource_group_name, registry_name, replication_name, custom_headers).value! + end + + # + # Deletes a replication from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, registry_name, replication_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'replication_name is nil' if replication_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'replicationName' => replication_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Updates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication_update_parameters [ReplicationUpdateParameters] The + # parameters for updating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Replication] operation results. + # + def begin_update(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication_update_parameters [ReplicationUpdateParameters] The + # parameters for updating a replication. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers = nil) + begin_update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers).value! + end + + # + # Updates a replication for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param replication_name [String] The name of the replication. + # @param replication_update_parameters [ReplicationUpdateParameters] The + # parameters for updating a replication. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'replication_name is nil' if replication_name.nil? + fail ArgumentError, 'replication_update_parameters is nil' if replication_update_parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::ReplicationUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, replication_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'replicationName' => replication_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Replication.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the replications for the specified container registry. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReplicationListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the replications for the specified container registry. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all the replications for the specified container registry. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::ReplicationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the replications for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ReplicationListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, registry_name, custom_headers = nil) + response = list_async(resource_group_name, registry_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/version.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/version.rb new file mode 100644 index 0000000000..788f8b1903 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + VERSION = '0.13.0' +end diff --git a/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/webhooks.rb b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/webhooks.rb new file mode 100644 index 0000000000..0d075ff359 --- /dev/null +++ b/management/azure_mgmt_container_registry/lib/generated/azure_mgmt_container_registry/webhooks.rb @@ -0,0 +1,1208 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::ContainerRegistry + # + # Webhooks + # + class Webhooks + include MsRestAzure + + # + # Creates and initializes a new instance of the Webhooks class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient + attr_reader :client + + # + # Gets the properties of the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Webhook] operation results. + # + def get(resource_group_name, registry_name, webhook_name, custom_headers = nil) + response = get_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the properties of the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers = nil) + get_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + end + + # + # Gets the properties of the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, registry_name, webhook_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates a webhook for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_create_parameters [WebhookCreateParameters] The parameters for + # creating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Webhook] operation results. + # + def create(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers = nil) + response = create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_create_parameters [WebhookCreateParameters] The parameters for + # creating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers = nil) + # Send request + promise = begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Deletes a webhook from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, registry_name, webhook_name, custom_headers = nil) + response = delete_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def delete_async(resource_group_name, registry_name, webhook_name, custom_headers = nil) + # Send request + promise = begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Updates a webhook with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_update_parameters [WebhookUpdateParameters] The parameters for + # updating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Webhook] operation results. + # + def update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers = nil) + response = update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_update_parameters [WebhookUpdateParameters] The parameters for + # updating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers = nil) + # Send request + promise = begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(resource_group_name, registry_name, custom_headers = nil) + first_page = list_as_lazy(resource_group_name, registry_name, custom_headers) + first_page.get_all_items + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(resource_group_name, registry_name, custom_headers = nil) + list_async(resource_group_name, registry_name, custom_headers).value! + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(resource_group_name, registry_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::WebhookListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Triggers a ping event to be sent to the webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventInfo] operation results. + # + def ping(resource_group_name, registry_name, webhook_name, custom_headers = nil) + response = ping_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Triggers a ping event to be sent to the webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def ping_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers = nil) + ping_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + end + + # + # Triggers a ping event to be sent to the webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def ping_async(resource_group_name, registry_name, webhook_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::EventInfo.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Gets the configuration of service URI and custom headers for the webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CallbackConfig] operation results. + # + def get_callback_config(resource_group_name, registry_name, webhook_name, custom_headers = nil) + response = get_callback_config_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the configuration of service URI and custom headers for the webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_callback_config_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers = nil) + get_callback_config_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + end + + # + # Gets the configuration of service URI and custom headers for the webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_callback_config_async(resource_group_name, registry_name, webhook_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::CallbackConfig.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists recent events for the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_events(resource_group_name, registry_name, webhook_name, custom_headers = nil) + first_page = list_events_as_lazy(resource_group_name, registry_name, webhook_name, custom_headers) + first_page.get_all_items + end + + # + # Lists recent events for the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_events_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers = nil) + list_events_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + end + + # + # Lists recent events for the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_events_async(resource_group_name, registry_name, webhook_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::EventListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Creates a webhook for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_create_parameters [WebhookCreateParameters] The parameters for + # creating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Webhook] operation results. + # + def begin_create(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers = nil) + response = begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Creates a webhook for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_create_parameters [WebhookCreateParameters] The parameters for + # creating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_with_http_info(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers = nil) + begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers).value! + end + + # + # Creates a webhook for a container registry with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_create_parameters [WebhookCreateParameters] The parameters for + # creating a webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + fail ArgumentError, 'webhook_create_parameters is nil' if webhook_create_parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::WebhookCreateParameters.mapper() + request_content = @client.serialize(request_mapper, webhook_create_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Deletes a webhook from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_delete(resource_group_name, registry_name, webhook_name, custom_headers = nil) + response = begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + nil + end + + # + # Deletes a webhook from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_delete_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers = nil) + begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + end + + # + # Deletes a webhook from a container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 202 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Updates a webhook with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_update_parameters [WebhookUpdateParameters] The parameters for + # updating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Webhook] operation results. + # + def begin_update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers = nil) + response = begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers).value! + response.body unless response.nil? + end + + # + # Updates a webhook with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_update_parameters [WebhookUpdateParameters] The parameters for + # updating a webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_update_with_http_info(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers = nil) + begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers).value! + end + + # + # Updates a webhook with the specified parameters. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param webhook_update_parameters [WebhookUpdateParameters] The parameters for + # updating a webhook. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'registry_name is nil' if registry_name.nil? + fail ArgumentError, 'webhook_name is nil' if webhook_name.nil? + fail ArgumentError, 'webhook_update_parameters is nil' if webhook_update_parameters.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ARM::ContainerRegistry::Models::WebhookUpdateParameters.mapper() + request_content = @client.serialize(request_mapper, webhook_update_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::Webhook.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [WebhookListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::WebhookListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists recent events for the specified webhook. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventListResult] operation results. + # + def list_events_next(next_page_link, custom_headers = nil) + response = list_events_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Lists recent events for the specified webhook. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_events_next_with_http_info(next_page_link, custom_headers = nil) + list_events_next_async(next_page_link, custom_headers).value! + end + + # + # Lists recent events for the specified webhook. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_events_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ARM::ContainerRegistry::Models::EventListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Lists all the webhooks for the specified container registry. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [WebhookListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, registry_name, custom_headers = nil) + response = list_async(resource_group_name, registry_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Lists recent events for the specified webhook. + # + # @param resource_group_name [String] The name of the resource group to which + # the container registry belongs. + # @param registry_name [String] The name of the container registry. + # @param webhook_name [String] The name of the webhook. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EventListResult] which provide lazy access to pages of the response. + # + def list_events_as_lazy(resource_group_name, registry_name, webhook_name, custom_headers = nil) + response = list_events_async(resource_group_name, registry_name, webhook_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_events_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_registry/spec/spec_helper.rb b/management/azure_mgmt_container_registry/spec/spec_helper.rb new file mode 100644 index 0000000000..069c2dde5c --- /dev/null +++ b/management/azure_mgmt_container_registry/spec/spec_helper.rb @@ -0,0 +1,6 @@ +# encoding: utf-8 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. + +require 'dotenv' +Dotenv.load(File.join(File.dirname(__FILE__), '../../../.env')) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index 40bcfa9863..677e442aba 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -93,6 +93,18 @@ "azure_mgmt_compute.rb" ] }, + "azure_mgmt_container_registry": { + "markdown": "specification/containerregistry/resource-manager/readme.md", + "autorest_options": { + "namespace": "Azure::ARM::ContainerRegistry", + "package-name": "azure_mgmt_container_registry", + "package-version": "0.13.0" + }, + "output_dir": "management/azure_mgmt_container_registry/lib", + "wrapper_filesOrDirs": [ + "azure_mgmt_container_registry.rb" + ] + }, "azure_mgmt_datalake_analytics": { "markdown": "specification/datalake-analytics/resource-manager/readme.md", "autorest_options": {