diff --git a/ChangeLog.md b/ChangeLog.md index 7d291d71e5..b5dfba2b2f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,11 @@ +## 2019.01.31 - Azure Ruby SDK Release +* Released the following SDKs + - azure_mgmt_devtestlabs - v0.17.2 + - azure_mgmt_hdinsight - v0.17.1 + - azure_mgmt_labservices - v0.17.0 + - azure_cognitiveservices_computervision - v0.18.0 + - azure_sdk - v0.22.0 + ## 2019.01.15 - Azure Ruby SDK Release * Released the following SDKs - azure_mgmt_network - v0.18.3 diff --git a/Gemfile b/Gemfile index 1f33527efd..57ea5c256c 100644 --- a/Gemfile +++ b/Gemfile @@ -42,6 +42,7 @@ gem 'azure_mgmt_iot_central', path: 'management/azure_mgmt_iot_cen gem 'azure_mgmt_iot_hub', path: 'management/azure_mgmt_iot_hub' gem 'azure_mgmt_key_vault', path: 'management/azure_mgmt_key_vault' gem 'azure_mgmt_kusto', path: 'management/azure_mgmt_kusto' +gem 'azure_mgmt_labservices', path: 'management/azure_mgmt_labservices' gem 'azure_mgmt_links', path: 'management/azure_mgmt_links' gem 'azure_mgmt_locks', path: 'management/azure_mgmt_locks' gem 'azure_mgmt_logic', path: 'management/azure_mgmt_logic' diff --git a/azure_sdk/lib/azure_sdk/version.rb b/azure_sdk/lib/azure_sdk/version.rb index 7cf6e62227..3d95e326a1 100644 --- a/azure_sdk/lib/azure_sdk/version.rb +++ b/azure_sdk/lib/azure_sdk/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure - VERSION = '0.21.1' + VERSION = '0.22.0' end diff --git a/azure_sdk/lib/latest/latest_profile_client.rb b/azure_sdk/lib/latest/latest_profile_client.rb index 5f176af5c6..b9595da857 100644 --- a/azure_sdk/lib/latest/latest_profile_client.rb +++ b/azure_sdk/lib/latest/latest_profile_client.rb @@ -33,6 +33,7 @@ require 'latest/modules/iothub_profile_module' require 'latest/modules/keyvault_profile_module' require 'latest/modules/kusto_profile_module' +require 'latest/modules/labservices_profile_module' require 'latest/modules/links_profile_module' require 'latest/modules/locks_profile_module' require 'latest/modules/logic_profile_module' @@ -96,7 +97,7 @@ module Azure::Profiles::Latest class Client include MsRestAzure::Common::Configurable - attr_reader :analysis_services, :api_management, :authorization, :automation, :batch, :billing, :cdn, :cognitive_services, :commerce, :compute, :consumption, :container_instance, :container_registry, :container_service, :customer_insights, :data_lake_analytics, :data_lake_store, :data_migration, :dev_spaces, :dev_test_labs, :dns, :event_grid, :event_hub, :features, :hdinsight, :graph_rbac, :iot_central, :iot_hub, :key_vault, :kusto, :links, :locks, :logic, :machine_learning, :machine_learning_services, :managed_applications, :marketplace_ordering, :media_services, :monitor, :managed_service_identity, :network, :notification_hubs, :operational_insights, :policy, :policy_insights, :power_bi_embedded, :recovery_services, :recovery_services_backup, :recovery_services_site_recovery, :redis, :relay, :resources, :resources_management, :scheduler, :search, :security, :service_bus, :service_fabric, :signalr, :sql, :sqlvirtualmachine, :stor_simple8000_series, :storage, :stream_analytics, :subscriptions, :traffic_manager, :web, :autosuggest, :customimagesearch, :computer_vision, :content_moderator, :custom_search, :customvisiontraining, :customvisionprediction, :entity_search, :face, :image_search, :local_search, :news_search, :qnamaker, :spell_check, :text_analytics, :video_search, :web_search, :visual_search + attr_reader :analysis_services, :api_management, :authorization, :automation, :batch, :billing, :cdn, :cognitive_services, :commerce, :compute, :consumption, :container_instance, :container_registry, :container_service, :customer_insights, :data_lake_analytics, :data_lake_store, :data_migration, :dev_spaces, :dev_test_labs, :dns, :event_grid, :event_hub, :features, :hdinsight, :graph_rbac, :iot_central, :iot_hub, :key_vault, :kusto, :labservices, :links, :locks, :logic, :machine_learning, :machine_learning_services, :managed_applications, :marketplace_ordering, :media_services, :monitor, :managed_service_identity, :network, :notification_hubs, :operational_insights, :policy, :policy_insights, :power_bi_embedded, :recovery_services, :recovery_services_backup, :recovery_services_site_recovery, :redis, :relay, :resources, :resources_management, :scheduler, :search, :security, :service_bus, :service_fabric, :signalr, :sql, :sqlvirtualmachine, :stor_simple8000_series, :storage, :stream_analytics, :subscriptions, :traffic_manager, :web, :autosuggest, :customimagesearch, :computer_vision, :content_moderator, :custom_search, :customvisiontraining, :customvisionprediction, :entity_search, :face, :image_search, :local_search, :news_search, :qnamaker, :spell_check, :text_analytics, :video_search, :web_search, :visual_search # # Initializes a new instance of the Client class. @@ -158,6 +159,7 @@ def initialize(options = {}) @iot_hub = IotHubAdapter.new(self, base_url, sdk_options) @key_vault = KeyVaultAdapter.new(self, base_url, sdk_options) @kusto = KustoAdapter.new(self, base_url, sdk_options) + @labservices = LabservicesAdapter.new(self, base_url, sdk_options) @links = LinksAdapter.new(self, base_url, sdk_options) @locks = LocksAdapter.new(self, base_url, sdk_options) @logic = LogicAdapter.new(self, base_url, sdk_options) @@ -456,6 +458,14 @@ def initialize(context, base_url, options) end end + class LabservicesAdapter + attr_accessor :mgmt + + def initialize(context, base_url, options) + @mgmt = Azure::Profiles::Latest::Labservices::Mgmt::LabservicesManagementClass.new(context, base_url, options) + end + end + class LinksAdapter attr_accessor :mgmt diff --git a/azure_sdk/lib/latest/modules/computervision_profile_module.rb b/azure_sdk/lib/latest/modules/computervision_profile_module.rb index 2a7e5a2600..6f5e19f636 100644 --- a/azure_sdk/lib/latest/modules/computervision_profile_module.rb +++ b/azure_sdk/lib/latest/modules/computervision_profile_module.rb @@ -8,42 +8,46 @@ module Azure::Profiles::Latest module ComputerVision module Models - FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription - ImageMetadata = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata - Line = Azure::CognitiveServices::ComputerVision::V2_0::Models::Line - ImageAnalysis = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis - TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult + DetectResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectResult + FaceRectangle = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle + ModelDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription + LandmarksModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel + ListModelsResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult + Category = Azure::CognitiveServices::ComputerVision::V2_0::Models::Category + DomainModelResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults + ColorInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo OcrWord = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrWord - CelebritiesModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel + ImageTag = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag OcrLine = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLine - CategoryDetail = Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail + ImageDescriptionDetails = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails OcrRegion = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrRegion - AdultInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo + BoundingRect = Azure::CognitiveServices::ComputerVision::V2_0::Models::BoundingRect OcrResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult - ImageType = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType - ModelDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription + DetectedObject = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedObject + TagResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult + ImageAnalysis = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis + AreaOfInterestResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult + CelebritiesModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel + ImageUrl = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl + AdultInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo + ComputerVisionError = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError ImageCaption = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption - ListModelsResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult - Word = Azure::CognitiveServices::ComputerVision::V2_0::Models::Word - DomainModelResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults - FaceRectangle = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle - CelebrityResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults - Category = Azure::CognitiveServices::ComputerVision::V2_0::Models::Category LandmarkResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults - ImageTag = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag + ObjectHierarchy = Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy + CelebrityResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults ImageDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription + Word = Azure::CognitiveServices::ComputerVision::V2_0::Models::Word + ImageType = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType + Line = Azure::CognitiveServices::ComputerVision::V2_0::Models::Line + ImageMetadata = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata RecognitionResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult - TagResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult - ColorInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo - ComputerVisionError = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError - LandmarksModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel - ImageUrl = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl - ImageDescriptionDetails = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails - TextOperationStatusCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes + FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription + TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult + CategoryDetail = Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail Gender = Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender - ComputerVisionErrorCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionErrorCodes - VisualFeatureTypes = Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes + TextOperationStatusCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes OcrLanguages = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages + VisualFeatureTypes = Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes TextRecognitionMode = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionMode Details = Azure::CognitiveServices::ComputerVision::V2_0::Models::Details end @@ -77,114 +81,126 @@ def method_missing(method, *args) end class ModelClasses - def face_description - Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription + def detect_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectResult end - def image_metadata - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata + def face_rectangle + Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle end - def line - Azure::CognitiveServices::ComputerVision::V2_0::Models::Line + def model_description + Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription end - def image_analysis - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis + def landmarks_model + Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel end - def text_operation_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult + def list_models_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult + end + def category + Azure::CognitiveServices::ComputerVision::V2_0::Models::Category + end + def domain_model_results + Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults + end + def color_info + Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo end def ocr_word Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrWord end - def celebrities_model - Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel + def image_tag + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag end def ocr_line Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLine end - def category_detail - Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail + def image_description_details + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails end def ocr_region Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrRegion end - def adult_info - Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo + def bounding_rect + Azure::CognitiveServices::ComputerVision::V2_0::Models::BoundingRect end def ocr_result Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult end - def image_type - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType + def detected_object + Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedObject end - def model_description - Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription + def tag_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult end - def image_caption - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption + def image_analysis + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis end - def list_models_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult + def area_of_interest_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult end - def word - Azure::CognitiveServices::ComputerVision::V2_0::Models::Word + def celebrities_model + Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel end - def domain_model_results - Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults + def image_url + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl end - def face_rectangle - Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle + def adult_info + Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo end - def celebrity_results - Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults + def computer_vision_error + Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError end - def category - Azure::CognitiveServices::ComputerVision::V2_0::Models::Category + def image_caption + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption end def landmark_results Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults end - def image_tag - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag + def object_hierarchy + Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy + end + def celebrity_results + Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults end def image_description Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription end - def recognition_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult + def word + Azure::CognitiveServices::ComputerVision::V2_0::Models::Word end - def tag_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult + def image_type + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType end - def color_info - Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo + def line + Azure::CognitiveServices::ComputerVision::V2_0::Models::Line end - def computer_vision_error - Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError + def image_metadata + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata end - def landmarks_model - Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel + def recognition_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult end - def image_url - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl + def face_description + Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription end - def image_description_details - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails + def text_operation_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult end - def text_operation_status_codes - Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes + def category_detail + Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail end def gender Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender end - def computer_vision_error_codes - Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionErrorCodes - end - def visual_feature_types - Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes + def text_operation_status_codes + Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes end def ocr_languages Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages end + def visual_feature_types + Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes + end def text_recognition_mode Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionMode end diff --git a/azure_sdk/lib/latest/modules/devtestlabs_profile_module.rb b/azure_sdk/lib/latest/modules/devtestlabs_profile_module.rb index d2fa1e310d..ac54a905cd 100644 --- a/azure_sdk/lib/latest/modules/devtestlabs_profile_module.rb +++ b/azure_sdk/lib/latest/modules/devtestlabs_profile_module.rb @@ -7,196 +7,231 @@ module Azure::Profiles::Latest module DevTestLabs module Mgmt - ProviderOperations = Azure::DevTestLabs::Mgmt::V2016_05_15::ProviderOperations - Labs = Azure::DevTestLabs::Mgmt::V2016_05_15::Labs - Operations = Azure::DevTestLabs::Mgmt::V2016_05_15::Operations - GlobalSchedules = Azure::DevTestLabs::Mgmt::V2016_05_15::GlobalSchedules - ArtifactSources = Azure::DevTestLabs::Mgmt::V2016_05_15::ArtifactSources - ArmTemplates = Azure::DevTestLabs::Mgmt::V2016_05_15::ArmTemplates - Artifacts = Azure::DevTestLabs::Mgmt::V2016_05_15::Artifacts - Costs = Azure::DevTestLabs::Mgmt::V2016_05_15::Costs - CustomImages = Azure::DevTestLabs::Mgmt::V2016_05_15::CustomImages - Formulas = Azure::DevTestLabs::Mgmt::V2016_05_15::Formulas - GalleryImages = Azure::DevTestLabs::Mgmt::V2016_05_15::GalleryImages - NotificationChannels = Azure::DevTestLabs::Mgmt::V2016_05_15::NotificationChannels - PolicySets = Azure::DevTestLabs::Mgmt::V2016_05_15::PolicySets - Policies = Azure::DevTestLabs::Mgmt::V2016_05_15::Policies - Schedules = Azure::DevTestLabs::Mgmt::V2016_05_15::Schedules - ServiceRunners = Azure::DevTestLabs::Mgmt::V2016_05_15::ServiceRunners - Users = Azure::DevTestLabs::Mgmt::V2016_05_15::Users - Disks = Azure::DevTestLabs::Mgmt::V2016_05_15::Disks - Environments = Azure::DevTestLabs::Mgmt::V2016_05_15::Environments - Secrets = Azure::DevTestLabs::Mgmt::V2016_05_15::Secrets - VirtualMachines = Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualMachines - VirtualMachineSchedules = Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualMachineSchedules - VirtualNetworks = Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualNetworks + ProviderOperations = Azure::DevTestLabs::Mgmt::V2018_09_15::ProviderOperations + Labs = Azure::DevTestLabs::Mgmt::V2018_09_15::Labs + Operations = Azure::DevTestLabs::Mgmt::V2018_09_15::Operations + GlobalSchedules = Azure::DevTestLabs::Mgmt::V2018_09_15::GlobalSchedules + ArtifactSources = Azure::DevTestLabs::Mgmt::V2018_09_15::ArtifactSources + ArmTemplates = Azure::DevTestLabs::Mgmt::V2018_09_15::ArmTemplates + Artifacts = Azure::DevTestLabs::Mgmt::V2018_09_15::Artifacts + Costs = Azure::DevTestLabs::Mgmt::V2018_09_15::Costs + CustomImages = Azure::DevTestLabs::Mgmt::V2018_09_15::CustomImages + Formulas = Azure::DevTestLabs::Mgmt::V2018_09_15::Formulas + GalleryImages = Azure::DevTestLabs::Mgmt::V2018_09_15::GalleryImages + NotificationChannels = Azure::DevTestLabs::Mgmt::V2018_09_15::NotificationChannels + PolicySets = Azure::DevTestLabs::Mgmt::V2018_09_15::PolicySets + Policies = Azure::DevTestLabs::Mgmt::V2018_09_15::Policies + Schedules = Azure::DevTestLabs::Mgmt::V2018_09_15::Schedules + ServiceRunners = Azure::DevTestLabs::Mgmt::V2018_09_15::ServiceRunners + Users = Azure::DevTestLabs::Mgmt::V2018_09_15::Users + Disks = Azure::DevTestLabs::Mgmt::V2018_09_15::Disks + Environments = Azure::DevTestLabs::Mgmt::V2018_09_15::Environments + Secrets = Azure::DevTestLabs::Mgmt::V2018_09_15::Secrets + ServiceFabrics = Azure::DevTestLabs::Mgmt::V2018_09_15::ServiceFabrics + ServiceFabricSchedules = Azure::DevTestLabs::Mgmt::V2018_09_15::ServiceFabricSchedules + VirtualMachines = Azure::DevTestLabs::Mgmt::V2018_09_15::VirtualMachines + VirtualMachineSchedules = Azure::DevTestLabs::Mgmt::V2018_09_15::VirtualMachineSchedules + VirtualNetworks = Azure::DevTestLabs::Mgmt::V2018_09_15::VirtualNetworks module Models - ExternalSubnetFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnetFragment - GalleryImageReference = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReference - DayDetails = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetails - InboundNatRule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRule - NotificationSettings = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettings - SharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfiguration - ExportResourceUsageParameters = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExportResourceUsageParameters - WeekDetailsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetailsFragment - ExternalSubnet = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnet - HourDetailsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetailsFragment - WeekDetails = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetails - UserSecretStore = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStore - HourDetails = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetails - ArtifactParameterProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterProperties - ArtifactInstallProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallProperties - ResponseWithContinuationLab = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab - ParametersValueFileInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParametersValueFileInfo - ResponseWithContinuationLabVirtualMachine = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVirtualMachine - ArmTemplateInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateInfo - NetworkInterfaceProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfaceProperties - ResponseWithContinuationUser = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationUser - LabVirtualMachineCreationParameter = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineCreationParameter - ArtifactDeploymentStatusPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusPropertiesFragment - FormulaPropertiesFromVm = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FormulaPropertiesFromVm - ArtifactInstallPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallPropertiesFragment - ResponseWithContinuationLabVhd = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVhd - Subnet = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Subnet - UserSecretStoreFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStoreFragment - AttachNewDataDiskOptions = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachNewDataDiskOptions - GalleryImageReferenceFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReferenceFragment - ParameterInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParameterInfo - ComputeDataDisk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDisk - GenerateArmTemplateRequest = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateArmTemplateRequest - ComputeVmInstanceViewStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatus - GenerateUploadUriParameter = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriParameter - ComputeVmProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmProperties - GenerateUploadUriResponse = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriResponse - PercentageCostThresholdProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PercentageCostThresholdProperties - IdentityProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::IdentityProperties - WindowsOsInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsInfo - InboundNatRuleFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRuleFragment - CustomImagePropertiesFromVm = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesFromVm - UserIdentityFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentityFragment - ResponseWithContinuationSchedule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSchedule - TargetCostProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostProperties - DetachDataDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDataDiskProperties - LabCostSummaryProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostSummaryProperties - ResponseWithContinuationPolicy = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationPolicy - LabCostDetailsProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostDetailsProperties - ResponseWithContinuationNotificationChannel = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationNotificationChannel - LabResourceCostProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabResourceCostProperties - EvaluatePoliciesRequest = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesRequest - SubnetOverrideFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverrideFragment - PolicySetResult = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicySetResult - SubnetSharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfigurationFragment - Event = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Event - LabVhd = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVhd - DayDetailsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetailsFragment - SubnetFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetFragment - UserIdentity = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentity - SharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfigurationFragment - ResponseWithContinuationServiceRunner = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationServiceRunner - NetworkInterfacePropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfacePropertiesFragment - ArtifactDeploymentStatusProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusProperties - ShutdownNotificationContent = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ShutdownNotificationContent - ResponseWithContinuationSecret = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSecret - RetargetScheduleProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::RetargetScheduleProperties - BulkCreationParameters = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::BulkCreationParameters - ResponseWithContinuationVirtualNetwork = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationVirtualNetwork - ComputeDataDiskFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDiskFragment - NotifyParameters = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotifyParameters - ComputeVmPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmPropertiesFragment - OperationError = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationError - LinuxOsInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsInfo - OperationMetadataDisplay = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadataDisplay - DataDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DataDiskProperties - OperationMetadata = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadata - EnvironmentDeploymentProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnvironmentDeploymentProperties - OperationResult = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationResult - PolicyViolation = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyViolation - SubnetOverride = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverride - EventFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EventFragment - SubnetSharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfiguration - ApplyArtifactsRequest = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplyArtifactsRequest - Port = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Port - ArtifactParameterPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterPropertiesFragment - PortFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PortFragment - ProviderOperationResult = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ProviderOperationResult - CostThresholdProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdProperties - Resource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Resource - DetachDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDiskProperties - ResponseWithContinuationArmTemplate = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArmTemplate - EvaluatePoliciesResponse = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesResponse - ResponseWithContinuationArtifact = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifact - ArmTemplateParameterProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateParameterProperties - ResponseWithContinuationArtifactSource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifactSource - ComputeVmInstanceViewStatusFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatusFragment - ResponseWithContinuationCustomImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationCustomImage - EvaluatePoliciesProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesProperties - ResponseWithContinuationDisk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDisk - AttachDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachDiskProperties - ResponseWithContinuationDtlEnvironment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDtlEnvironment - NotificationSettingsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettingsFragment - ResponseWithContinuationFormula = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationFormula - CustomImagePropertiesCustom = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesCustom - ResponseWithContinuationGalleryImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationGalleryImage - Schedule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Schedule - ApplicableSchedule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableSchedule - ScheduleFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ScheduleFragment - ApplicableScheduleFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableScheduleFragment - ArmTemplate = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplate - Artifact = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Artifact - ArtifactSource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSource - ArtifactSourceFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSourceFragment - CustomImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImage - Disk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Disk - DtlEnvironment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DtlEnvironment - Formula = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Formula - GalleryImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImage - Lab = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab - LabCost = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCost - LabFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabFragment - LabVirtualMachine = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine - LabVirtualMachineFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineFragment - NotificationChannel = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannel - NotificationChannelFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelFragment - Policy = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Policy - PolicyFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFragment - Secret = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Secret - ServiceRunner = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ServiceRunner - User = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::User - VirtualNetwork = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetwork - UserFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserFragment - VirtualNetworkFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetworkFragment - EnableStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnableStatus - NotificationStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationStatus - SourceControlType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SourceControlType - StorageType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::StorageType - CostThresholdStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdStatus - WindowsOsState = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsState - LinuxOsState = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsState - CustomImageOsType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImageOsType - HostCachingOptions = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HostCachingOptions - NotificationChannelEventType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelEventType - TransportProtocol = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TransportProtocol - VirtualMachineCreationSource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualMachineCreationSource - FileUploadOptions = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FileUploadOptions - PremiumDataDisk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PremiumDataDisk - TargetCostStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostStatus - ReportingCycleType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ReportingCycleType - CostType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostType - HttpStatusCode = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HttpStatusCode - PolicyStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyStatus - PolicyFactName = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFactName - PolicyEvaluatorType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyEvaluatorType - UsagePermissionType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UsagePermissionType + SharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfiguration + WeekDetails = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetails + NetworkInterfaceProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfaceProperties + HourDetails = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetails + ScheduleCreationParameter = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameter + EnvironmentDeploymentPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentPropertiesFragment + VirtualNetworkList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkList + Subnet = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Subnet + DayDetailsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetailsFragment + DtlEnvironmentList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentList + NotificationSettingsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettingsFragment + EvaluatePoliciesProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesProperties + UserSecretStoreFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStoreFragment + EvaluatePoliciesRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesRequest + ArtifactInstallProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallProperties + PolicyViolation = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyViolation + ParametersValueFileInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParametersValueFileInfo + PolicySetResult = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicySetResult + ArmTemplateInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateInfo + EvaluatePoliciesResponse = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesResponse + ArmTemplateParameterProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterProperties + Event = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Event + UserSecretStore = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStore + EventFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EventFragment + ArtifactDeploymentStatusPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusPropertiesFragment + ExportResourceUsageParameters = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExportResourceUsageParameters + ArtifactInstallPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallPropertiesFragment + ExternalSubnet = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnet + UserIdentity = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentity + ExternalSubnetFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnetFragment + ArtifactSourceList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceList + GalleryImageReference = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReference + AttachNewDataDiskOptions = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptions + InboundNatRule = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRule + BulkCreationParameters = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParameters + DayDetails = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetails + NotificationSettings = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettings + ComputeDataDisk = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDisk + ShutdownNotificationContent = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ShutdownNotificationContent + ComputeVmInstanceViewStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatus + LabVirtualMachineCreationParameter = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameter + ComputeVmProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmProperties + FormulaPropertiesFromVm = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVm + PercentageCostThresholdProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PercentageCostThresholdProperties + ServiceRunnerList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunnerList + WindowsOsInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfo + GalleryImageReferenceFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReferenceFragment + CustomImagePropertiesFromVm = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVm + InboundNatRuleFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRuleFragment + DataDiskStorageTypeInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfo + SharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfigurationFragment + SubnetOverrideFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverrideFragment + NetworkInterfacePropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfacePropertiesFragment + LinuxOsInfoFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfoFragment + ScheduleCreationParameterFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameterFragment + CustomImagePropertiesCustomFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustomFragment + LabVirtualMachineCreationParameterFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameterFragment + CustomImagePropertiesFromPlanFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlanFragment + FormulaPropertiesFromVmFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVmFragment + CustomImageList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageList + ServiceFabricList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricList + DataDiskPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskPropertiesFragment + FormulaList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaList + DetachDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDiskProperties + SecretList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretList + SubnetSharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfiguration + GalleryImageList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageList + EnvironmentDeploymentProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentProperties + ParameterInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParameterInfo + WeekDetailsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetailsFragment + GenerateArmTemplateRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateArmTemplateRequest + UserList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserList + GenerateUploadUriParameter = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriParameter + ApplyArtifactsRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplyArtifactsRequest + GenerateUploadUriResponse = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriResponse + ArmTemplateList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateList + IdentityProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::IdentityProperties + ArtifactDeploymentStatusProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusProperties + ImportLabVirtualMachineRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ImportLabVirtualMachineRequest + ArtifactList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactList + LabAnnouncementProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementProperties + AttachDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachDiskProperties + LabSupportProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportProperties + BulkCreationParametersFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParametersFragment + ScheduleList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList + ComputeDataDiskFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDiskFragment + LabAnnouncementPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementPropertiesFragment + ComputeVmPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmPropertiesFragment + TargetCostProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostProperties + LinuxOsInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfo + LabCostSummaryProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostSummaryProperties + CustomImagePropertiesFromPlan = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlan + LabCostDetailsProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostDetailsProperties + CustomImagePropertiesFromVmFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVmFragment + LabResourceCostProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabResourceCostProperties + SubnetSharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfigurationFragment + RetargetScheduleProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RetargetScheduleProperties + DetachDataDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDataDiskProperties + LabSupportPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportPropertiesFragment + DiskList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskList + Resource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Resource + HourDetailsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetailsFragment + LabList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabList + UserIdentityFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentityFragment + LabVhd = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhd + ArtifactParameterPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterPropertiesFragment + LabVhdList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhdList + AttachNewDataDiskOptionsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptionsFragment + ResizeLabVirtualMachineProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ResizeLabVirtualMachineProperties + ComputeVmInstanceViewStatusFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatusFragment + RdpConnection = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RdpConnection + CustomImagePropertiesCustom = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustom + LabVirtualMachineList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList + DataDiskStorageTypeInfoFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfoFragment + ProviderOperationResult = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ProviderOperationResult + SubnetOverride = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverride + PortFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PortFragment + ArtifactParameterProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterProperties + NotificationChannelList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelList + UpdateResource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UpdateResource + NotifyParameters = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotifyParameters + CostThresholdProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdProperties + OperationError = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationError + DataDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskProperties + OperationMetadataDisplay = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadataDisplay + ArmTemplateParameterPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterPropertiesFragment + OperationMetadata = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadata + WindowsOsInfoFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfoFragment + OperationResult = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationResult + Port = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Port + SubnetFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetFragment + PolicyList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyList + Schedule = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule + ApplicableSchedule = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule + ScheduleFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment + ApplicableScheduleFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableScheduleFragment + ArmTemplate = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplate + Artifact = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Artifact + ArtifactSource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource + ArtifactSourceFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceFragment + CustomImage = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage + CustomImageFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageFragment + Disk = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Disk + DiskFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskFragment + DtlEnvironment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment + DtlEnvironmentFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentFragment + Formula = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Formula + FormulaFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaFragment + GalleryImage = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImage + Lab = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Lab + LabCost = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost + LabFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabFragment + LabVirtualMachine = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine + LabVirtualMachineFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineFragment + NotificationChannel = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel + NotificationChannelFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelFragment + Policy = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Policy + PolicyFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFragment + Secret = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Secret + SecretFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretFragment + ServiceFabric = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric + ServiceFabricFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricFragment + ServiceRunner = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner + User = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::User + UserFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserFragment + VirtualNetwork = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork + VirtualNetworkFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkFragment + EnableStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnableStatus + SourceControlType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SourceControlType + StorageType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::StorageType + CostThresholdStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdStatus + WindowsOsState = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsState + LinuxOsState = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsState + CustomImageOsType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageOsType + HostCachingOptions = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HostCachingOptions + NotificationChannelEventType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelEventType + TransportProtocol = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TransportProtocol + VirtualMachineCreationSource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualMachineCreationSource + FileUploadOptions = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FileUploadOptions + PremiumDataDisk = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PremiumDataDisk + EnvironmentPermission = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentPermission + TargetCostStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostStatus + ReportingCycleType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ReportingCycleType + CostType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostType + HttpStatusCode = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HttpStatusCode + PolicyStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyStatus + PolicyFactName = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFactName + PolicyEvaluatorType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyEvaluatorType + UsagePermissionType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UsagePermissionType end class DevTestLabsManagementClass - attr_reader :provider_operations, :labs, :operations, :global_schedules, :artifact_sources, :arm_templates, :artifacts, :costs, :custom_images, :formulas, :gallery_images, :notification_channels, :policy_sets, :policies, :schedules, :service_runners, :users, :disks, :environments, :secrets, :virtual_machines, :virtual_machine_schedules, :virtual_networks, :configurable, :base_url, :options, :model_classes + attr_reader :provider_operations, :labs, :operations, :global_schedules, :artifact_sources, :arm_templates, :artifacts, :costs, :custom_images, :formulas, :gallery_images, :notification_channels, :policy_sets, :policies, :schedules, :service_runners, :users, :disks, :environments, :secrets, :service_fabrics, :service_fabric_schedules, :virtual_machines, :virtual_machine_schedules, :virtual_networks, :configurable, :base_url, :options, :model_classes def initialize(configurable, base_url=nil, options=nil) @configurable, @base_url, @options = configurable, base_url, options - @client_0 = Azure::DevTestLabs::Mgmt::V2016_05_15::DevTestLabsClient.new(configurable.credentials, base_url, options) + @client_0 = Azure::DevTestLabs::Mgmt::V2018_09_15::DevTestLabsClient.new(configurable.credentials, base_url, options) if(@client_0.respond_to?(:subscription_id)) @client_0.subscription_id = configurable.subscription_id end @@ -221,6 +256,8 @@ def initialize(configurable, base_url=nil, options=nil) @disks = @client_0.disks @environments = @client_0.environments @secrets = @client_0.secrets + @service_fabrics = @client_0.service_fabrics + @service_fabric_schedules = @client_0.service_fabric_schedules @virtual_machines = @client_0.virtual_machines @virtual_machine_schedules = @client_0.virtual_machine_schedules @virtual_networks = @client_0.virtual_networks @@ -242,473 +279,572 @@ def method_missing(method, *args) end class ModelClasses - def external_subnet_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnetFragment + def shared_public_ip_address_configuration + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfiguration end - def gallery_image_reference - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReference + def week_details + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetails end - def day_details - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetails + def network_interface_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfaceProperties end - def inbound_nat_rule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRule + def hour_details + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetails end - def notification_settings - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettings + def schedule_creation_parameter + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameter end - def shared_public_ip_address_configuration - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfiguration + def environment_deployment_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentPropertiesFragment end - def export_resource_usage_parameters - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExportResourceUsageParameters + def virtual_network_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkList end - def week_details_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetailsFragment + def subnet + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Subnet end - def external_subnet - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnet + def day_details_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetailsFragment end - def hour_details_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetailsFragment + def dtl_environment_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentList end - def week_details - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetails + def notification_settings_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettingsFragment end - def user_secret_store - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStore + def evaluate_policies_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesProperties end - def hour_details - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetails + def user_secret_store_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStoreFragment end - def artifact_parameter_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterProperties + def evaluate_policies_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesRequest end def artifact_install_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallProperties end - def response_with_continuation_lab - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab + def policy_violation + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyViolation end def parameters_value_file_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParametersValueFileInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParametersValueFileInfo end - def response_with_continuation_lab_virtual_machine - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVirtualMachine + def policy_set_result + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicySetResult end def arm_template_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateInfo end - def network_interface_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfaceProperties + def evaluate_policies_response + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesResponse + end + def arm_template_parameter_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterProperties end - def response_with_continuation_user - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationUser + def event + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Event end - def lab_virtual_machine_creation_parameter - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineCreationParameter + def user_secret_store + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStore + end + def event_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EventFragment end def artifact_deployment_status_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusPropertiesFragment end - def formula_properties_from_vm - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FormulaPropertiesFromVm + def export_resource_usage_parameters + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExportResourceUsageParameters end def artifact_install_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallPropertiesFragment end - def response_with_continuation_lab_vhd - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVhd + def external_subnet + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnet end - def subnet - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Subnet + def user_identity + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentity end - def user_secret_store_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStoreFragment + def external_subnet_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnetFragment + end + def artifact_source_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceList + end + def gallery_image_reference + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReference end def attach_new_data_disk_options - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachNewDataDiskOptions + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptions end - def gallery_image_reference_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReferenceFragment + def inbound_nat_rule + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRule end - def parameter_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParameterInfo + def bulk_creation_parameters + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParameters + end + def day_details + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetails + end + def notification_settings + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettings end def compute_data_disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDisk + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDisk end - def generate_arm_template_request - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateArmTemplateRequest + def shutdown_notification_content + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ShutdownNotificationContent end def compute_vm_instance_view_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatus end - def generate_upload_uri_parameter - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriParameter + def lab_virtual_machine_creation_parameter + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameter end def compute_vm_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmProperties end - def generate_upload_uri_response - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriResponse + def formula_properties_from_vm + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVm end def percentage_cost_threshold_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PercentageCostThresholdProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PercentageCostThresholdProperties end - def identity_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::IdentityProperties + def service_runner_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunnerList end def windows_os_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfo end - def inbound_nat_rule_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRuleFragment + def gallery_image_reference_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReferenceFragment end def custom_image_properties_from_vm - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesFromVm + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVm end - def user_identity_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentityFragment + def inbound_nat_rule_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRuleFragment end - def response_with_continuation_schedule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSchedule + def data_disk_storage_type_info + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfo end - def target_cost_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostProperties + def shared_public_ip_address_configuration_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfigurationFragment end - def detach_data_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDataDiskProperties + def subnet_override_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverrideFragment end - def lab_cost_summary_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostSummaryProperties + def network_interface_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfacePropertiesFragment end - def response_with_continuation_policy - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationPolicy + def linux_os_info_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfoFragment end - def lab_cost_details_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostDetailsProperties + def schedule_creation_parameter_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameterFragment end - def response_with_continuation_notification_channel - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationNotificationChannel + def custom_image_properties_custom_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustomFragment end - def lab_resource_cost_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabResourceCostProperties + def lab_virtual_machine_creation_parameter_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameterFragment end - def evaluate_policies_request - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesRequest + def custom_image_properties_from_plan_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlanFragment end - def subnet_override_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverrideFragment + def formula_properties_from_vm_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVmFragment end - def policy_set_result - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicySetResult + def custom_image_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageList end - def subnet_shared_public_ip_address_configuration_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfigurationFragment + def service_fabric_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricList end - def event - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Event + def data_disk_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskPropertiesFragment end - def lab_vhd - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVhd + def formula_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaList end - def day_details_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetailsFragment + def detach_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDiskProperties end - def subnet_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetFragment + def secret_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretList end - def user_identity - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentity + def subnet_shared_public_ip_address_configuration + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfiguration end - def shared_public_ip_address_configuration_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfigurationFragment + def gallery_image_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageList end - def response_with_continuation_service_runner - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationServiceRunner + def environment_deployment_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentProperties end - def network_interface_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfacePropertiesFragment + def parameter_info + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParameterInfo + end + def week_details_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetailsFragment + end + def generate_arm_template_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateArmTemplateRequest + end + def user_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserList + end + def generate_upload_uri_parameter + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriParameter + end + def apply_artifacts_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplyArtifactsRequest + end + def generate_upload_uri_response + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriResponse + end + def arm_template_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateList + end + def identity_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::IdentityProperties end def artifact_deployment_status_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusProperties end - def shutdown_notification_content - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ShutdownNotificationContent + def import_lab_virtual_machine_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ImportLabVirtualMachineRequest end - def response_with_continuation_secret - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSecret + def artifact_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactList end - def retarget_schedule_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::RetargetScheduleProperties + def lab_announcement_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementProperties end - def bulk_creation_parameters - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::BulkCreationParameters + def attach_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachDiskProperties + end + def lab_support_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportProperties end - def response_with_continuation_virtual_network - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationVirtualNetwork + def bulk_creation_parameters_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParametersFragment + end + def schedule_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList end def compute_data_disk_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDiskFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDiskFragment end - def notify_parameters - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotifyParameters + def lab_announcement_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementPropertiesFragment end def compute_vm_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmPropertiesFragment end - def operation_error - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationError + def target_cost_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostProperties end def linux_os_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfo end - def operation_metadata_display - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadataDisplay + def lab_cost_summary_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostSummaryProperties end - def data_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DataDiskProperties + def custom_image_properties_from_plan + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlan end - def operation_metadata - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadata + def lab_cost_details_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostDetailsProperties end - def environment_deployment_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnvironmentDeploymentProperties + def custom_image_properties_from_vm_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVmFragment end - def operation_result - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationResult + def lab_resource_cost_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabResourceCostProperties end - def policy_violation - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyViolation + def subnet_shared_public_ip_address_configuration_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfigurationFragment end - def subnet_override - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverride + def retarget_schedule_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RetargetScheduleProperties end - def event_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EventFragment + def detach_data_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDataDiskProperties end - def subnet_shared_public_ip_address_configuration - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfiguration + def lab_support_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportPropertiesFragment end - def apply_artifacts_request - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplyArtifactsRequest + def disk_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskList end - def port - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Port + def resource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Resource + end + def hour_details_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetailsFragment + end + def lab_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabList + end + def user_identity_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentityFragment + end + def lab_vhd + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhd end def artifact_parameter_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterPropertiesFragment end - def port_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PortFragment + def lab_vhd_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhdList end - def provider_operation_result - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ProviderOperationResult + def attach_new_data_disk_options_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptionsFragment end - def cost_threshold_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdProperties + def resize_lab_virtual_machine_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ResizeLabVirtualMachineProperties end - def resource - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Resource + def compute_vm_instance_view_status_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatusFragment end - def detach_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDiskProperties + def rdp_connection + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RdpConnection end - def response_with_continuation_arm_template - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArmTemplate + def custom_image_properties_custom + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustom end - def evaluate_policies_response - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesResponse + def lab_virtual_machine_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList end - def response_with_continuation_artifact - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifact + def data_disk_storage_type_info_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfoFragment end - def arm_template_parameter_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateParameterProperties + def provider_operation_result + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ProviderOperationResult end - def response_with_continuation_artifact_source - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifactSource + def subnet_override + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverride end - def compute_vm_instance_view_status_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatusFragment + def port_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PortFragment end - def response_with_continuation_custom_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationCustomImage + def artifact_parameter_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterProperties end - def evaluate_policies_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesProperties + def notification_channel_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelList end - def response_with_continuation_disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDisk + def update_resource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UpdateResource end - def attach_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachDiskProperties + def notify_parameters + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotifyParameters end - def response_with_continuation_dtl_environment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDtlEnvironment + def cost_threshold_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdProperties end - def notification_settings_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettingsFragment + def operation_error + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationError end - def response_with_continuation_formula - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationFormula + def data_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskProperties end - def custom_image_properties_custom - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesCustom + def operation_metadata_display + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadataDisplay end - def response_with_continuation_gallery_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationGalleryImage + def arm_template_parameter_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterPropertiesFragment + end + def operation_metadata + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadata + end + def windows_os_info_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfoFragment + end + def operation_result + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationResult + end + def port + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Port + end + def subnet_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetFragment + end + def policy_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyList end def schedule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Schedule + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule end def applicable_schedule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableSchedule + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule end def schedule_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ScheduleFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment end def applicable_schedule_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableScheduleFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableScheduleFragment end def arm_template - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplate + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplate end def artifact - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Artifact + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Artifact end def artifact_source - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource end def artifact_source_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSourceFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceFragment end def custom_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImage + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage + end + def custom_image_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageFragment end def disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Disk + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Disk + end + def disk_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskFragment end def dtl_environment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DtlEnvironment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment + end + def dtl_environment_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentFragment end def formula - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Formula + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Formula + end + def formula_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaFragment end def gallery_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImage + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImage end def lab - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Lab end def lab_cost - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCost + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost end def lab_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabFragment end def lab_virtual_machine - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine end def lab_virtual_machine_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineFragment end def notification_channel - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannel + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel end def notification_channel_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelFragment end def policy - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Policy + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Policy end def policy_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFragment end def secret - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Secret + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Secret + end + def secret_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretFragment + end + def service_fabric + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric + end + def service_fabric_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricFragment end def service_runner - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ServiceRunner + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner end def user - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::User - end - def virtual_network - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetwork + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::User end def user_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserFragment + end + def virtual_network + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork end def virtual_network_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetworkFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkFragment end def enable_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnableStatus - end - def notification_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnableStatus end def source_control_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SourceControlType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SourceControlType end def storage_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::StorageType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::StorageType end def cost_threshold_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdStatus end def windows_os_state - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsState + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsState end def linux_os_state - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsState + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsState end def custom_image_os_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImageOsType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageOsType end def host_caching_options - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HostCachingOptions + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HostCachingOptions end def notification_channel_event_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelEventType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelEventType end def transport_protocol - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TransportProtocol + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TransportProtocol end def virtual_machine_creation_source - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualMachineCreationSource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualMachineCreationSource end def file_upload_options - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FileUploadOptions + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FileUploadOptions end def premium_data_disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PremiumDataDisk + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PremiumDataDisk + end + def environment_permission + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentPermission end def target_cost_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostStatus end def reporting_cycle_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ReportingCycleType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ReportingCycleType end def cost_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostType end def http_status_code - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HttpStatusCode + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HttpStatusCode end def policy_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyStatus end def policy_fact_name - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFactName + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFactName end def policy_evaluator_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyEvaluatorType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyEvaluatorType end def usage_permission_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UsagePermissionType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UsagePermissionType end end end diff --git a/azure_sdk/lib/latest/modules/labservices_profile_module.rb b/azure_sdk/lib/latest/modules/labservices_profile_module.rb new file mode 100644 index 0000000000..ebde6d7c84 --- /dev/null +++ b/azure_sdk/lib/latest/modules/labservices_profile_module.rb @@ -0,0 +1,357 @@ +# 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 'azure_mgmt_labservices' + +module Azure::Profiles::Latest + module Labservices + module Mgmt + ProviderOperations = Azure::Labservices::Mgmt::V2018_10_15::ProviderOperations + GlobalUsers = Azure::Labservices::Mgmt::V2018_10_15::GlobalUsers + LabAccounts = Azure::Labservices::Mgmt::V2018_10_15::LabAccounts + Operations = Azure::Labservices::Mgmt::V2018_10_15::Operations + GalleryImages = Azure::Labservices::Mgmt::V2018_10_15::GalleryImages + Labs = Azure::Labservices::Mgmt::V2018_10_15::Labs + EnvironmentSettings = Azure::Labservices::Mgmt::V2018_10_15::EnvironmentSettings + Environments = Azure::Labservices::Mgmt::V2018_10_15::Environments + Users = Azure::Labservices::Mgmt::V2018_10_15::Users + + module Models + SizeAvailability = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeAvailability + RegionalAvailability = Azure::Labservices::Mgmt::V2018_10_15::Models::RegionalAvailability + GetRegionalAvailabilityResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::GetRegionalAvailabilityResponse + ReferenceVmCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmCreationParameters + AddUsersPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::AddUsersPayload + EnvironmentSettingCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingCreationParameters + CreateLabProperties = Azure::Labservices::Mgmt::V2018_10_15::Models::CreateLabProperties + ResourceSettingCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingCreationParameters + NetworkInterface = Azure::Labservices::Mgmt::V2018_10_15::Models::NetworkInterface + SizeConfigurationPropertiesFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationPropertiesFragment + LabCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::LabCreationParameters + ResourceSet = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSet + EnvironmentDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentDetails + LatestOperationResult = Azure::Labservices::Mgmt::V2018_10_15::Models::LatestOperationResult + ResponseWithContinuationGalleryImage = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationGalleryImage + RegisterPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::RegisterPayload + VmStateDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::VmStateDetails + SizeConfigurationProperties = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationProperties + ResourceSettings = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettings + ResponseWithContinuationUser = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationUser + ReferenceVmFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmFragment + ResponseWithContinuationLabAccount = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount + ResponseWithContinuationEnvironment = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment + LabDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::LabDetails + EnvironmentSize = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSize + ResponseWithContinuationLab = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLab + EnvironmentSizeFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSizeFragment + ListEnvironmentsPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsPayload + Resource = Azure::Labservices::Mgmt::V2018_10_15::Models::Resource + ListEnvironmentsResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsResponse + GalleryImageReferenceFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReferenceFragment + ListLabsResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::ListLabsResponse + GetPersonalPreferencesResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::GetPersonalPreferencesResponse + OperationBatchStatusPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusPayload + ResourceSetFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSetFragment + OperationBatchStatusResponseItem = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponseItem + ReferenceVm = Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVm + OperationBatchStatusResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponse + ResourceSettingsFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingsFragment + OperationError = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationError + SizeInfoFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfoFragment + OperationMetadataDisplay = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadataDisplay + ResetPasswordPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload + OperationMetadata = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadata + VirtualMachineDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::VirtualMachineDetails + OperationResult = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationResult + ResponseWithContinuationEnvironmentSetting = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting + OperationStatusPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusPayload + GalleryImageReference = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReference + OperationStatusResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusResponse + EnvironmentOperationsPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload + PersonalPreferencesOperationsPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::PersonalPreferencesOperationsPayload + GetEnvironmentResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::GetEnvironmentResponse + ProviderOperationResult = Azure::Labservices::Mgmt::V2018_10_15::Models::ProviderOperationResult + SizeInfo = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfo + PublishPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::PublishPayload + Environment = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment + EnvironmentFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment + EnvironmentSetting = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting + EnvironmentSettingFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingFragment + GalleryImage = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImage + GalleryImageFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageFragment + Lab = Azure::Labservices::Mgmt::V2018_10_15::Models::Lab + LabAccount = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount + LabAccountFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccountFragment + LabFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::LabFragment + User = Azure::Labservices::Mgmt::V2018_10_15::Models::User + UserFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::UserFragment + ManagedLabVmSize = Azure::Labservices::Mgmt::V2018_10_15::Models::ManagedLabVmSize + PublishingState = Azure::Labservices::Mgmt::V2018_10_15::Models::PublishingState + ConfigurationState = Azure::Labservices::Mgmt::V2018_10_15::Models::ConfigurationState + LabUserAccessMode = Azure::Labservices::Mgmt::V2018_10_15::Models::LabUserAccessMode + AddRemove = Azure::Labservices::Mgmt::V2018_10_15::Models::AddRemove + end + + class LabservicesManagementClass + attr_reader :provider_operations, :global_users, :lab_accounts, :operations, :gallery_images, :labs, :environment_settings, :environments, :users, :configurable, :base_url, :options, :model_classes + + def initialize(configurable, base_url=nil, options=nil) + @configurable, @base_url, @options = configurable, base_url, options + + @client_0 = Azure::Labservices::Mgmt::V2018_10_15::ManagedLabsClient.new(configurable.credentials, base_url, options) + if(@client_0.respond_to?(:subscription_id)) + @client_0.subscription_id = configurable.subscription_id + end + add_telemetry(@client_0) + @provider_operations = @client_0.provider_operations + @global_users = @client_0.global_users + @lab_accounts = @client_0.lab_accounts + @operations = @client_0.operations + @gallery_images = @client_0.gallery_images + @labs = @client_0.labs + @environment_settings = @client_0.environment_settings + @environments = @client_0.environments + @users = @client_0.users + + @model_classes = ModelClasses.new + end + + def add_telemetry(client) + profile_information = "Profiles/azure_sdk/#{Azure::VERSION}/Latest/Labservices/Mgmt" + client.add_user_agent_information(profile_information) + end + + def method_missing(method, *args) + if @client_0.respond_to?method + @client_0.send(method, *args) + else + super + end + end + + class ModelClasses + def size_availability + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeAvailability + end + def regional_availability + Azure::Labservices::Mgmt::V2018_10_15::Models::RegionalAvailability + end + def get_regional_availability_response + Azure::Labservices::Mgmt::V2018_10_15::Models::GetRegionalAvailabilityResponse + end + def reference_vm_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmCreationParameters + end + def add_users_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::AddUsersPayload + end + def environment_setting_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingCreationParameters + end + def create_lab_properties + Azure::Labservices::Mgmt::V2018_10_15::Models::CreateLabProperties + end + def resource_setting_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingCreationParameters + end + def network_interface + Azure::Labservices::Mgmt::V2018_10_15::Models::NetworkInterface + end + def size_configuration_properties_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationPropertiesFragment + end + def lab_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::LabCreationParameters + end + def resource_set + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSet + end + def environment_details + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentDetails + end + def latest_operation_result + Azure::Labservices::Mgmt::V2018_10_15::Models::LatestOperationResult + end + def response_with_continuation_gallery_image + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationGalleryImage + end + def register_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::RegisterPayload + end + def vm_state_details + Azure::Labservices::Mgmt::V2018_10_15::Models::VmStateDetails + end + def size_configuration_properties + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationProperties + end + def resource_settings + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettings + end + def response_with_continuation_user + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationUser + end + def reference_vm_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmFragment + end + def response_with_continuation_lab_account + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount + end + def response_with_continuation_environment + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment + end + def lab_details + Azure::Labservices::Mgmt::V2018_10_15::Models::LabDetails + end + def environment_size + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSize + end + def response_with_continuation_lab + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLab + end + def environment_size_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSizeFragment + end + def list_environments_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsPayload + end + def resource + Azure::Labservices::Mgmt::V2018_10_15::Models::Resource + end + def list_environments_response + Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsResponse + end + def gallery_image_reference_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReferenceFragment + end + def list_labs_response + Azure::Labservices::Mgmt::V2018_10_15::Models::ListLabsResponse + end + def get_personal_preferences_response + Azure::Labservices::Mgmt::V2018_10_15::Models::GetPersonalPreferencesResponse + end + def operation_batch_status_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusPayload + end + def resource_set_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSetFragment + end + def operation_batch_status_response_item + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponseItem + end + def reference_vm + Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVm + end + def operation_batch_status_response + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponse + end + def resource_settings_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingsFragment + end + def operation_error + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationError + end + def size_info_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfoFragment + end + def operation_metadata_display + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadataDisplay + end + def reset_password_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload + end + def operation_metadata + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadata + end + def virtual_machine_details + Azure::Labservices::Mgmt::V2018_10_15::Models::VirtualMachineDetails + end + def operation_result + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationResult + end + def response_with_continuation_environment_setting + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting + end + def operation_status_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusPayload + end + def gallery_image_reference + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReference + end + def operation_status_response + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusResponse + end + def environment_operations_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload + end + def personal_preferences_operations_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::PersonalPreferencesOperationsPayload + end + def get_environment_response + Azure::Labservices::Mgmt::V2018_10_15::Models::GetEnvironmentResponse + end + def provider_operation_result + Azure::Labservices::Mgmt::V2018_10_15::Models::ProviderOperationResult + end + def size_info + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfo + end + def publish_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::PublishPayload + end + def environment + Azure::Labservices::Mgmt::V2018_10_15::Models::Environment + end + def environment_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment + end + def environment_setting + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting + end + def environment_setting_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingFragment + end + def gallery_image + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImage + end + def gallery_image_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageFragment + end + def lab + Azure::Labservices::Mgmt::V2018_10_15::Models::Lab + end + def lab_account + Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount + end + def lab_account_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccountFragment + end + def lab_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::LabFragment + end + def user + Azure::Labservices::Mgmt::V2018_10_15::Models::User + end + def user_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::UserFragment + end + def managed_lab_vm_size + Azure::Labservices::Mgmt::V2018_10_15::Models::ManagedLabVmSize + end + def publishing_state + Azure::Labservices::Mgmt::V2018_10_15::Models::PublishingState + end + def configuration_state + Azure::Labservices::Mgmt::V2018_10_15::Models::ConfigurationState + end + def lab_user_access_mode + Azure::Labservices::Mgmt::V2018_10_15::Models::LabUserAccessMode + end + def add_remove + Azure::Labservices::Mgmt::V2018_10_15::Models::AddRemove + end + end + end + end + end +end diff --git a/config/GEMS_TO_RELEASE b/config/GEMS_TO_RELEASE index a7a5e1b701..fa95caa3e1 100644 --- a/config/GEMS_TO_RELEASE +++ b/config/GEMS_TO_RELEASE @@ -1,6 +1,11 @@ { "management": [ - "azure_mgmt_network" + "azure_mgmt_devtestlabs", + "azure_mgmt_hdinsight", + "azure_mgmt_labservices" + ], + "data": [ + "azure_cognitiveservices_computervision" ], "rollup": [ "azure_sdk" diff --git a/config/GEM_VERSIONS b/config/GEM_VERSIONS index 44c5c86e65..90d9562522 100644 --- a/config/GEM_VERSIONS +++ b/config/GEM_VERSIONS @@ -1,12 +1,11 @@ - { "rollup": { - "azure_sdk": "0.21.1" + "azure_sdk": "0.22.0" }, "data": { "azure_cognitiveservices_autosuggest": "0.17.0", "azure_cognitiveservices_customimagesearch": "0.17.0", - "azure_cognitiveservices_computervision": "0.17.0", + "azure_cognitiveservices_computervision": "0.18.0", "azure_cognitiveservices_contentmoderator": "0.17.1", "azure_cognitiveservices_customsearch": "0.18.0", "azure_cognitiveservices_customvisiontraining": "0.17.0", @@ -47,16 +46,17 @@ "azure_mgmt_datalake_store": "0.17.1", "azure_mgmt_data_migration": "0.17.0", "azure_mgmt_dev_spaces": "0.17.1", - "azure_mgmt_devtestlabs": "0.17.1", + "azure_mgmt_devtestlabs": "0.17.2", "azure_mgmt_dns": "0.17.2", "azure_mgmt_event_grid": "0.17.3", "azure_mgmt_event_hub": "0.17.1", "azure_mgmt_features": "0.17.1", - "azure_mgmt_hdinsight": "0.17.0", + "azure_mgmt_hdinsight": "0.17.1", "azure_mgmt_iot_central": "0.17.2", "azure_mgmt_iot_hub": "0.17.1", "azure_mgmt_key_vault": "0.17.2", "azure_mgmt_kusto": "0.17.0", + "azure_mgmt_labservices": "0.17.0", "azure_mgmt_links": "0.17.1", "azure_mgmt_locks": "0.17.1", "azure_mgmt_logic": "0.18.0", diff --git a/config/config.json b/config/config.json index 20b6753259..b39281c36a 100644 --- a/config/config.json +++ b/config/config.json @@ -457,8 +457,13 @@ } }, "azure_mgmt_devtestlabs": { + "azure_mgmt_devtestlabs_2018_09_15": { + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/devtestlabs/resource-manager/readme.md", + "namespace": "Azure::DevTestLabs::Mgmt::V2018_09_15", + "tag": "package-2018-09" + }, "azure_mgmt_devtestlabs_2016_05_15": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/devtestlabs/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/devtestlabs/resource-manager/readme.md", "namespace": "Azure::DevTestLabs::Mgmt::V2016_05_15", "tag": "package-2016-05" } @@ -543,12 +548,12 @@ }, "azure_mgmt_hdinsight": { "azure_mgmt_hdinsight_2015_03_01_preview": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/hdinsight/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/hdinsight/resource-manager/readme.md", "namespace": "Azure::Hdinsight::Mgmt::V2015_03_01_preview", "tag": "package-2015-03-preview" }, "azure_mgmt_hdinsight_2018_06_01_preview": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/hdinsight/resource-manager/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/hdinsight/resource-manager/readme.md", "namespace": "Azure::Hdinsight::Mgmt::V2018_06_01_preview", "tag": "package-2018-06-preview" } @@ -629,6 +634,13 @@ "tag": "package-2017-09-07-privatepreview" } }, + "azure_mgmt_labservices": { + "azure_mgmt_labservices_2018_10_15": { + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/labservices/resource-manager/readme.md", + "namespace": "Azure::Labservices::Mgmt::V2018_10_15", + "tag": "package-2018-10" + } + }, "azure_mgmt_links": { "azure_mgmt_links_2016_09_01": { "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/491ba55793f6483a3d9f0464b5faa2b6959fafa1/specification/resources/resource-manager/readme.md", @@ -1589,14 +1601,14 @@ }, "azure_cognitiveservices_computervision":{ "azure_cognitiveservices_computervision_v2.0": { - "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/cognitiveservices/data-plane/ComputerVision/readme.md", + "markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/cognitiveservices/data-plane/ComputerVision/readme.md", "namespace": "Azure::CognitiveServices::ComputerVision::V2_0", "title": "ComputerVisionClient", "tag": "release_2_0" }, "azure_cognitiveservices_computervision_v1.0": { "input-file": [ - "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/cognitiveservices/data-plane/ComputerVision/stable/v1.0/ComputerVision.json" + "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/cognitiveservices/data-plane/ComputerVision/stable/v1.0/ComputerVision.json" ], "namespace": "Azure::CognitiveServices::ComputerVision::V1_0", "title": "ComputerVisionClient" diff --git a/config/dir_metadata.json b/config/dir_metadata.json index 7a003e65d8..9090007d50 100644 --- a/config/dir_metadata.json +++ b/config/dir_metadata.json @@ -226,6 +226,13 @@ "module_require": "azure_mgmt_kusto" } }, + "Microsoft.Labservices": { + "management": { + "path": "management/azure_mgmt_labservices", + "namespace": "Azure::Labservices::Mgmt", + "module_require": "azure_mgmt_labservices" + } + }, "Microsoft.Links": { "management": { "path": "management/azure_mgmt_links", diff --git a/config/profiles.json b/config/profiles.json index ff0b51c7fe..8c655ba2c7 100644 --- a/config/profiles.json +++ b/config/profiles.json @@ -247,7 +247,7 @@ }, "Microsoft.DevTestLabs": { "management": { - "2016-05-15": ["*"] + "2018-09-15": ["*"] } }, "Microsoft.Dns": { @@ -306,6 +306,11 @@ "2018-09-07-preview": ["*"] } }, + "Microsoft.Labservices": { + "management": { + "2018-10-15": ["*"] + } + }, "Microsoft.Links": { "management": { "2016-09-01": ["*"] @@ -923,7 +928,7 @@ "resourceTypes": { "Microsoft.DevTestLabs" : { "management": { - "2016-05-15": ["*"] + "2018-09-15": ["*"] } } }, @@ -1131,6 +1136,20 @@ "individual_gem_profile": true } ], + "azure_mgmt_labservices": [ + { + "name": "Latest", + "resourceTypes": { + "Microsoft.Labservices": { + "management": { + "2018-10-15": ["*"] + } + } + }, + "output_dir": "management/azure_mgmt_labservices/lib/profiles", + "individual_gem_profile": true + } + ], "azure_mgmt_links": [ { "name": "V2017_03_09", diff --git a/data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb b/data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb index 971a35d1fb..15561ccac0 100644 --- a/data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb +++ b/data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb @@ -2254,7 +2254,7 @@ def recognize_text_in_stream_async(image, detect_handwriting:false, custom_heade # def add_telemetry sdk_information = 'azure_cognitiveservices_computervision' - sdk_information = "#{sdk_information}/0.17.0" + sdk_information = "#{sdk_information}/0.18.0" add_user_agent_information(sdk_information) end end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision.rb index 013d9f3a29..669383c8ad 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision.rb @@ -23,42 +23,46 @@ module Azure::CognitiveServices::ComputerVision::V2_0 autoload :ComputerVisionClient, '2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb' module Models - autoload :FaceDescription, '2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb' - autoload :ImageMetadata, '2.0/generated/azure_cognitiveservices_computervision/models/image_metadata.rb' - autoload :Line, '2.0/generated/azure_cognitiveservices_computervision/models/line.rb' - autoload :ImageAnalysis, '2.0/generated/azure_cognitiveservices_computervision/models/image_analysis.rb' - autoload :TextOperationResult, '2.0/generated/azure_cognitiveservices_computervision/models/text_operation_result.rb' + autoload :DetectResult, '2.0/generated/azure_cognitiveservices_computervision/models/detect_result.rb' + autoload :FaceRectangle, '2.0/generated/azure_cognitiveservices_computervision/models/face_rectangle.rb' + autoload :ModelDescription, '2.0/generated/azure_cognitiveservices_computervision/models/model_description.rb' + autoload :LandmarksModel, '2.0/generated/azure_cognitiveservices_computervision/models/landmarks_model.rb' + autoload :ListModelsResult, '2.0/generated/azure_cognitiveservices_computervision/models/list_models_result.rb' + autoload :Category, '2.0/generated/azure_cognitiveservices_computervision/models/category.rb' + autoload :DomainModelResults, '2.0/generated/azure_cognitiveservices_computervision/models/domain_model_results.rb' + autoload :ColorInfo, '2.0/generated/azure_cognitiveservices_computervision/models/color_info.rb' autoload :OcrWord, '2.0/generated/azure_cognitiveservices_computervision/models/ocr_word.rb' - autoload :CelebritiesModel, '2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb' + autoload :ImageTag, '2.0/generated/azure_cognitiveservices_computervision/models/image_tag.rb' autoload :OcrLine, '2.0/generated/azure_cognitiveservices_computervision/models/ocr_line.rb' - autoload :CategoryDetail, '2.0/generated/azure_cognitiveservices_computervision/models/category_detail.rb' + autoload :ImageDescriptionDetails, '2.0/generated/azure_cognitiveservices_computervision/models/image_description_details.rb' autoload :OcrRegion, '2.0/generated/azure_cognitiveservices_computervision/models/ocr_region.rb' - autoload :AdultInfo, '2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb' + autoload :BoundingRect, '2.0/generated/azure_cognitiveservices_computervision/models/bounding_rect.rb' autoload :OcrResult, '2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb' - autoload :ImageType, '2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb' - autoload :ModelDescription, '2.0/generated/azure_cognitiveservices_computervision/models/model_description.rb' + autoload :DetectedObject, '2.0/generated/azure_cognitiveservices_computervision/models/detected_object.rb' + autoload :TagResult, '2.0/generated/azure_cognitiveservices_computervision/models/tag_result.rb' + autoload :ImageAnalysis, '2.0/generated/azure_cognitiveservices_computervision/models/image_analysis.rb' + autoload :AreaOfInterestResult, '2.0/generated/azure_cognitiveservices_computervision/models/area_of_interest_result.rb' + autoload :CelebritiesModel, '2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb' + autoload :ImageUrl, '2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb' + autoload :AdultInfo, '2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb' + autoload :ComputerVisionError, '2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb' autoload :ImageCaption, '2.0/generated/azure_cognitiveservices_computervision/models/image_caption.rb' - autoload :ListModelsResult, '2.0/generated/azure_cognitiveservices_computervision/models/list_models_result.rb' - autoload :Word, '2.0/generated/azure_cognitiveservices_computervision/models/word.rb' - autoload :DomainModelResults, '2.0/generated/azure_cognitiveservices_computervision/models/domain_model_results.rb' - autoload :FaceRectangle, '2.0/generated/azure_cognitiveservices_computervision/models/face_rectangle.rb' - autoload :CelebrityResults, '2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb' - autoload :Category, '2.0/generated/azure_cognitiveservices_computervision/models/category.rb' autoload :LandmarkResults, '2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.rb' - autoload :ImageTag, '2.0/generated/azure_cognitiveservices_computervision/models/image_tag.rb' + autoload :ObjectHierarchy, '2.0/generated/azure_cognitiveservices_computervision/models/object_hierarchy.rb' + autoload :CelebrityResults, '2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb' autoload :ImageDescription, '2.0/generated/azure_cognitiveservices_computervision/models/image_description.rb' + autoload :Word, '2.0/generated/azure_cognitiveservices_computervision/models/word.rb' + autoload :ImageType, '2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb' + autoload :Line, '2.0/generated/azure_cognitiveservices_computervision/models/line.rb' + autoload :ImageMetadata, '2.0/generated/azure_cognitiveservices_computervision/models/image_metadata.rb' autoload :RecognitionResult, '2.0/generated/azure_cognitiveservices_computervision/models/recognition_result.rb' - autoload :TagResult, '2.0/generated/azure_cognitiveservices_computervision/models/tag_result.rb' - autoload :ColorInfo, '2.0/generated/azure_cognitiveservices_computervision/models/color_info.rb' - autoload :ComputerVisionError, '2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb' - autoload :LandmarksModel, '2.0/generated/azure_cognitiveservices_computervision/models/landmarks_model.rb' - autoload :ImageUrl, '2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb' - autoload :ImageDescriptionDetails, '2.0/generated/azure_cognitiveservices_computervision/models/image_description_details.rb' - autoload :TextOperationStatusCodes, '2.0/generated/azure_cognitiveservices_computervision/models/text_operation_status_codes.rb' + autoload :FaceDescription, '2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb' + autoload :TextOperationResult, '2.0/generated/azure_cognitiveservices_computervision/models/text_operation_result.rb' + autoload :CategoryDetail, '2.0/generated/azure_cognitiveservices_computervision/models/category_detail.rb' autoload :Gender, '2.0/generated/azure_cognitiveservices_computervision/models/gender.rb' - autoload :ComputerVisionErrorCodes, '2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error_codes.rb' - autoload :VisualFeatureTypes, '2.0/generated/azure_cognitiveservices_computervision/models/visual_feature_types.rb' + autoload :TextOperationStatusCodes, '2.0/generated/azure_cognitiveservices_computervision/models/text_operation_status_codes.rb' autoload :OcrLanguages, '2.0/generated/azure_cognitiveservices_computervision/models/ocr_languages.rb' + autoload :VisualFeatureTypes, '2.0/generated/azure_cognitiveservices_computervision/models/visual_feature_types.rb' autoload :TextRecognitionMode, '2.0/generated/azure_cognitiveservices_computervision/models/text_recognition_mode.rb' autoload :Details, '2.0/generated/azure_cognitiveservices_computervision/models/details.rb' end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb index d49452de12..985d78eaea 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb @@ -17,7 +17,7 @@ class ComputerVisionClient < MsRestAzure::AzureServiceClient # @return Credentials needed for the client to connect to Azure. attr_reader :credentials1 - # @return [String] Supported Cognitive Services endpoints + # @return [String] Supported Cognitive Services endpoints. attr_accessor :endpoint # @return Subscription credentials which uniquely identify client @@ -113,53 +113,139 @@ def make_request_async(method, path, options = {}) end # - # This operation returns the list of domain-specific models that are supported - # by the Computer Vision API. Currently, the API only supports one - # domain-specific model: a celebrity recognizer. A successful response will be - # returned in JSON. If the request failed, the response will contain an error - # code and a message to help understand what went wrong. - # + # This operation extracts a rich set of visual features based on the image + # content. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. Within your request, there is an optional parameter to allow + # you to choose which features to return. By default, image categories are + # returned in the response. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param visual_features [Array] A string indicating what + # visual feature types to return. Multiple values should be comma-separated. + # Valid visual feature types include: Categories - categorizes image content + # according to a taxonomy defined in documentation. Tags - tags the image with + # a detailed list of words related to the image content. Description - + # describes the image content with a complete English sentence. Faces - detects + # if faces are present. If present, generate coordinates, gender and age. + # ImageType - detects if image is clipart or a line drawing. Color - determines + # the accent color, dominant color, and whether an image is black&white. Adult + # - detects if the image is pornographic in nature (depicts nudity or a sex + # act). Sexually suggestive content is also detected. Objects - detects + # various objects within an image, including the approximate location. The + # Objects argument is only available in English. + # @param details [Array
] A string indicating which domain-specific + # details to return. Multiple values should be comma-separated. Valid visual + # feature types include: Celebrities - identifies celebrities if detected in + # the image, Landmarks - identifies notable landmarks in the image. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ListModelsResult] operation results. + # @return [ImageAnalysis] operation results. # - def list_models(custom_headers:nil) - response = list_models_async(custom_headers:custom_headers).value! + def analyze_image(url, visual_features:nil, details:nil, language:nil, custom_headers:nil) + response = analyze_image_async(url, visual_features:visual_features, details:details, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation returns the list of domain-specific models that are supported - # by the Computer Vision API. Currently, the API only supports one - # domain-specific model: a celebrity recognizer. A successful response will be - # returned in JSON. If the request failed, the response will contain an error - # code and a message to help understand what went wrong. - # + # This operation extracts a rich set of visual features based on the image + # content. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. Within your request, there is an optional parameter to allow + # you to choose which features to return. By default, image categories are + # returned in the response. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param visual_features [Array] A string indicating what + # visual feature types to return. Multiple values should be comma-separated. + # Valid visual feature types include: Categories - categorizes image content + # according to a taxonomy defined in documentation. Tags - tags the image with + # a detailed list of words related to the image content. Description - + # describes the image content with a complete English sentence. Faces - detects + # if faces are present. If present, generate coordinates, gender and age. + # ImageType - detects if image is clipart or a line drawing. Color - determines + # the accent color, dominant color, and whether an image is black&white. Adult + # - detects if the image is pornographic in nature (depicts nudity or a sex + # act). Sexually suggestive content is also detected. Objects - detects + # various objects within an image, including the approximate location. The + # Objects argument is only available in English. + # @param details [Array
] A string indicating which domain-specific + # details to return. Multiple values should be comma-separated. Valid visual + # feature types include: Celebrities - identifies celebrities if detected in + # the image, Landmarks - identifies notable landmarks in the image. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' # @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_models_with_http_info(custom_headers:nil) - list_models_async(custom_headers:custom_headers).value! + def analyze_image_with_http_info(url, visual_features:nil, details:nil, language:nil, custom_headers:nil) + analyze_image_async(url, visual_features:visual_features, details:details, language:language, custom_headers:custom_headers).value! end # - # This operation returns the list of domain-specific models that are supported - # by the Computer Vision API. Currently, the API only supports one - # domain-specific model: a celebrity recognizer. A successful response will be - # returned in JSON. If the request failed, the response will contain an error - # code and a message to help understand what went wrong. - # + # This operation extracts a rich set of visual features based on the image + # content. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. Within your request, there is an optional parameter to allow + # you to choose which features to return. By default, image categories are + # returned in the response. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param visual_features [Array] A string indicating what + # visual feature types to return. Multiple values should be comma-separated. + # Valid visual feature types include: Categories - categorizes image content + # according to a taxonomy defined in documentation. Tags - tags the image with + # a detailed list of words related to the image content. Description - + # describes the image content with a complete English sentence. Faces - detects + # if faces are present. If present, generate coordinates, gender and age. + # ImageType - detects if image is clipart or a line drawing. Color - determines + # the accent color, dominant color, and whether an image is black&white. Adult + # - detects if the image is pornographic in nature (depicts nudity or a sex + # act). Sexually suggestive content is also detected. Objects - detects + # various objects within an image, including the approximate location. The + # Objects argument is only available in English. + # @param details [Array
] A string indicating which domain-specific + # details to return. Multiple values should be comma-separated. Valid visual + # feature types include: Celebrities - identifies celebrities if detected in + # the image, Landmarks - identifies notable landmarks in the image. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' # @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_models_async(custom_headers:nil) + def analyze_image_async(url, visual_features:nil, details:nil, language:nil, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'url is nil' if url.nil? + image_url = ImageUrl.new + unless url.nil? + image_url.url = url + end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' @@ -167,17 +253,25 @@ def list_models_async(custom_headers:nil) # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? - path_template = 'models' + + # Serialize Request + request_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl.mapper() + request_content = self.serialize(request_mapper, image_url) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'analyze' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'visualFeatures' => visual_features.nil? ? nil : visual_features.join(','),'details' => details.nil? ? nil : details.join(','),'language' => language}, + body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } - promise = self.make_request_async(:get, path_template, options) + promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response @@ -193,7 +287,7 @@ def list_models_async(custom_headers:nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -207,28 +301,20 @@ def list_models_async(custom_headers:nil) end # - # This operation extracts a rich set of visual features based on the image - # content. Two input methods are supported -- (1) Uploading an image or (2) - # specifying an image URL. Within your request, there is an optional parameter - # to allow you to choose which features to return. By default, image - # categories are returned in the response. - # - # @param url [String] Publicly reachable URL of an image - # @param visual_features [Array] A string indicating what - # visual feature types to return. Multiple values should be comma-separated. - # Valid visual feature types include:Categories - categorizes image content - # according to a taxonomy defined in documentation. Tags - tags the image with - # a detailed list of words related to the image content. Description - - # describes the image content with a complete English sentence. Faces - detects - # if faces are present. If present, generate coordinates, gender and age. - # ImageType - detects if image is clipart or a line drawing. Color - determines - # the accent color, dominant color, and whether an image is black&white.Adult - - # detects if the image is pornographic in nature (depicts nudity or a sex act). - # Sexually suggestive content is also detected. - # @param details [Array
] A string indicating which domain-specific - # details to return. Multiple values should be comma-separated. Valid visual - # feature types include:Celebrities - identifies celebrities if detected in the - # image. + # This operation generates a description of an image in human readable language + # with complete sentences. The description is based on a collection of content + # tags, which are also returned by the operation. More than one description can + # be generated for each image. Descriptions are ordered by their confidence + # score. All descriptions are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param max_candidates [Integer] Maximum number of candidate descriptions to + # be returned. The default is 1. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -237,36 +323,28 @@ def list_models_async(custom_headers:nil) # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImageAnalysis] operation results. + # @return [ImageDescription] operation results. # - def analyze_image(url, visual_features:nil, details:nil, language:nil, custom_headers:nil) - response = analyze_image_async(url, visual_features:visual_features, details:details, language:language, custom_headers:custom_headers).value! + def describe_image(url, max_candidates:1, language:nil, custom_headers:nil) + response = describe_image_async(url, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation extracts a rich set of visual features based on the image - # content. Two input methods are supported -- (1) Uploading an image or (2) - # specifying an image URL. Within your request, there is an optional parameter - # to allow you to choose which features to return. By default, image - # categories are returned in the response. - # - # @param url [String] Publicly reachable URL of an image - # @param visual_features [Array] A string indicating what - # visual feature types to return. Multiple values should be comma-separated. - # Valid visual feature types include:Categories - categorizes image content - # according to a taxonomy defined in documentation. Tags - tags the image with - # a detailed list of words related to the image content. Description - - # describes the image content with a complete English sentence. Faces - detects - # if faces are present. If present, generate coordinates, gender and age. - # ImageType - detects if image is clipart or a line drawing. Color - determines - # the accent color, dominant color, and whether an image is black&white.Adult - - # detects if the image is pornographic in nature (depicts nudity or a sex act). - # Sexually suggestive content is also detected. - # @param details [Array
] A string indicating which domain-specific - # details to return. Multiple values should be comma-separated. Valid visual - # feature types include:Celebrities - identifies celebrities if detected in the - # image. + # This operation generates a description of an image in human readable language + # with complete sentences. The description is based on a collection of content + # tags, which are also returned by the operation. More than one description can + # be generated for each image. Descriptions are ordered by their confidence + # score. All descriptions are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param max_candidates [Integer] Maximum number of candidate descriptions to + # be returned. The default is 1. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -277,33 +355,25 @@ def analyze_image(url, visual_features:nil, details:nil, language:nil, custom_he # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def analyze_image_with_http_info(url, visual_features:nil, details:nil, language:nil, custom_headers:nil) - analyze_image_async(url, visual_features:visual_features, details:details, language:language, custom_headers:custom_headers).value! + def describe_image_with_http_info(url, max_candidates:1, language:nil, custom_headers:nil) + describe_image_async(url, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! end # - # This operation extracts a rich set of visual features based on the image - # content. Two input methods are supported -- (1) Uploading an image or (2) - # specifying an image URL. Within your request, there is an optional parameter - # to allow you to choose which features to return. By default, image - # categories are returned in the response. - # - # @param url [String] Publicly reachable URL of an image - # @param visual_features [Array] A string indicating what - # visual feature types to return. Multiple values should be comma-separated. - # Valid visual feature types include:Categories - categorizes image content - # according to a taxonomy defined in documentation. Tags - tags the image with - # a detailed list of words related to the image content. Description - - # describes the image content with a complete English sentence. Faces - detects - # if faces are present. If present, generate coordinates, gender and age. - # ImageType - detects if image is clipart or a line drawing. Color - determines - # the accent color, dominant color, and whether an image is black&white.Adult - - # detects if the image is pornographic in nature (depicts nudity or a sex act). - # Sexually suggestive content is also detected. - # @param details [Array
] A string indicating which domain-specific - # details to return. Multiple values should be comma-separated. Valid visual - # feature types include:Celebrities - identifies celebrities if detected in the - # image. + # This operation generates a description of an image in human readable language + # with complete sentences. The description is based on a collection of content + # tags, which are also returned by the operation. More than one description can + # be generated for each image. Descriptions are ordered by their confidence + # score. All descriptions are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param max_candidates [Integer] Maximum number of candidate descriptions to + # be returned. The default is 1. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -314,14 +384,231 @@ def analyze_image_with_http_info(url, visual_features:nil, details:nil, language # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def analyze_image_async(url, visual_features:nil, details:nil, language:nil, custom_headers:nil) + def describe_image_async(url, max_candidates:1, language:nil, custom_headers:nil) + fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'url is nil' if url.nil? + + image_url = ImageUrl.new + unless url.nil? + image_url.url = url + end + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = accept_language unless accept_language.nil? + + # Serialize Request + request_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl.mapper() + request_content = self.serialize(request_mapper, image_url) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'describe' + + request_url = @base_url || self.base_url + request_url = request_url.gsub('{Endpoint}', endpoint) + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'maxCandidates' => max_candidates,'language' => language}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = self.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 MsRest::HttpOperationError.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::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription.mapper() + result.body = self.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 + + # + # Performs object detection on the specified image. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DetectResult] operation results. + # + def detect_objects(url, custom_headers:nil) + response = detect_objects_async(url, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Performs object detection on the specified image. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @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 detect_objects_with_http_info(url, custom_headers:nil) + detect_objects_async(url, custom_headers:custom_headers).value! + end + + # + # Performs object detection on the specified image. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. + # @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 detect_objects_async(url, custom_headers:nil) + fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'url is nil' if url.nil? + + image_url = ImageUrl.new + unless url.nil? + image_url.url = url + end + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = accept_language unless accept_language.nil? + + # Serialize Request + request_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl.mapper() + request_content = self.serialize(request_mapper, image_url) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'detect' + + request_url = @base_url || self.base_url + request_url = request_url.gsub('{Endpoint}', endpoint) + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = self.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 MsRest::HttpOperationError.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::CognitiveServices::ComputerVision::V2_0::Models::DetectResult.mapper() + result.body = self.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 + + # + # This operation returns the list of domain-specific models that are supported + # by the Computer Vision API. Currently, the API supports following + # domain-specific models: celebrity recognizer, landmark recognizer. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ListModelsResult] operation results. + # + def list_models(custom_headers:nil) + response = list_models_async(custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # This operation returns the list of domain-specific models that are supported + # by the Computer Vision API. Currently, the API supports following + # domain-specific models: celebrity recognizer, landmark recognizer. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @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_models_with_http_info(custom_headers:nil) + list_models_async(custom_headers:custom_headers).value! + end + + # + # This operation returns the list of domain-specific models that are supported + # by the Computer Vision API. Currently, the API supports following + # domain-specific models: celebrity recognizer, landmark recognizer. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @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_models_async(custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? - fail ArgumentError, 'url is nil' if url.nil? - image_url = ImageUrl.new - unless url.nil? - image_url.url = url - end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' @@ -329,25 +616,17 @@ def analyze_image_async(url, visual_features:nil, details:nil, language:nil, cus # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? - - # Serialize Request - request_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl.mapper() - request_content = self.serialize(request_mapper, image_url) - request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - - path_template = 'analyze' + path_template = 'models' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'visualFeatures' => visual_features.nil? ? nil : visual_features.join(','),'details' => details.nil? ? nil : details.join(','),'language' => language}, - body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } - promise = self.make_request_async(:post, path_template, options) + promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response @@ -363,7 +642,7 @@ def analyze_image_async(url, visual_features:nil, details:nil, language:nil, cus if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -377,82 +656,89 @@ def analyze_image_async(url, visual_features:nil, details:nil, language:nil, cus end # - # This operation generates a thumbnail image with the user-specified width and - # height. By default, the service analyzes the image, identifies the region of - # interest (ROI), and generates smart cropping coordinates based on the ROI. - # Smart cropping helps when you specify an aspect ratio that differs from that - # of the input image. A successful response contains the thumbnail image - # binary. If the request failed, the response contains an error code and a - # message to help determine what went wrong. - # - # @param width [Integer] Width of the thumbnail. It must be between 1 and 1024. - # Recommended minimum of 50. - # @param height [Integer] Height of the thumbnail. It must be between 1 and - # 1024. Recommended minimum of 50. - # @param url [String] Publicly reachable URL of an image - # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. + # This operation recognizes content within an image by applying a + # domain-specific model. The list of domain-specific models that are supported + # by the Computer Vision API can be retrieved using the /models GET request. + # Currently, the API provides following domain-specific models: celebrities, + # landmarks. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. + # If the request failed, the response will contain an error code and a message + # to help understand what went wrong. + # + # @param model [String] The domain-specific content to recognize. + # @param url [String] Publicly reachable URL of an image. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [NOT_IMPLEMENTED] operation results. + # @return [DomainModelResults] operation results. # - def generate_thumbnail(width, height, url, smart_cropping:false, custom_headers:nil) - response = generate_thumbnail_async(width, height, url, smart_cropping:smart_cropping, custom_headers:custom_headers).value! + def analyze_image_by_domain(model, url, language:nil, custom_headers:nil) + response = analyze_image_by_domain_async(model, url, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation generates a thumbnail image with the user-specified width and - # height. By default, the service analyzes the image, identifies the region of - # interest (ROI), and generates smart cropping coordinates based on the ROI. - # Smart cropping helps when you specify an aspect ratio that differs from that - # of the input image. A successful response contains the thumbnail image - # binary. If the request failed, the response contains an error code and a - # message to help determine what went wrong. - # - # @param width [Integer] Width of the thumbnail. It must be between 1 and 1024. - # Recommended minimum of 50. - # @param height [Integer] Height of the thumbnail. It must be between 1 and - # 1024. Recommended minimum of 50. - # @param url [String] Publicly reachable URL of an image - # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. + # This operation recognizes content within an image by applying a + # domain-specific model. The list of domain-specific models that are supported + # by the Computer Vision API can be retrieved using the /models GET request. + # Currently, the API provides following domain-specific models: celebrities, + # landmarks. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. + # If the request failed, the response will contain an error code and a message + # to help understand what went wrong. + # + # @param model [String] The domain-specific content to recognize. + # @param url [String] Publicly reachable URL of an image. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' # @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 generate_thumbnail_with_http_info(width, height, url, smart_cropping:false, custom_headers:nil) - generate_thumbnail_async(width, height, url, smart_cropping:smart_cropping, custom_headers:custom_headers).value! + def analyze_image_by_domain_with_http_info(model, url, language:nil, custom_headers:nil) + analyze_image_by_domain_async(model, url, language:language, custom_headers:custom_headers).value! end # - # This operation generates a thumbnail image with the user-specified width and - # height. By default, the service analyzes the image, identifies the region of - # interest (ROI), and generates smart cropping coordinates based on the ROI. - # Smart cropping helps when you specify an aspect ratio that differs from that - # of the input image. A successful response contains the thumbnail image - # binary. If the request failed, the response contains an error code and a - # message to help determine what went wrong. - # - # @param width [Integer] Width of the thumbnail. It must be between 1 and 1024. - # Recommended minimum of 50. - # @param height [Integer] Height of the thumbnail. It must be between 1 and - # 1024. Recommended minimum of 50. - # @param url [String] Publicly reachable URL of an image - # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. + # This operation recognizes content within an image by applying a + # domain-specific model. The list of domain-specific models that are supported + # by the Computer Vision API can be retrieved using the /models GET request. + # Currently, the API provides following domain-specific models: celebrities, + # landmarks. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. + # If the request failed, the response will contain an error code and a message + # to help understand what went wrong. + # + # @param model [String] The domain-specific content to recognize. + # @param url [String] Publicly reachable URL of an image. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' # @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 generate_thumbnail_async(width, height, url, smart_cropping:false, custom_headers:nil) + def analyze_image_by_domain_async(model, url, language:nil, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? - fail ArgumentError, 'width is nil' if width.nil? - fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMaximum': '1023'" if !width.nil? && width > 1023 - fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMinimum': '1'" if !width.nil? && width < 1 - fail ArgumentError, 'height is nil' if height.nil? - fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMaximum': '1023'" if !height.nil? && height > 1023 - fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMinimum': '1'" if !height.nil? && height < 1 + fail ArgumentError, 'model is nil' if model.nil? fail ArgumentError, 'url is nil' if url.nil? image_url = ImageUrl.new @@ -472,14 +758,15 @@ def generate_thumbnail_async(width, height, url, smart_cropping:false, custom_he request_content = self.serialize(request_mapper, image_url) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = 'generateThumbnail' + path_template = 'models/{model}/analyze' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'width' => width,'height' => height,'smartCropping' => smart_cropping}, + path_params: {'model' => model}, + query_params: {'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -492,7 +779,7 @@ def generate_thumbnail_async(width, height, url, smart_cropping:false, custom_he 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) + fail MsRest::HttpOperationError.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? @@ -500,14 +787,7 @@ def generate_thumbnail_async(width, height, url, smart_cropping:false, custom_he if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = { - client_side_validation: true, - required: false, - serialized_name: 'parsed_response', - type: { - name: 'Stream' - } - } + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -521,18 +801,19 @@ def generate_thumbnail_async(width, height, url, smart_cropping:false, custom_he end # - # Optical Character Recognition (OCR) detects printed text in an image and - # extracts the recognized characters into a machine-usable character stream. - # Upon success, the OCR results will be returned. Upon failure, the error code - # together with an error message will be returned. The error code can be one of - # InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, - # NotSupportedLanguage, or InternalServerError. + # Optical Character Recognition (OCR) detects text in an image and extracts the + # recognized characters into a machine-usable character stream. + # Upon success, the OCR results will be returned. + # Upon failure, the error code together with an error message will be returned. + # The error code can be one of InvalidImageUrl, InvalidImageFormat, + # InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or + # InternalServerError. # # @param detect_orientation [Boolean] Whether detect the text orientation in # the image. With detectOrientation=true the OCR service tries to detect the # image orientation and correct it before further processing (e.g. if it's # upside-down). - # @param url [String] Publicly reachable URL of an image + # @param url [String] Publicly reachable URL of an image. # @param language [OcrLanguages] The BCP-47 language code of the text to be # detected in the image. The default value is 'unk'. Possible values include: # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', @@ -549,18 +830,19 @@ def recognize_printed_text(detect_orientation, url, language:nil, custom_headers end # - # Optical Character Recognition (OCR) detects printed text in an image and - # extracts the recognized characters into a machine-usable character stream. - # Upon success, the OCR results will be returned. Upon failure, the error code - # together with an error message will be returned. The error code can be one of - # InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, - # NotSupportedLanguage, or InternalServerError. + # Optical Character Recognition (OCR) detects text in an image and extracts the + # recognized characters into a machine-usable character stream. + # Upon success, the OCR results will be returned. + # Upon failure, the error code together with an error message will be returned. + # The error code can be one of InvalidImageUrl, InvalidImageFormat, + # InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or + # InternalServerError. # # @param detect_orientation [Boolean] Whether detect the text orientation in # the image. With detectOrientation=true the OCR service tries to detect the # image orientation and correct it before further processing (e.g. if it's # upside-down). - # @param url [String] Publicly reachable URL of an image + # @param url [String] Publicly reachable URL of an image. # @param language [OcrLanguages] The BCP-47 language code of the text to be # detected in the image. The default value is 'unk'. Possible values include: # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', @@ -576,18 +858,19 @@ def recognize_printed_text_with_http_info(detect_orientation, url, language:nil, end # - # Optical Character Recognition (OCR) detects printed text in an image and - # extracts the recognized characters into a machine-usable character stream. - # Upon success, the OCR results will be returned. Upon failure, the error code - # together with an error message will be returned. The error code can be one of - # InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, - # NotSupportedLanguage, or InternalServerError. + # Optical Character Recognition (OCR) detects text in an image and extracts the + # recognized characters into a machine-usable character stream. + # Upon success, the OCR results will be returned. + # Upon failure, the error code together with an error message will be returned. + # The error code can be one of InvalidImageUrl, InvalidImageFormat, + # InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or + # InternalServerError. # # @param detect_orientation [Boolean] Whether detect the text orientation in # the image. With detectOrientation=true the OCR service tries to detect the # image orientation and correct it before further processing (e.g. if it's # upside-down). - # @param url [String] Publicly reachable URL of an image + # @param url [String] Publicly reachable URL of an image. # @param language [OcrLanguages] The BCP-47 language code of the text to be # detected in the image. The default value is 'unk'. Possible values include: # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', @@ -662,18 +945,20 @@ def recognize_printed_text_async(detect_orientation, url, language:nil, custom_h end # - # This operation generates a description of an image in human readable language - # with complete sentences. The description is based on a collection of content - # tags, which are also returned by the operation. More than one description can - # be generated for each image. Descriptions are ordered by their confidence - # score. All descriptions are in English. Two input methods are supported -- - # (1) Uploading an image or (2) specifying an image URL.A successful response - # will be returned in JSON. If the request failed, the response will contain - # an error code and a message to help understand what went wrong. - # - # @param url [String] Publicly reachable URL of an image - # @param max_candidates [String] Maximum number of candidate descriptions to be - # returned. The default is 1. + # This operation generates a list of words, or tags, that are relevant to the + # content of the supplied image. The Computer Vision API can return tags based + # on objects, living beings, scenery or actions found in images. Unlike + # categories, tags are not organized according to a hierarchical classification + # system, but correspond to image content. Tags may contain hints to avoid + # ambiguity or provide context, for example the tag "cello" may be accompanied + # by the hint "musical instrument". All tags are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -682,26 +967,28 @@ def recognize_printed_text_async(detect_orientation, url, language:nil, custom_h # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImageDescription] operation results. + # @return [TagResult] operation results. # - def describe_image(url, max_candidates:'1', language:nil, custom_headers:nil) - response = describe_image_async(url, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! + def tag_image(url, language:nil, custom_headers:nil) + response = tag_image_async(url, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation generates a description of an image in human readable language - # with complete sentences. The description is based on a collection of content - # tags, which are also returned by the operation. More than one description can - # be generated for each image. Descriptions are ordered by their confidence - # score. All descriptions are in English. Two input methods are supported -- - # (1) Uploading an image or (2) specifying an image URL.A successful response - # will be returned in JSON. If the request failed, the response will contain - # an error code and a message to help understand what went wrong. - # - # @param url [String] Publicly reachable URL of an image - # @param max_candidates [String] Maximum number of candidate descriptions to be - # returned. The default is 1. + # This operation generates a list of words, or tags, that are relevant to the + # content of the supplied image. The Computer Vision API can return tags based + # on objects, living beings, scenery or actions found in images. Unlike + # categories, tags are not organized according to a hierarchical classification + # system, but correspond to image content. Tags may contain hints to avoid + # ambiguity or provide context, for example the tag "cello" may be accompanied + # by the hint "musical instrument". All tags are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -712,23 +999,25 @@ def describe_image(url, max_candidates:'1', language:nil, custom_headers:nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def describe_image_with_http_info(url, max_candidates:'1', language:nil, custom_headers:nil) - describe_image_async(url, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! + def tag_image_with_http_info(url, language:nil, custom_headers:nil) + tag_image_async(url, language:language, custom_headers:custom_headers).value! end # - # This operation generates a description of an image in human readable language - # with complete sentences. The description is based on a collection of content - # tags, which are also returned by the operation. More than one description can - # be generated for each image. Descriptions are ordered by their confidence - # score. All descriptions are in English. Two input methods are supported -- - # (1) Uploading an image or (2) specifying an image URL.A successful response - # will be returned in JSON. If the request failed, the response will contain - # an error code and a message to help understand what went wrong. - # - # @param url [String] Publicly reachable URL of an image - # @param max_candidates [String] Maximum number of candidate descriptions to be - # returned. The default is 1. + # This operation generates a list of words, or tags, that are relevant to the + # content of the supplied image. The Computer Vision API can return tags based + # on objects, living beings, scenery or actions found in images. Unlike + # categories, tags are not organized according to a hierarchical classification + # system, but correspond to image content. Tags may contain hints to avoid + # ambiguity or provide context, for example the tag "cello" may be accompanied + # by the hint "musical instrument". All tags are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param url [String] Publicly reachable URL of an image. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -739,7 +1028,7 @@ def describe_image_with_http_info(url, max_candidates:'1', language:nil, custom_ # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def describe_image_async(url, max_candidates:'1', language:nil, custom_headers:nil) + def tag_image_async(url, language:nil, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? fail ArgumentError, 'url is nil' if url.nil? @@ -760,14 +1049,14 @@ def describe_image_async(url, max_candidates:'1', language:nil, custom_headers:n request_content = self.serialize(request_mapper, image_url) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = 'describe' + path_template = 'tag' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'maxCandidates' => max_candidates,'language' => language}, + query_params: {'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -788,7 +1077,7 @@ def describe_image_async(url, max_candidates:'1', language:nil, custom_headers:n if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -802,76 +1091,97 @@ def describe_image_async(url, max_candidates:'1', language:nil, custom_headers:n end # - # This operation generates a list of words, or tags, that are relevant to the - # content of the supplied image. The Computer Vision API can return tags based - # on objects, living beings, scenery or actions found in images. Unlike - # categories, tags are not organized according to a hierarchical classification - # system, but correspond to image content. Tags may contain hints to avoid - # ambiguity or provide context, for example the tag 'cello' may be accompanied - # by the hint 'musical instrument'. All tags are in English. - # - # @param url [String] Publicly reachable URL of an image - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # This operation generates a thumbnail image with the user-specified width and + # height. By default, the service analyzes the image, identifies the region of + # interest (ROI), and generates smart cropping coordinates based on the ROI. + # Smart cropping helps when you specify an aspect ratio that differs from that + # of the input image. + # A successful response contains the thumbnail image binary. If the request + # failed, the response contains an error code and a message to help determine + # what went wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or + # InternalServerError. + # + # @param width [Integer] Width of the thumbnail, in pixels. It must be between + # 1 and 1024. Recommended minimum of 50. + # @param height [Integer] Height of the thumbnail, in pixels. It must be + # between 1 and 1024. Recommended minimum of 50. + # @param url [String] Publicly reachable URL of an image. + # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [TagResult] operation results. + # @return [NOT_IMPLEMENTED] operation results. # - def tag_image(url, language:nil, custom_headers:nil) - response = tag_image_async(url, language:language, custom_headers:custom_headers).value! + def generate_thumbnail(width, height, url, smart_cropping:false, custom_headers:nil) + response = generate_thumbnail_async(width, height, url, smart_cropping:smart_cropping, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation generates a list of words, or tags, that are relevant to the - # content of the supplied image. The Computer Vision API can return tags based - # on objects, living beings, scenery or actions found in images. Unlike - # categories, tags are not organized according to a hierarchical classification - # system, but correspond to image content. Tags may contain hints to avoid - # ambiguity or provide context, for example the tag 'cello' may be accompanied - # by the hint 'musical instrument'. All tags are in English. - # - # @param url [String] Publicly reachable URL of an image - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # This operation generates a thumbnail image with the user-specified width and + # height. By default, the service analyzes the image, identifies the region of + # interest (ROI), and generates smart cropping coordinates based on the ROI. + # Smart cropping helps when you specify an aspect ratio that differs from that + # of the input image. + # A successful response contains the thumbnail image binary. If the request + # failed, the response contains an error code and a message to help determine + # what went wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or + # InternalServerError. + # + # @param width [Integer] Width of the thumbnail, in pixels. It must be between + # 1 and 1024. Recommended minimum of 50. + # @param height [Integer] Height of the thumbnail, in pixels. It must be + # between 1 and 1024. Recommended minimum of 50. + # @param url [String] Publicly reachable URL of an image. + # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @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 tag_image_with_http_info(url, language:nil, custom_headers:nil) - tag_image_async(url, language:language, custom_headers:custom_headers).value! + def generate_thumbnail_with_http_info(width, height, url, smart_cropping:false, custom_headers:nil) + generate_thumbnail_async(width, height, url, smart_cropping:smart_cropping, custom_headers:custom_headers).value! end # - # This operation generates a list of words, or tags, that are relevant to the - # content of the supplied image. The Computer Vision API can return tags based - # on objects, living beings, scenery or actions found in images. Unlike - # categories, tags are not organized according to a hierarchical classification - # system, but correspond to image content. Tags may contain hints to avoid - # ambiguity or provide context, for example the tag 'cello' may be accompanied - # by the hint 'musical instrument'. All tags are in English. - # - # @param url [String] Publicly reachable URL of an image - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # This operation generates a thumbnail image with the user-specified width and + # height. By default, the service analyzes the image, identifies the region of + # interest (ROI), and generates smart cropping coordinates based on the ROI. + # Smart cropping helps when you specify an aspect ratio that differs from that + # of the input image. + # A successful response contains the thumbnail image binary. If the request + # failed, the response contains an error code and a message to help determine + # what went wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or + # InternalServerError. + # + # @param width [Integer] Width of the thumbnail, in pixels. It must be between + # 1 and 1024. Recommended minimum of 50. + # @param height [Integer] Height of the thumbnail, in pixels. It must be + # between 1 and 1024. Recommended minimum of 50. + # @param url [String] Publicly reachable URL of an image. + # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @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 tag_image_async(url, language:nil, custom_headers:nil) + def generate_thumbnail_async(width, height, url, smart_cropping:false, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'width is nil' if width.nil? + fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMaximum': '1024'" if !width.nil? && width > 1024 + fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMinimum': '1'" if !width.nil? && width < 1 + fail ArgumentError, 'height is nil' if height.nil? + fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMaximum': '1024'" if !height.nil? && height > 1024 + fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMinimum': '1'" if !height.nil? && height < 1 fail ArgumentError, 'url is nil' if url.nil? image_url = ImageUrl.new @@ -891,14 +1201,14 @@ def tag_image_async(url, language:nil, custom_headers:nil) request_content = self.serialize(request_mapper, image_url) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = 'tag' + path_template = 'generateThumbnail' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'language' => language}, + query_params: {'width' => width,'height' => height,'smartCropping' => smart_cropping}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -911,7 +1221,7 @@ def tag_image_async(url, language:nil, custom_headers:nil) response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + 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? @@ -919,7 +1229,14 @@ def tag_image_async(url, language:nil, custom_headers:nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult.mapper() + result_mapper = { + client_side_validation: true, + required: false, + serialized_name: 'parsed_response', + type: { + name: 'Stream' + } + } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -933,83 +1250,64 @@ def tag_image_async(url, language:nil, custom_headers:nil) end # - # This operation recognizes content within an image by applying a - # domain-specific model. The list of domain-specific models that are supported - # by the Computer Vision API can be retrieved using the /models GET request. - # Currently, the API only provides a single domain-specific model: celebrities. - # Two input methods are supported -- (1) Uploading an image or (2) specifying - # an image URL. A successful response will be returned in JSON. If the request - # failed, the response will contain an error code and a message to help - # understand what went wrong. - # - # @param model [String] The domain-specific content to recognize. - # @param url [String] Publicly reachable URL of an image - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # This operation returns a bounding box around the most important area of the + # image. + # A successful response will be returned in JSON. If the request failed, the + # response contains an error code and a message to help determine what went + # wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. + # + # @param url [String] Publicly reachable URL of an image. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [DomainModelResults] operation results. + # @return [AreaOfInterestResult] operation results. # - def analyze_image_by_domain(model, url, language:nil, custom_headers:nil) - response = analyze_image_by_domain_async(model, url, language:language, custom_headers:custom_headers).value! + def get_area_of_interest(url, custom_headers:nil) + response = get_area_of_interest_async(url, custom_headers:custom_headers).value! response.body unless response.nil? end - # - # This operation recognizes content within an image by applying a - # domain-specific model. The list of domain-specific models that are supported - # by the Computer Vision API can be retrieved using the /models GET request. - # Currently, the API only provides a single domain-specific model: celebrities. - # Two input methods are supported -- (1) Uploading an image or (2) specifying - # an image URL. A successful response will be returned in JSON. If the request - # failed, the response will contain an error code and a message to help - # understand what went wrong. - # - # @param model [String] The domain-specific content to recognize. - # @param url [String] Publicly reachable URL of an image - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # + # This operation returns a bounding box around the most important area of the + # image. + # A successful response will be returned in JSON. If the request failed, the + # response contains an error code and a message to help determine what went + # wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. + # + # @param url [String] Publicly reachable URL of an image. # @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 analyze_image_by_domain_with_http_info(model, url, language:nil, custom_headers:nil) - analyze_image_by_domain_async(model, url, language:language, custom_headers:custom_headers).value! + def get_area_of_interest_with_http_info(url, custom_headers:nil) + get_area_of_interest_async(url, custom_headers:custom_headers).value! end # - # This operation recognizes content within an image by applying a - # domain-specific model. The list of domain-specific models that are supported - # by the Computer Vision API can be retrieved using the /models GET request. - # Currently, the API only provides a single domain-specific model: celebrities. - # Two input methods are supported -- (1) Uploading an image or (2) specifying - # an image URL. A successful response will be returned in JSON. If the request - # failed, the response will contain an error code and a message to help - # understand what went wrong. - # - # @param model [String] The domain-specific content to recognize. - # @param url [String] Publicly reachable URL of an image - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # This operation returns a bounding box around the most important area of the + # image. + # A successful response will be returned in JSON. If the request failed, the + # response contains an error code and a message to help determine what went + # wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. + # + # @param url [String] Publicly reachable URL of an image. # @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 analyze_image_by_domain_async(model, url, language:nil, custom_headers:nil) + def get_area_of_interest_async(url, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? - fail ArgumentError, 'model is nil' if model.nil? fail ArgumentError, 'url is nil' if url.nil? image_url = ImageUrl.new @@ -1029,15 +1327,13 @@ def analyze_image_by_domain_async(model, url, language:nil, custom_headers:nil) request_content = self.serialize(request_mapper, image_url) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil - path_template = 'models/{model}/analyze' + path_template = 'areaOfInterest' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'model' => model}, - query_params: {'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -1058,7 +1354,7 @@ def analyze_image_by_domain_async(model, url, language:nil, custom_headers:nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1079,7 +1375,7 @@ def analyze_image_by_domain_async(model, url, language:nil, custom_headers:nil) # # @param mode [TextRecognitionMode] Type of text to recognize. Possible values # include: 'Handwritten', 'Printed' - # @param url [String] Publicly reachable URL of an image + # @param url [String] Publicly reachable URL of an image. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -1097,7 +1393,7 @@ def recognize_text(url, mode, custom_headers:nil) # # @param mode [TextRecognitionMode] Type of text to recognize. Possible values # include: 'Handwritten', 'Printed' - # @param url [String] Publicly reachable URL of an image + # @param url [String] Publicly reachable URL of an image. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # @@ -1115,7 +1411,7 @@ def recognize_text_with_http_info(url, mode, custom_headers:nil) # # @param mode [TextRecognitionMode] Type of text to recognize. Possible values # include: 'Handwritten', 'Printed' - # @param url [String] Publicly reachable URL of an image + # @param url [String] Publicly reachable URL of an image. # @param [Hash{String => String}] A hash of custom headers that will be added # to the HTTP request. # @@ -1273,23 +1569,32 @@ def get_text_operation_result_async(operation_id, custom_headers:nil) # # This operation extracts a rich set of visual features based on the image # content. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. Within your request, there is an optional parameter to allow + # you to choose which features to return. By default, image categories are + # returned in the response. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. # # @param image An image stream. # @param visual_features [Array] A string indicating what # visual feature types to return. Multiple values should be comma-separated. - # Valid visual feature types include:Categories - categorizes image content + # Valid visual feature types include: Categories - categorizes image content # according to a taxonomy defined in documentation. Tags - tags the image with # a detailed list of words related to the image content. Description - # describes the image content with a complete English sentence. Faces - detects # if faces are present. If present, generate coordinates, gender and age. # ImageType - detects if image is clipart or a line drawing. Color - determines - # the accent color, dominant color, and whether an image is black&white.Adult - - # detects if the image is pornographic in nature (depicts nudity or a sex act). - # Sexually suggestive content is also detected. - # @param details [Enum] A string indicating which domain-specific details to - # return. Multiple values should be comma-separated. Valid visual feature types - # include:Celebrities - identifies celebrities if detected in the image. - # Possible values include: 'Celebrities', 'Landmarks' + # the accent color, dominant color, and whether an image is black&white. Adult + # - detects if the image is pornographic in nature (depicts nudity or a sex + # act). Sexually suggestive content is also detected. Objects - detects + # various objects within an image, including the approximate location. The + # Objects argument is only available in English. + # @param details [Array
] A string indicating which domain-specific + # details to return. Multiple values should be comma-separated. Valid visual + # feature types include: Celebrities - identifies celebrities if detected in + # the image, Landmarks - identifies notable landmarks in the image. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -1308,23 +1613,32 @@ def analyze_image_in_stream(image, visual_features:nil, details:nil, language:ni # # This operation extracts a rich set of visual features based on the image # content. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. Within your request, there is an optional parameter to allow + # you to choose which features to return. By default, image categories are + # returned in the response. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. # # @param image An image stream. # @param visual_features [Array] A string indicating what # visual feature types to return. Multiple values should be comma-separated. - # Valid visual feature types include:Categories - categorizes image content + # Valid visual feature types include: Categories - categorizes image content # according to a taxonomy defined in documentation. Tags - tags the image with # a detailed list of words related to the image content. Description - # describes the image content with a complete English sentence. Faces - detects # if faces are present. If present, generate coordinates, gender and age. # ImageType - detects if image is clipart or a line drawing. Color - determines - # the accent color, dominant color, and whether an image is black&white.Adult - - # detects if the image is pornographic in nature (depicts nudity or a sex act). - # Sexually suggestive content is also detected. - # @param details [Enum] A string indicating which domain-specific details to - # return. Multiple values should be comma-separated. Valid visual feature types - # include:Celebrities - identifies celebrities if detected in the image. - # Possible values include: 'Celebrities', 'Landmarks' + # the accent color, dominant color, and whether an image is black&white. Adult + # - detects if the image is pornographic in nature (depicts nudity or a sex + # act). Sexually suggestive content is also detected. Objects - detects + # various objects within an image, including the approximate location. The + # Objects argument is only available in English. + # @param details [Array
] A string indicating which domain-specific + # details to return. Multiple values should be comma-separated. Valid visual + # feature types include: Celebrities - identifies celebrities if detected in + # the image, Landmarks - identifies notable landmarks in the image. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -1342,23 +1656,32 @@ def analyze_image_in_stream_with_http_info(image, visual_features:nil, details:n # # This operation extracts a rich set of visual features based on the image # content. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. Within your request, there is an optional parameter to allow + # you to choose which features to return. By default, image categories are + # returned in the response. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. # # @param image An image stream. # @param visual_features [Array] A string indicating what # visual feature types to return. Multiple values should be comma-separated. - # Valid visual feature types include:Categories - categorizes image content + # Valid visual feature types include: Categories - categorizes image content # according to a taxonomy defined in documentation. Tags - tags the image with # a detailed list of words related to the image content. Description - # describes the image content with a complete English sentence. Faces - detects # if faces are present. If present, generate coordinates, gender and age. # ImageType - detects if image is clipart or a line drawing. Color - determines - # the accent color, dominant color, and whether an image is black&white.Adult - - # detects if the image is pornographic in nature (depicts nudity or a sex act). - # Sexually suggestive content is also detected. - # @param details [Enum] A string indicating which domain-specific details to - # return. Multiple values should be comma-separated. Valid visual feature types - # include:Celebrities - identifies celebrities if detected in the image. - # Possible values include: 'Celebrities', 'Landmarks' + # the accent color, dominant color, and whether an image is black&white. Adult + # - detects if the image is pornographic in nature (depicts nudity or a sex + # act). Sexually suggestive content is also detected. Objects - detects + # various objects within an image, including the approximate location. The + # Objects argument is only available in English. + # @param details [Array
] A string indicating which domain-specific + # details to return. Multiple values should be comma-separated. Valid visual + # feature types include: Celebrities - identifies celebrities if detected in + # the image, Landmarks - identifies notable landmarks in the image. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -1399,7 +1722,7 @@ def analyze_image_in_stream_async(image, visual_features:nil, details:nil, langu options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'visualFeatures' => visual_features.nil? ? nil : visual_features.join(','),'details' => details,'language' => language}, + query_params: {'visualFeatures' => visual_features.nil? ? nil : visual_features.join(','),'details' => details.nil? ? nil : details.join(','),'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -1434,82 +1757,326 @@ def analyze_image_in_stream_async(image, visual_features:nil, details:nil, langu end # - # This operation generates a thumbnail image with the user-specified width and - # height. By default, the service analyzes the image, identifies the region of - # interest (ROI), and generates smart cropping coordinates based on the ROI. - # Smart cropping helps when you specify an aspect ratio that differs from that - # of the input image. A successful response contains the thumbnail image - # binary. If the request failed, the response contains an error code and a - # message to help determine what went wrong. - # - # @param width [Integer] Width of the thumbnail. It must be between 1 and 1024. - # Recommended minimum of 50. - # @param height [Integer] Height of the thumbnail. It must be between 1 and - # 1024. Recommended minimum of 50. + # This operation returns a bounding box around the most important area of the + # image. + # A successful response will be returned in JSON. If the request failed, the + # response contains an error code and a message to help determine what went + # wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. + # # @param image An image stream. - # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [NOT_IMPLEMENTED] operation results. + # @return [AreaOfInterestResult] operation results. # - def generate_thumbnail_in_stream(width, height, image, smart_cropping:false, custom_headers:nil) - response = generate_thumbnail_in_stream_async(width, height, image, smart_cropping:smart_cropping, custom_headers:custom_headers).value! + def get_area_of_interest_in_stream(image, custom_headers:nil) + response = get_area_of_interest_in_stream_async(image, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation generates a thumbnail image with the user-specified width and - # height. By default, the service analyzes the image, identifies the region of - # interest (ROI), and generates smart cropping coordinates based on the ROI. - # Smart cropping helps when you specify an aspect ratio that differs from that - # of the input image. A successful response contains the thumbnail image - # binary. If the request failed, the response contains an error code and a - # message to help determine what went wrong. - # - # @param width [Integer] Width of the thumbnail. It must be between 1 and 1024. - # Recommended minimum of 50. - # @param height [Integer] Height of the thumbnail. It must be between 1 and - # 1024. Recommended minimum of 50. + # This operation returns a bounding box around the most important area of the + # image. + # A successful response will be returned in JSON. If the request failed, the + # response contains an error code and a message to help determine what went + # wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. + # + # @param image An image stream. + # @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_area_of_interest_in_stream_with_http_info(image, custom_headers:nil) + get_area_of_interest_in_stream_async(image, custom_headers:custom_headers).value! + end + + # + # This operation returns a bounding box around the most important area of the + # image. + # A successful response will be returned in JSON. If the request failed, the + # response contains an error code and a message to help determine what went + # wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. + # + # @param image An image stream. + # @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_area_of_interest_in_stream_async(image, custom_headers:nil) + fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'image is nil' if image.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/octet-stream' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = accept_language unless accept_language.nil? + + # Serialize Request + request_mapper = { + client_side_validation: true, + required: true, + serialized_name: 'Image', + type: { + name: 'Stream' + } + } + request_content = self.serialize(request_mapper, image) + + path_template = 'areaOfInterest' + + request_url = @base_url || self.base_url + request_url = request_url.gsub('{Endpoint}', endpoint) + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = self.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 MsRest::HttpOperationError.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::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult.mapper() + result.body = self.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 + + # + # This operation generates a description of an image in human readable language + # with complete sentences. The description is based on a collection of content + # tags, which are also returned by the operation. More than one description can + # be generated for each image. Descriptions are ordered by their confidence + # score. All descriptions are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param image An image stream. + # @param max_candidates [Integer] Maximum number of candidate descriptions to + # be returned. The default is 1. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ImageDescription] operation results. + # + def describe_image_in_stream(image, max_candidates:1, language:nil, custom_headers:nil) + response = describe_image_in_stream_async(image, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # This operation generates a description of an image in human readable language + # with complete sentences. The description is based on a collection of content + # tags, which are also returned by the operation. More than one description can + # be generated for each image. Descriptions are ordered by their confidence + # score. All descriptions are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param image An image stream. + # @param max_candidates [Integer] Maximum number of candidate descriptions to + # be returned. The default is 1. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' + # @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 describe_image_in_stream_with_http_info(image, max_candidates:1, language:nil, custom_headers:nil) + describe_image_in_stream_async(image, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! + end + + # + # This operation generates a description of an image in human readable language + # with complete sentences. The description is based on a collection of content + # tags, which are also returned by the operation. More than one description can + # be generated for each image. Descriptions are ordered by their confidence + # score. All descriptions are in English. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param image An image stream. + # @param max_candidates [Integer] Maximum number of candidate descriptions to + # be returned. The default is 1. + # @param language [Enum] The desired language for output generation. If this + # parameter is not specified, the default value is "en".Supported + # languages:en - English, Default. es - Spanish, ja - Japanese, pt - + # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', + # 'ja', 'pt', 'zh' + # @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 describe_image_in_stream_async(image, max_candidates:1, language:nil, custom_headers:nil) + fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'image is nil' if image.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/octet-stream' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = accept_language unless accept_language.nil? + + # Serialize Request + request_mapper = { + client_side_validation: true, + required: true, + serialized_name: 'Image', + type: { + name: 'Stream' + } + } + request_content = self.serialize(request_mapper, image) + + path_template = 'describe' + + request_url = @base_url || self.base_url + request_url = request_url.gsub('{Endpoint}', endpoint) + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'maxCandidates' => max_candidates,'language' => language}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = self.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 MsRest::HttpOperationError.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::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription.mapper() + result.body = self.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 + + # + # Performs object detection on the specified image. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # + # @param image An image stream. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DetectResult] operation results. + # + def detect_objects_in_stream(image, custom_headers:nil) + response = detect_objects_in_stream_async(image, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Performs object detection on the specified image. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # # @param image An image stream. - # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @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 generate_thumbnail_in_stream_with_http_info(width, height, image, smart_cropping:false, custom_headers:nil) - generate_thumbnail_in_stream_async(width, height, image, smart_cropping:smart_cropping, custom_headers:custom_headers).value! + def detect_objects_in_stream_with_http_info(image, custom_headers:nil) + detect_objects_in_stream_async(image, custom_headers:custom_headers).value! end # - # This operation generates a thumbnail image with the user-specified width and - # height. By default, the service analyzes the image, identifies the region of - # interest (ROI), and generates smart cropping coordinates based on the ROI. - # Smart cropping helps when you specify an aspect ratio that differs from that - # of the input image. A successful response contains the thumbnail image - # binary. If the request failed, the response contains an error code and a - # message to help determine what went wrong. - # - # @param width [Integer] Width of the thumbnail. It must be between 1 and 1024. - # Recommended minimum of 50. - # @param height [Integer] Height of the thumbnail. It must be between 1 and - # 1024. Recommended minimum of 50. + # Performs object detection on the specified image. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. + # # @param image An image stream. - # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @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 generate_thumbnail_in_stream_async(width, height, image, smart_cropping:false, custom_headers:nil) + def detect_objects_in_stream_async(image, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? - fail ArgumentError, 'width is nil' if width.nil? - fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMaximum': '1023'" if !width.nil? && width > 1023 - fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMinimum': '1'" if !width.nil? && width < 1 - fail ArgumentError, 'height is nil' if height.nil? - fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMaximum': '1023'" if !height.nil? && height > 1023 - fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMinimum': '1'" if !height.nil? && height < 1 fail ArgumentError, 'image is nil' if image.nil? @@ -1531,14 +2098,13 @@ def generate_thumbnail_in_stream_async(width, height, image, smart_cropping:fals } request_content = self.serialize(request_mapper, image) - path_template = 'generateThumbnail' + path_template = 'detect' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'width' => width,'height' => height,'smartCropping' => smart_cropping}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -1551,7 +2117,7 @@ def generate_thumbnail_in_stream_async(width, height, image, smart_cropping:fals 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) + fail MsRest::HttpOperationError.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? @@ -1559,14 +2125,7 @@ def generate_thumbnail_in_stream_async(width, height, image, smart_cropping:fals if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = { - client_side_validation: true, - required: false, - serialized_name: 'parsed_response', - type: { - name: 'Stream' - } - } + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1580,86 +2139,97 @@ def generate_thumbnail_in_stream_async(width, height, image, smart_cropping:fals end # - # Optical Character Recognition (OCR) detects printed text in an image and - # extracts the recognized characters into a machine-usable character stream. - # Upon success, the OCR results will be returned. Upon failure, the error code - # together with an error message will be returned. The error code can be one of - # InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, - # NotSupportedLanguage, or InternalServerError. - # - # @param detect_orientation [Boolean] Whether detect the text orientation in - # the image. With detectOrientation=true the OCR service tries to detect the - # image orientation and correct it before further processing (e.g. if it's - # upside-down). + # This operation generates a thumbnail image with the user-specified width and + # height. By default, the service analyzes the image, identifies the region of + # interest (ROI), and generates smart cropping coordinates based on the ROI. + # Smart cropping helps when you specify an aspect ratio that differs from that + # of the input image. + # A successful response contains the thumbnail image binary. If the request + # failed, the response contains an error code and a message to help determine + # what went wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or + # InternalServerError. + # + # @param width [Integer] Width of the thumbnail, in pixels. It must be between + # 1 and 1024. Recommended minimum of 50. + # @param height [Integer] Height of the thumbnail, in pixels. It must be + # between 1 and 1024. Recommended minimum of 50. # @param image An image stream. - # @param language [OcrLanguages] The BCP-47 language code of the text to be - # detected in the image. The default value is 'unk'. Possible values include: - # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', - # 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', - # 'sr-Cyrl', 'sr-Latn', 'sk' + # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [OcrResult] operation results. + # @return [NOT_IMPLEMENTED] operation results. # - def recognize_printed_text_in_stream(detect_orientation, image, language:nil, custom_headers:nil) - response = recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value! + def generate_thumbnail_in_stream(width, height, image, smart_cropping:false, custom_headers:nil) + response = generate_thumbnail_in_stream_async(width, height, image, smart_cropping:smart_cropping, custom_headers:custom_headers).value! response.body unless response.nil? end # - # Optical Character Recognition (OCR) detects printed text in an image and - # extracts the recognized characters into a machine-usable character stream. - # Upon success, the OCR results will be returned. Upon failure, the error code - # together with an error message will be returned. The error code can be one of - # InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, - # NotSupportedLanguage, or InternalServerError. - # - # @param detect_orientation [Boolean] Whether detect the text orientation in - # the image. With detectOrientation=true the OCR service tries to detect the - # image orientation and correct it before further processing (e.g. if it's - # upside-down). + # This operation generates a thumbnail image with the user-specified width and + # height. By default, the service analyzes the image, identifies the region of + # interest (ROI), and generates smart cropping coordinates based on the ROI. + # Smart cropping helps when you specify an aspect ratio that differs from that + # of the input image. + # A successful response contains the thumbnail image binary. If the request + # failed, the response contains an error code and a message to help determine + # what went wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or + # InternalServerError. + # + # @param width [Integer] Width of the thumbnail, in pixels. It must be between + # 1 and 1024. Recommended minimum of 50. + # @param height [Integer] Height of the thumbnail, in pixels. It must be + # between 1 and 1024. Recommended minimum of 50. # @param image An image stream. - # @param language [OcrLanguages] The BCP-47 language code of the text to be - # detected in the image. The default value is 'unk'. Possible values include: - # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', - # 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', - # 'sr-Cyrl', 'sr-Latn', 'sk' + # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @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 recognize_printed_text_in_stream_with_http_info(detect_orientation, image, language:nil, custom_headers:nil) - recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value! + def generate_thumbnail_in_stream_with_http_info(width, height, image, smart_cropping:false, custom_headers:nil) + generate_thumbnail_in_stream_async(width, height, image, smart_cropping:smart_cropping, custom_headers:custom_headers).value! end # - # Optical Character Recognition (OCR) detects printed text in an image and - # extracts the recognized characters into a machine-usable character stream. - # Upon success, the OCR results will be returned. Upon failure, the error code - # together with an error message will be returned. The error code can be one of - # InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, - # NotSupportedLanguage, or InternalServerError. - # - # @param detect_orientation [Boolean] Whether detect the text orientation in - # the image. With detectOrientation=true the OCR service tries to detect the - # image orientation and correct it before further processing (e.g. if it's - # upside-down). + # This operation generates a thumbnail image with the user-specified width and + # height. By default, the service analyzes the image, identifies the region of + # interest (ROI), and generates smart cropping coordinates based on the ROI. + # Smart cropping helps when you specify an aspect ratio that differs from that + # of the input image. + # A successful response contains the thumbnail image binary. If the request + # failed, the response contains an error code and a message to help determine + # what went wrong. + # Upon failure, the error code and an error message are returned. The error + # code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, + # InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or + # InternalServerError. + # + # @param width [Integer] Width of the thumbnail, in pixels. It must be between + # 1 and 1024. Recommended minimum of 50. + # @param height [Integer] Height of the thumbnail, in pixels. It must be + # between 1 and 1024. Recommended minimum of 50. # @param image An image stream. - # @param language [OcrLanguages] The BCP-47 language code of the text to be - # detected in the image. The default value is 'unk'. Possible values include: - # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', - # 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', - # 'sr-Cyrl', 'sr-Latn', 'sk' + # @param smart_cropping [Boolean] Boolean flag for enabling smart cropping. # @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 recognize_printed_text_in_stream_async(detect_orientation, image, language:nil, custom_headers:nil) + def generate_thumbnail_in_stream_async(width, height, image, smart_cropping:false, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? - fail ArgumentError, 'detect_orientation is nil' if detect_orientation.nil? + fail ArgumentError, 'width is nil' if width.nil? + fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMaximum': '1024'" if !width.nil? && width > 1024 + fail ArgumentError, "'width' should satisfy the constraint - 'InclusiveMinimum': '1'" if !width.nil? && width < 1 + fail ArgumentError, 'height is nil' if height.nil? + fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMaximum': '1024'" if !height.nil? && height > 1024 + fail ArgumentError, "'height' should satisfy the constraint - 'InclusiveMinimum': '1'" if !height.nil? && height < 1 fail ArgumentError, 'image is nil' if image.nil? @@ -1681,14 +2251,14 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language:n } request_content = self.serialize(request_mapper, image) - path_template = 'ocr' + path_template = 'generateThumbnail' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'language' => language,'detectOrientation' => detect_orientation}, + query_params: {'width' => width,'height' => height,'smartCropping' => smart_cropping}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -1701,7 +2271,7 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language:n response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) - fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + 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? @@ -1709,7 +2279,14 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language:n if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult.mapper() + result_mapper = { + client_side_validation: true, + required: false, + serialized_name: 'parsed_response', + type: { + name: 'Stream' + } + } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1723,18 +2300,19 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language:n end # - # This operation generates a description of an image in human readable language - # with complete sentences. The description is based on a collection of content - # tags, which are also returned by the operation. More than one description can - # be generated for each image. Descriptions are ordered by their confidence - # score. All descriptions are in English. Two input methods are supported -- - # (1) Uploading an image or (2) specifying an image URL.A successful response - # will be returned in JSON. If the request failed, the response will contain - # an error code and a message to help understand what went wrong. + # This operation recognizes content within an image by applying a + # domain-specific model. The list of domain-specific models that are supported + # by the Computer Vision API can be retrieved using the /models GET request. + # Currently, the API provides following domain-specific models: celebrities, + # landmarks. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. + # If the request failed, the response will contain an error code and a message + # to help understand what went wrong. # + # @param model [String] The domain-specific content to recognize. # @param image An image stream. - # @param max_candidates [String] Maximum number of candidate descriptions to be - # returned. The default is 1. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -1743,26 +2321,27 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language:n # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [ImageDescription] operation results. + # @return [DomainModelResults] operation results. # - def describe_image_in_stream(image, max_candidates:'1', language:nil, custom_headers:nil) - response = describe_image_in_stream_async(image, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! + def analyze_image_by_domain_in_stream(model, image, language:nil, custom_headers:nil) + response = analyze_image_by_domain_in_stream_async(model, image, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation generates a description of an image in human readable language - # with complete sentences. The description is based on a collection of content - # tags, which are also returned by the operation. More than one description can - # be generated for each image. Descriptions are ordered by their confidence - # score. All descriptions are in English. Two input methods are supported -- - # (1) Uploading an image or (2) specifying an image URL.A successful response - # will be returned in JSON. If the request failed, the response will contain - # an error code and a message to help understand what went wrong. + # This operation recognizes content within an image by applying a + # domain-specific model. The list of domain-specific models that are supported + # by the Computer Vision API can be retrieved using the /models GET request. + # Currently, the API provides following domain-specific models: celebrities, + # landmarks. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. + # If the request failed, the response will contain an error code and a message + # to help understand what went wrong. # + # @param model [String] The domain-specific content to recognize. # @param image An image stream. - # @param max_candidates [String] Maximum number of candidate descriptions to be - # returned. The default is 1. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -1773,23 +2352,24 @@ def describe_image_in_stream(image, max_candidates:'1', language:nil, custom_hea # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def describe_image_in_stream_with_http_info(image, max_candidates:'1', language:nil, custom_headers:nil) - describe_image_in_stream_async(image, max_candidates:max_candidates, language:language, custom_headers:custom_headers).value! + def analyze_image_by_domain_in_stream_with_http_info(model, image, language:nil, custom_headers:nil) + analyze_image_by_domain_in_stream_async(model, image, language:language, custom_headers:custom_headers).value! end # - # This operation generates a description of an image in human readable language - # with complete sentences. The description is based on a collection of content - # tags, which are also returned by the operation. More than one description can - # be generated for each image. Descriptions are ordered by their confidence - # score. All descriptions are in English. Two input methods are supported -- - # (1) Uploading an image or (2) specifying an image URL.A successful response - # will be returned in JSON. If the request failed, the response will contain - # an error code and a message to help understand what went wrong. + # This operation recognizes content within an image by applying a + # domain-specific model. The list of domain-specific models that are supported + # by the Computer Vision API can be retrieved using the /models GET request. + # Currently, the API provides following domain-specific models: celebrities, + # landmarks. + # Two input methods are supported -- (1) Uploading an image or (2) specifying + # an image URL. + # A successful response will be returned in JSON. + # If the request failed, the response will contain an error code and a message + # to help understand what went wrong. # + # @param model [String] The domain-specific content to recognize. # @param image An image stream. - # @param max_candidates [String] Maximum number of candidate descriptions to be - # returned. The default is 1. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported # languages:en - English, Default. es - Spanish, ja - Japanese, pt - @@ -1800,8 +2380,9 @@ def describe_image_in_stream_with_http_info(image, max_candidates:'1', language: # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def describe_image_in_stream_async(image, max_candidates:'1', language:nil, custom_headers:nil) + def analyze_image_by_domain_in_stream_async(model, image, language:nil, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'model is nil' if model.nil? fail ArgumentError, 'image is nil' if image.nil? @@ -1823,14 +2404,15 @@ def describe_image_in_stream_async(image, max_candidates:'1', language:nil, cust } request_content = self.serialize(request_mapper, image) - path_template = 'describe' + path_template = 'models/{model}/analyze' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'maxCandidates' => max_candidates,'language' => language}, + path_params: {'model' => model}, + query_params: {'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -1851,7 +2433,7 @@ def describe_image_in_stream_async(image, max_candidates:'1', language:nil, cust if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1865,76 +2447,89 @@ def describe_image_in_stream_async(image, max_candidates:'1', language:nil, cust end # - # This operation generates a list of words, or tags, that are relevant to the - # content of the supplied image. The Computer Vision API can return tags based - # on objects, living beings, scenery or actions found in images. Unlike - # categories, tags are not organized according to a hierarchical classification - # system, but correspond to image content. Tags may contain hints to avoid - # ambiguity or provide context, for example the tag 'cello' may be accompanied - # by the hint 'musical instrument'. All tags are in English. + # Optical Character Recognition (OCR) detects text in an image and extracts the + # recognized characters into a machine-usable character stream. + # Upon success, the OCR results will be returned. + # Upon failure, the error code together with an error message will be returned. + # The error code can be one of InvalidImageUrl, InvalidImageFormat, + # InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or + # InternalServerError. # + # @param detect_orientation [Boolean] Whether detect the text orientation in + # the image. With detectOrientation=true the OCR service tries to detect the + # image orientation and correct it before further processing (e.g. if it's + # upside-down). # @param image An image stream. - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # @param language [OcrLanguages] The BCP-47 language code of the text to be + # detected in the image. The default value is 'unk'. Possible values include: + # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', + # 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', + # 'sr-Cyrl', 'sr-Latn', 'sk' # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [TagResult] operation results. + # @return [OcrResult] operation results. # - def tag_image_in_stream(image, language:nil, custom_headers:nil) - response = tag_image_in_stream_async(image, language:language, custom_headers:custom_headers).value! + def recognize_printed_text_in_stream(detect_orientation, image, language:nil, custom_headers:nil) + response = recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation generates a list of words, or tags, that are relevant to the - # content of the supplied image. The Computer Vision API can return tags based - # on objects, living beings, scenery or actions found in images. Unlike - # categories, tags are not organized according to a hierarchical classification - # system, but correspond to image content. Tags may contain hints to avoid - # ambiguity or provide context, for example the tag 'cello' may be accompanied - # by the hint 'musical instrument'. All tags are in English. + # Optical Character Recognition (OCR) detects text in an image and extracts the + # recognized characters into a machine-usable character stream. + # Upon success, the OCR results will be returned. + # Upon failure, the error code together with an error message will be returned. + # The error code can be one of InvalidImageUrl, InvalidImageFormat, + # InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or + # InternalServerError. # + # @param detect_orientation [Boolean] Whether detect the text orientation in + # the image. With detectOrientation=true the OCR service tries to detect the + # image orientation and correct it before further processing (e.g. if it's + # upside-down). # @param image An image stream. - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # @param language [OcrLanguages] The BCP-47 language code of the text to be + # detected in the image. The default value is 'unk'. Possible values include: + # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', + # 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', + # 'sr-Cyrl', 'sr-Latn', 'sk' # @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 tag_image_in_stream_with_http_info(image, language:nil, custom_headers:nil) - tag_image_in_stream_async(image, language:language, custom_headers:custom_headers).value! + def recognize_printed_text_in_stream_with_http_info(detect_orientation, image, language:nil, custom_headers:nil) + recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value! end # - # This operation generates a list of words, or tags, that are relevant to the - # content of the supplied image. The Computer Vision API can return tags based - # on objects, living beings, scenery or actions found in images. Unlike - # categories, tags are not organized according to a hierarchical classification - # system, but correspond to image content. Tags may contain hints to avoid - # ambiguity or provide context, for example the tag 'cello' may be accompanied - # by the hint 'musical instrument'. All tags are in English. + # Optical Character Recognition (OCR) detects text in an image and extracts the + # recognized characters into a machine-usable character stream. + # Upon success, the OCR results will be returned. + # Upon failure, the error code together with an error message will be returned. + # The error code can be one of InvalidImageUrl, InvalidImageFormat, + # InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or + # InternalServerError. # + # @param detect_orientation [Boolean] Whether detect the text orientation in + # the image. With detectOrientation=true the OCR service tries to detect the + # image orientation and correct it before further processing (e.g. if it's + # upside-down). # @param image An image stream. - # @param language [Enum] The desired language for output generation. If this - # parameter is not specified, the default value is "en".Supported - # languages:en - English, Default. es - Spanish, ja - Japanese, pt - - # Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', - # 'ja', 'pt', 'zh' + # @param language [OcrLanguages] The BCP-47 language code of the text to be + # detected in the image. The default value is 'unk'. Possible values include: + # 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', + # 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', + # 'sr-Cyrl', 'sr-Latn', 'sk' # @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 tag_image_in_stream_async(image, language:nil, custom_headers:nil) + def recognize_printed_text_in_stream_async(detect_orientation, image, language:nil, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? + fail ArgumentError, 'detect_orientation is nil' if detect_orientation.nil? fail ArgumentError, 'image is nil' if image.nil? @@ -1956,14 +2551,14 @@ def tag_image_in_stream_async(image, language:nil, custom_headers:nil) } request_content = self.serialize(request_mapper, image) - path_template = 'tag' + path_template = 'ocr' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'language' => language}, + query_params: {'detectOrientation' => detect_orientation,'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url @@ -1984,7 +2579,7 @@ def tag_image_in_stream_async(image, language:nil, custom_headers:nil) if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -1998,16 +2593,19 @@ def tag_image_in_stream_async(image, language:nil, custom_headers:nil) end # - # This operation recognizes content within an image by applying a - # domain-specific model. The list of domain-specific models that are supported - # by the Computer Vision API can be retrieved using the /models GET request. - # Currently, the API only provides a single domain-specific model: celebrities. + # This operation generates a list of words, or tags, that are relevant to the + # content of the supplied image. The Computer Vision API can return tags based + # on objects, living beings, scenery or actions found in images. Unlike + # categories, tags are not organized according to a hierarchical classification + # system, but correspond to image content. Tags may contain hints to avoid + # ambiguity or provide context, for example the tag "cello" may be accompanied + # by the hint "musical instrument". All tags are in English. # Two input methods are supported -- (1) Uploading an image or (2) specifying - # an image URL. A successful response will be returned in JSON. If the request - # failed, the response will contain an error code and a message to help - # understand what went wrong. + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. # - # @param model [String] The domain-specific content to recognize. # @param image An image stream. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported @@ -2017,24 +2615,27 @@ def tag_image_in_stream_async(image, language:nil, custom_headers:nil) # @param custom_headers [Hash{String => String}] A hash of custom headers that # will be added to the HTTP request. # - # @return [DomainModelResults] operation results. + # @return [TagResult] operation results. # - def analyze_image_by_domain_in_stream(model, image, language:nil, custom_headers:nil) - response = analyze_image_by_domain_in_stream_async(model, image, language:language, custom_headers:custom_headers).value! + def tag_image_in_stream(image, language:nil, custom_headers:nil) + response = tag_image_in_stream_async(image, language:language, custom_headers:custom_headers).value! response.body unless response.nil? end # - # This operation recognizes content within an image by applying a - # domain-specific model. The list of domain-specific models that are supported - # by the Computer Vision API can be retrieved using the /models GET request. - # Currently, the API only provides a single domain-specific model: celebrities. + # This operation generates a list of words, or tags, that are relevant to the + # content of the supplied image. The Computer Vision API can return tags based + # on objects, living beings, scenery or actions found in images. Unlike + # categories, tags are not organized according to a hierarchical classification + # system, but correspond to image content. Tags may contain hints to avoid + # ambiguity or provide context, for example the tag "cello" may be accompanied + # by the hint "musical instrument". All tags are in English. # Two input methods are supported -- (1) Uploading an image or (2) specifying - # an image URL. A successful response will be returned in JSON. If the request - # failed, the response will contain an error code and a message to help - # understand what went wrong. + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. # - # @param model [String] The domain-specific content to recognize. # @param image An image stream. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported @@ -2046,21 +2647,24 @@ def analyze_image_by_domain_in_stream(model, image, language:nil, custom_headers # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def analyze_image_by_domain_in_stream_with_http_info(model, image, language:nil, custom_headers:nil) - analyze_image_by_domain_in_stream_async(model, image, language:language, custom_headers:custom_headers).value! + def tag_image_in_stream_with_http_info(image, language:nil, custom_headers:nil) + tag_image_in_stream_async(image, language:language, custom_headers:custom_headers).value! end # - # This operation recognizes content within an image by applying a - # domain-specific model. The list of domain-specific models that are supported - # by the Computer Vision API can be retrieved using the /models GET request. - # Currently, the API only provides a single domain-specific model: celebrities. + # This operation generates a list of words, or tags, that are relevant to the + # content of the supplied image. The Computer Vision API can return tags based + # on objects, living beings, scenery or actions found in images. Unlike + # categories, tags are not organized according to a hierarchical classification + # system, but correspond to image content. Tags may contain hints to avoid + # ambiguity or provide context, for example the tag "cello" may be accompanied + # by the hint "musical instrument". All tags are in English. # Two input methods are supported -- (1) Uploading an image or (2) specifying - # an image URL. A successful response will be returned in JSON. If the request - # failed, the response will contain an error code and a message to help - # understand what went wrong. + # an image URL. + # A successful response will be returned in JSON. If the request failed, the + # response will contain an error code and a message to help understand what + # went wrong. # - # @param model [String] The domain-specific content to recognize. # @param image An image stream. # @param language [Enum] The desired language for output generation. If this # parameter is not specified, the default value is "en".Supported @@ -2072,9 +2676,8 @@ def analyze_image_by_domain_in_stream_with_http_info(model, image, language:nil, # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def analyze_image_by_domain_in_stream_async(model, image, language:nil, custom_headers:nil) + def tag_image_in_stream_async(image, language:nil, custom_headers:nil) fail ArgumentError, 'endpoint is nil' if endpoint.nil? - fail ArgumentError, 'model is nil' if model.nil? fail ArgumentError, 'image is nil' if image.nil? @@ -2096,14 +2699,13 @@ def analyze_image_by_domain_in_stream_async(model, image, language:nil, custom_h } request_content = self.serialize(request_mapper, image) - path_template = 'models/{model}/analyze' + path_template = 'tag' request_url = @base_url || self.base_url request_url = request_url.gsub('{Endpoint}', endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'model' => model}, query_params: {'language' => language}, body: request_content, headers: request_headers.merge(custom_headers || {}), @@ -2125,7 +2727,7 @@ def analyze_image_by_domain_in_stream_async(model, image, language:nil, custom_h if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) - result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults.mapper() + result_mapper = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) @@ -2250,7 +2852,7 @@ def recognize_text_in_stream_async(image, mode, custom_headers:nil) # def add_telemetry sdk_information = 'azure_cognitiveservices_computervision' - sdk_information = "#{sdk_information}/0.17.0" + sdk_information = "#{sdk_information}/0.18.0" add_user_agent_information(sdk_information) end end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb index 3f3901f1cf..26a6513061 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb @@ -17,11 +17,11 @@ class AdultInfo # adult-oriented content. attr_accessor :is_adult_content - # @return [Boolean] A value indicating if the image is race. + # @return [Boolean] A value indicating if the image is racy. attr_accessor :is_racy_content - # @return [Float] Score from 0 to 1 that indicates how much of adult - # content is within the image. + # @return [Float] Score from 0 to 1 that indicates how much the content + # is considered adult-oriented within the image. attr_accessor :adult_score # @return [Float] Score from 0 to 1 that indicates how suggestive is the diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/area_of_interest_result.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/area_of_interest_result.rb new file mode 100644 index 0000000000..b05a793a74 --- /dev/null +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/area_of_interest_result.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. + +module Azure::CognitiveServices::ComputerVision::V2_0 + module Models + # + # Result of AreaOfInterest operation. + # + class AreaOfInterestResult + + include MsRestAzure + + # @return [BoundingRect] A bounding box for an area of interest inside an + # image. + attr_accessor :area_of_interest + + # @return [String] Id of the REST API request. + attr_accessor :request_id + + # @return [ImageMetadata] + attr_accessor :metadata + + + # + # Mapper for AreaOfInterestResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AreaOfInterestResult', + type: { + name: 'Composite', + class_name: 'AreaOfInterestResult', + model_properties: { + area_of_interest: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'areaOfInterest', + type: { + name: 'Composite', + class_name: 'BoundingRect' + } + }, + request_id: { + client_side_validation: true, + required: false, + serialized_name: 'requestId', + type: { + name: 'String' + } + }, + metadata: { + client_side_validation: true, + required: false, + serialized_name: 'metadata', + type: { + name: 'Composite', + class_name: 'ImageMetadata' + } + } + } + } + } + end + end + end +end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/bounding_rect.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/bounding_rect.rb new file mode 100644 index 0000000000..fdb364a0e7 --- /dev/null +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/bounding_rect.rb @@ -0,0 +1,83 @@ +# 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::CognitiveServices::ComputerVision::V2_0 + module Models + # + # A bounding box for an area inside an image. + # + class BoundingRect + + include MsRestAzure + + # @return [Integer] X-coordinate of the top left point of the area, in + # pixels. + attr_accessor :x + + # @return [Integer] Y-coordinate of the top left point of the area, in + # pixels. + attr_accessor :y + + # @return [Integer] Width measured from the top-left point of the area, + # in pixels. + attr_accessor :w + + # @return [Integer] Height measured from the top-left point of the area, + # in pixels. + attr_accessor :h + + + # + # Mapper for BoundingRect class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'BoundingRect', + type: { + name: 'Composite', + class_name: 'BoundingRect', + model_properties: { + x: { + client_side_validation: true, + required: false, + serialized_name: 'x', + type: { + name: 'Number' + } + }, + y: { + client_side_validation: true, + required: false, + serialized_name: 'y', + type: { + name: 'Number' + } + }, + w: { + client_side_validation: true, + required: false, + serialized_name: 'w', + type: { + name: 'Number' + } + }, + h: { + client_side_validation: true, + required: false, + serialized_name: 'h', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/category.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/category.rb index fe7482bcc9..5fbfe23ce5 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/category.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/category.rb @@ -18,7 +18,7 @@ class Category # @return [Float] Scoring of the category. attr_accessor :score - # @return [CategoryDetail] + # @return [CategoryDetail] Details of the identified category. attr_accessor :detail diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb index 00b1ada23e..e0ec31acd6 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb @@ -15,10 +15,11 @@ class CelebritiesModel # @return [String] Name of the celebrity. attr_accessor :name - # @return [Float] Level of confidence ranging from 0 to 1. + # @return [Float] Confidence level for the celebrity recognition as a + # value ranging from 0 to 1. attr_accessor :confidence - # @return [FaceRectangle] + # @return [FaceRectangle] Location of the identified face in the image. attr_accessor :face_rectangle diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb index e224bafb26..0bdac70600 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb @@ -6,13 +6,14 @@ module Azure::CognitiveServices::ComputerVision::V2_0 module Models # - # List of celebrities recognized in the image. + # Result of domain-specific classifications for the domain of celebrities. # class CelebrityResults include MsRestAzure - # @return [Array] + # @return [Array] List of celebrities recognized in the + # image. attr_accessor :celebrities # @return [String] Id of the REST API request. diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb index 919d8f73a7..7ffd4bd062 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb @@ -6,18 +6,13 @@ module Azure::CognitiveServices::ComputerVision::V2_0 module Models # - # Model object. - # + # Details about the API request error. # class ComputerVisionError include MsRestAzure - # @return [ComputerVisionErrorCodes] The error code. Possible values - # include: 'InvalidImageUrl', 'InvalidImageFormat', 'InvalidImageSize', - # 'NotSupportedVisualFeature', 'NotSupportedImage', 'InvalidDetails', - # 'NotSupportedLanguage', 'BadArgument', 'FailedToProcess', 'Timeout', - # 'InternalServerError', 'Unspecified', 'StorageException' + # @return The error code. attr_accessor :code # @return [String] A message explaining the error reported by the @@ -46,8 +41,7 @@ def self.mapper() required: true, serialized_name: 'code', type: { - name: 'Enum', - module: 'ComputerVisionErrorCodes' + name: 'Object' } }, message: { diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error_codes.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error_codes.rb deleted file mode 100644 index 86266d36aa..0000000000 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error_codes.rb +++ /dev/null @@ -1,27 +0,0 @@ -# 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::CognitiveServices::ComputerVision::V2_0 - module Models - # - # Defines values for ComputerVisionErrorCodes - # - module ComputerVisionErrorCodes - InvalidImageUrl = "InvalidImageUrl" - InvalidImageFormat = "InvalidImageFormat" - InvalidImageSize = "InvalidImageSize" - NotSupportedVisualFeature = "NotSupportedVisualFeature" - NotSupportedImage = "NotSupportedImage" - InvalidDetails = "InvalidDetails" - NotSupportedLanguage = "NotSupportedLanguage" - BadArgument = "BadArgument" - FailedToProcess = "FailedToProcess" - Timeout = "Timeout" - InternalServerError = "InternalServerError" - Unspecified = "Unspecified" - StorageException = "StorageException" - end - end -end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/detect_result.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/detect_result.rb new file mode 100644 index 0000000000..bcd53c4f9e --- /dev/null +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/detect_result.rb @@ -0,0 +1,79 @@ +# 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::CognitiveServices::ComputerVision::V2_0 + module Models + # + # Result of a DetectImage call. + # + class DetectResult + + include MsRestAzure + + # @return [Array] An array of detected objects. + attr_accessor :objects + + # @return [String] Id of the REST API request. + attr_accessor :request_id + + # @return [ImageMetadata] + attr_accessor :metadata + + + # + # Mapper for DetectResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DetectResult', + type: { + name: 'Composite', + class_name: 'DetectResult', + model_properties: { + objects: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'objects', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DetectedObjectElementType', + type: { + name: 'Composite', + class_name: 'DetectedObject' + } + } + } + }, + request_id: { + client_side_validation: true, + required: false, + serialized_name: 'requestId', + type: { + name: 'String' + } + }, + metadata: { + client_side_validation: true, + required: false, + serialized_name: 'metadata', + type: { + name: 'Composite', + class_name: 'ImageMetadata' + } + } + } + } + } + end + end + end +end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/detected_object.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/detected_object.rb new file mode 100644 index 0000000000..0d66fb9532 --- /dev/null +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/detected_object.rb @@ -0,0 +1,86 @@ +# 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::CognitiveServices::ComputerVision::V2_0 + module Models + # + # An object detected in an image. + # + class DetectedObject + + include MsRestAzure + + # @return [BoundingRect] Approximate location of the detected object. + attr_accessor :rectangle + + # @return [String] Label for the object. + attr_accessor :object + + # @return [Float] Confidence score of having observed the object in the + # image, as a value ranging from 0 to 1. + attr_accessor :confidence + + # @return [ObjectHierarchy] The parent object, from a taxonomy + # perspective. + # The parent object is a more generic form of this object. For example, + # a 'bulldog' would have a parent of 'dog'. + attr_accessor :parent + + + # + # Mapper for DetectedObject class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DetectedObject', + type: { + name: 'Composite', + class_name: 'DetectedObject', + model_properties: { + rectangle: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'rectangle', + type: { + name: 'Composite', + class_name: 'BoundingRect' + } + }, + object: { + client_side_validation: true, + required: false, + serialized_name: 'object', + type: { + name: 'String' + } + }, + confidence: { + client_side_validation: true, + required: false, + serialized_name: 'confidence', + type: { + name: 'Double' + } + }, + parent: { + client_side_validation: true, + required: false, + serialized_name: 'parent', + type: { + name: 'Composite', + class_name: 'ObjectHierarchy' + } + } + } + } + } + end + end + end +end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/domain_model_results.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/domain_model_results.rb index f061bec2d5..1b50199f4d 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/domain_model_results.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/domain_model_results.rb @@ -13,7 +13,7 @@ class DomainModelResults include MsRestAzure - # @return Model-specific response + # @return Model-specific response. attr_accessor :result # @return [String] Id of the REST API request. diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb index 93ceb7eecb..a85b81ffbe 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb @@ -19,7 +19,8 @@ class FaceDescription # 'Male', 'Female' attr_accessor :gender - # @return [FaceRectangle] + # @return [FaceRectangle] Rectangle in the image containing the + # identified face. attr_accessor :face_rectangle diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_rectangle.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_rectangle.rb index 294e7ac2c2..7ea166f89f 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_rectangle.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/face_rectangle.rb @@ -12,16 +12,20 @@ class FaceRectangle include MsRestAzure - # @return [Integer] X-coordinate of the top left point of the face. + # @return [Integer] X-coordinate of the top left point of the face, in + # pixels. attr_accessor :left - # @return [Integer] Y-coordinate of the top left point of the face. + # @return [Integer] Y-coordinate of the top left point of the face, in + # pixels. attr_accessor :top - # @return [Integer] Width measured from the top-left point of the face. + # @return [Integer] Width measured from the top-left point of the face, + # in pixels. attr_accessor :width - # @return [Integer] Height measured from the top-left point of the face. + # @return [Integer] Height measured from the top-left point of the face, + # in pixels. attr_accessor :height diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_analysis.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_analysis.rb index 6caa9032d7..28d5723643 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_analysis.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_analysis.rb @@ -15,26 +15,34 @@ class ImageAnalysis # @return [Array] An array indicating identified categories. attr_accessor :categories - # @return [AdultInfo] + # @return [AdultInfo] An object describing whether the image contains + # adult-oriented content and/or is racy. attr_accessor :adult - # @return [ColorInfo] + # @return [ColorInfo] An object providing additional metadata describing + # color attributes. attr_accessor :color - # @return [ImageType] + # @return [ImageType] An object providing possible image types and + # matching confidence levels. attr_accessor :image_type # @return [Array] A list of tags with confidence level. attr_accessor :tags - # @return [ImageDescriptionDetails] + # @return [ImageDescriptionDetails] A collection of content tags, along + # with a list of captions sorted by confidence level, and image metadata. attr_accessor :description # @return [Array] An array of possible faces within the # image. attr_accessor :faces - # @return [String] Id of the request for tracking purposes. + # @return [Array] Array of objects describing what was + # detected in the image. + attr_accessor :objects + + # @return [String] Id of the REST API request. attr_accessor :request_id # @return [ImageMetadata] @@ -141,6 +149,23 @@ def self.mapper() } } }, + objects: { + client_side_validation: true, + required: false, + serialized_name: 'objects', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DetectedObjectElementType', + type: { + name: 'Composite', + class_name: 'DetectedObject' + } + } + } + }, request_id: { client_side_validation: true, required: false, diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_caption.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_caption.rb index 4729968634..86f49e4b4a 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_caption.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_caption.rb @@ -12,10 +12,10 @@ class ImageCaption include MsRestAzure - # @return [String] The text of the caption + # @return [String] The text of the caption. attr_accessor :text - # @return [Float] The level of confidence the service has in the caption + # @return [Float] The level of confidence the service has in the caption. attr_accessor :confidence diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_metadata.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_metadata.rb index 7e9ffe3e5b..8ae3213825 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_metadata.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_metadata.rb @@ -6,19 +6,19 @@ module Azure::CognitiveServices::ComputerVision::V2_0 module Models # - # Image metadata + # Image metadata. # class ImageMetadata include MsRestAzure - # @return [Integer] Image width + # @return [Integer] Image width, in pixels. attr_accessor :width - # @return [Integer] Image height + # @return [Integer] Image height, in pixels. attr_accessor :height - # @return [String] Image format + # @return [String] Image format. attr_accessor :format diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_tag.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_tag.rb index df350f080d..39afaada07 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_tag.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_tag.rb @@ -6,19 +6,19 @@ module Azure::CognitiveServices::ComputerVision::V2_0 module Models # - # An image caption, i.e. a brief description of what the image depicts. + # An entity observation in the image, along with the confidence score. # class ImageTag include MsRestAzure - # @return [String] The tag value + # @return [String] Name of the entity. attr_accessor :name - # @return [Float] The level of confidence the service has in the caption + # @return [Float] The level of confidence that the entity was observed. attr_accessor :confidence - # @return [String] Optional categorization for the tag + # @return [String] Optional hint/details for this tag. attr_accessor :hint diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb index b056fae590..48a110b431 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb @@ -12,10 +12,10 @@ class ImageType include MsRestAzure - # @return [Float] Confidence level that the image is a clip art. + # @return [Integer] Confidence level that the image is a clip art. attr_accessor :clip_art_type - # @return [Float] Confidence level that the image is a line drawing. + # @return [Integer] Confidence level that the image is a line drawing. attr_accessor :line_drawing_type @@ -37,7 +37,7 @@ def self.mapper() required: false, serialized_name: 'clipArtType', type: { - name: 'Double' + name: 'Number' } }, line_drawing_type: { @@ -45,7 +45,7 @@ def self.mapper() required: false, serialized_name: 'lineDrawingType', type: { - name: 'Double' + name: 'Number' } } } diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb index 001a298dc8..d4d70f28a2 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb @@ -13,7 +13,7 @@ class ImageUrl include MsRestAzure - # @return [String] Publicly reachable URL of an image + # @return [String] Publicly reachable URL of an image. attr_accessor :url diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.rb index 583eb89e43..71201951da 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.rb @@ -6,13 +6,14 @@ module Azure::CognitiveServices::ComputerVision::V2_0 module Models # - # List of landmarks recognized in the image. + # Result of domain-specific classifications for the domain of landmarks. # class LandmarkResults include MsRestAzure - # @return [Array] + # @return [Array] List of landmarks recognized in the + # image. attr_accessor :landmarks # @return [String] Id of the REST API request. diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmarks_model.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmarks_model.rb index 2fc14db0e4..0c2e5c8878 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmarks_model.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/landmarks_model.rb @@ -6,7 +6,7 @@ module Azure::CognitiveServices::ComputerVision::V2_0 module Models # - # A landmark recognized in the image + # A landmark recognized in the image. # class LandmarksModel @@ -15,7 +15,8 @@ class LandmarksModel # @return [String] Name of the landmark. attr_accessor :name - # @return [Float] Confidence level for the landmark recognition. + # @return [Float] Confidence level for the landmark recognition as a + # value ranging from 0 to 1. attr_accessor :confidence diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/model_description.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/model_description.rb index 07240d9754..84f992fb2b 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/model_description.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/model_description.rb @@ -12,10 +12,10 @@ class ModelDescription include MsRestAzure - # @return [String] + # @return [String] The name of the model. attr_accessor :name - # @return [Array] + # @return [Array] Categories of the model. attr_accessor :categories diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/object_hierarchy.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/object_hierarchy.rb new file mode 100644 index 0000000000..40b2ec9e7b --- /dev/null +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/object_hierarchy.rb @@ -0,0 +1,73 @@ +# 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::CognitiveServices::ComputerVision::V2_0 + module Models + # + # An object detected inside an image. + # + class ObjectHierarchy + + include MsRestAzure + + # @return [String] Label for the object. + attr_accessor :object + + # @return [Float] Confidence score of having observed the object in the + # image, as a value ranging from 0 to 1. + attr_accessor :confidence + + # @return [ObjectHierarchy] The parent object, from a taxonomy + # perspective. + # The parent object is a more generic form of this object. For example, + # a 'bulldog' would have a parent of 'dog'. + attr_accessor :parent + + + # + # Mapper for ObjectHierarchy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ObjectHierarchy', + type: { + name: 'Composite', + class_name: 'ObjectHierarchy', + model_properties: { + object: { + client_side_validation: true, + required: false, + serialized_name: 'object', + type: { + name: 'String' + } + }, + confidence: { + client_side_validation: true, + required: false, + serialized_name: 'confidence', + type: { + name: 'Double' + } + }, + parent: { + client_side_validation: true, + required: false, + serialized_name: 'parent', + type: { + name: 'Composite', + class_name: 'ObjectHierarchy' + } + } + } + } + } + end + end + end +end diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_region.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_region.rb index d32a234e3e..e3d1617fa1 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_region.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_region.rb @@ -21,7 +21,7 @@ class OcrRegion # origin at the top-left corner, and the y-axis pointing down. attr_accessor :bounding_box - # @return [Array] + # @return [Array] An array of recognized lines of text. attr_accessor :lines diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb index 104a5c2aa3..65e7494843 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb @@ -29,9 +29,9 @@ class OcrResult attr_accessor :text_angle # @return [String] Orientation of the text recognized in the image. The - # value (up,down,left, or right) refers to the direction that the top of - # the recognized text is facing, after the image has been rotated around - # its center according to the detected text angle (see textAngle + # value (up, down, left, or right) refers to the direction that the top + # of the recognized text is facing, after the image has been rotated + # around its center according to the detected text angle (see textAngle # property). attr_accessor :orientation diff --git a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/visual_feature_types.rb b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/visual_feature_types.rb index 2f4f2df0b6..bb083135fa 100644 --- a/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/visual_feature_types.rb +++ b/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/models/visual_feature_types.rb @@ -16,6 +16,7 @@ module VisualFeatureTypes Color = "Color" Tags = "Tags" Description = "Description" + Objects = "Objects" end end end diff --git a/data/azure_cognitiveservices_computervision/lib/profiles/latest/modules/computervision_profile_module.rb b/data/azure_cognitiveservices_computervision/lib/profiles/latest/modules/computervision_profile_module.rb index 84e542cd6d..807a619372 100644 --- a/data/azure_cognitiveservices_computervision/lib/profiles/latest/modules/computervision_profile_module.rb +++ b/data/azure_cognitiveservices_computervision/lib/profiles/latest/modules/computervision_profile_module.rb @@ -7,42 +7,46 @@ module Azure::ComputerVision::Profiles::Latest module Models - FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription - ImageMetadata = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata - Line = Azure::CognitiveServices::ComputerVision::V2_0::Models::Line - ImageAnalysis = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis - TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult + DetectResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectResult + FaceRectangle = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle + ModelDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription + LandmarksModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel + ListModelsResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult + Category = Azure::CognitiveServices::ComputerVision::V2_0::Models::Category + DomainModelResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults + ColorInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo OcrWord = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrWord - CelebritiesModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel + ImageTag = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag OcrLine = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLine - CategoryDetail = Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail + ImageDescriptionDetails = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails OcrRegion = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrRegion - AdultInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo + BoundingRect = Azure::CognitiveServices::ComputerVision::V2_0::Models::BoundingRect OcrResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult - ImageType = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType - ModelDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription + DetectedObject = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedObject + TagResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult + ImageAnalysis = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis + AreaOfInterestResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult + CelebritiesModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel + ImageUrl = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl + AdultInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo + ComputerVisionError = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError ImageCaption = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption - ListModelsResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult - Word = Azure::CognitiveServices::ComputerVision::V2_0::Models::Word - DomainModelResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults - FaceRectangle = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle - CelebrityResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults - Category = Azure::CognitiveServices::ComputerVision::V2_0::Models::Category LandmarkResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults - ImageTag = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag + ObjectHierarchy = Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy + CelebrityResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults ImageDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription + Word = Azure::CognitiveServices::ComputerVision::V2_0::Models::Word + ImageType = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType + Line = Azure::CognitiveServices::ComputerVision::V2_0::Models::Line + ImageMetadata = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata RecognitionResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult - TagResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult - ColorInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo - ComputerVisionError = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError - LandmarksModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel - ImageUrl = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl - ImageDescriptionDetails = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails - TextOperationStatusCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes + FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription + TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult + CategoryDetail = Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail Gender = Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender - ComputerVisionErrorCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionErrorCodes - VisualFeatureTypes = Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes + TextOperationStatusCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes OcrLanguages = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages + VisualFeatureTypes = Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes TextRecognitionMode = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionMode Details = Azure::CognitiveServices::ComputerVision::V2_0::Models::Details end @@ -91,114 +95,126 @@ def method_missing(method, *args) end class ModelClasses - def face_description - Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription + def detect_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectResult end - def image_metadata - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata + def face_rectangle + Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle end - def line - Azure::CognitiveServices::ComputerVision::V2_0::Models::Line + def model_description + Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription end - def image_analysis - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis + def landmarks_model + Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel end - def text_operation_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult + def list_models_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult + end + def category + Azure::CognitiveServices::ComputerVision::V2_0::Models::Category + end + def domain_model_results + Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults + end + def color_info + Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo end def ocr_word Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrWord end - def celebrities_model - Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel + def image_tag + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag end def ocr_line Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLine end - def category_detail - Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail + def image_description_details + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails end def ocr_region Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrRegion end - def adult_info - Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo + def bounding_rect + Azure::CognitiveServices::ComputerVision::V2_0::Models::BoundingRect end def ocr_result Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult end - def image_type - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType + def detected_object + Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedObject end - def model_description - Azure::CognitiveServices::ComputerVision::V2_0::Models::ModelDescription + def tag_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult end - def image_caption - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption + def image_analysis + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis end - def list_models_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::ListModelsResult + def area_of_interest_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult end - def word - Azure::CognitiveServices::ComputerVision::V2_0::Models::Word + def celebrities_model + Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel end - def domain_model_results - Azure::CognitiveServices::ComputerVision::V2_0::Models::DomainModelResults + def image_url + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl end - def face_rectangle - Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceRectangle + def adult_info + Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo end - def celebrity_results - Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults + def computer_vision_error + Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError end - def category - Azure::CognitiveServices::ComputerVision::V2_0::Models::Category + def image_caption + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption end def landmark_results Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults end - def image_tag - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageTag + def object_hierarchy + Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy + end + def celebrity_results + Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults end def image_description Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription end - def recognition_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult + def word + Azure::CognitiveServices::ComputerVision::V2_0::Models::Word end - def tag_result - Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult + def image_type + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType end - def color_info - Azure::CognitiveServices::ComputerVision::V2_0::Models::ColorInfo + def line + Azure::CognitiveServices::ComputerVision::V2_0::Models::Line end - def computer_vision_error - Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError + def image_metadata + Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata end - def landmarks_model - Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarksModel + def recognition_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult end - def image_url - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl + def face_description + Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription end - def image_description_details - Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescriptionDetails + def text_operation_result + Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult end - def text_operation_status_codes - Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes + def category_detail + Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail end def gender Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender end - def computer_vision_error_codes - Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionErrorCodes - end - def visual_feature_types - Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes + def text_operation_status_codes + Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes end def ocr_languages Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages end + def visual_feature_types + Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes + end def text_recognition_mode Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionMode end diff --git a/data/azure_cognitiveservices_computervision/lib/version.rb b/data/azure_cognitiveservices_computervision/lib/version.rb index 49ef857518..ef4a8b452a 100644 --- a/data/azure_cognitiveservices_computervision/lib/version.rb +++ b/data/azure_cognitiveservices_computervision/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::CognitiveServices::ComputerVision - VERSION = '0.17.0' + VERSION = '0.18.0' end diff --git a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb index 07fd50d243..7bd9658734 100644 --- a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +++ b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb @@ -212,7 +212,7 @@ def make_request_async(method, path, options = {}) # def add_telemetry sdk_information = 'azure_mgmt_devtestlabs' - sdk_information = "#{sdk_information}/0.17.1" + sdk_information = "#{sdk_information}/0.17.2" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb index 2f1fe406b2..7a11ab551e 100644 --- a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +++ b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb @@ -12,7 +12,7 @@ class AttachNewDataDiskOptions include MsRestAzure - # @return [Integer] Size of the disk to be attached in GibiBytes. + # @return [Integer] Size of the disk to be attached in Gibibytes. attr_accessor :disk_size_gi_b # @return [String] The name of the disk to be attached. diff --git a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/disk.rb b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/disk.rb index 75c705679f..2933d1b97f 100644 --- a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/disk.rb +++ b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/disk.rb @@ -16,7 +16,7 @@ class Disk < Resource # Premium). Possible values include: 'Standard', 'Premium' attr_accessor :disk_type - # @return [Integer] The size of the disk in GibiBytes. + # @return [Integer] The size of the disk in Gibibytes. attr_accessor :disk_size_gi_b # @return [String] The resource ID of the VM to which this disk is diff --git a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb index c769fb1f00..6799368fc1 100644 --- a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +++ b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb @@ -6,7 +6,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15 module Models # - # Reponse body for generating an upload URI. + # Response body for generating an upload URI. # class GenerateUploadUriResponse diff --git a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/notification_channels.rb b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/notification_channels.rb index 452f6db842..25dc5f2c50 100644 --- a/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/notification_channels.rb +++ b/management/azure_mgmt_devtestlabs/lib/2016-05-15/generated/azure_mgmt_devtestlabs/notification_channels.rb @@ -22,7 +22,7 @@ def initialize(client) attr_reader :client # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -44,7 +44,7 @@ def list(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby end # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -65,7 +65,7 @@ def list_with_http_info(resource_group_name, lab_name, expand:nil, filter:nil, t end # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -135,7 +135,7 @@ def list_async(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, o end # - # Get notificationchannel. + # Get notification channels. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -153,7 +153,7 @@ def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) end # - # Get notificationchannel. + # Get notification channels. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -170,7 +170,7 @@ def get_with_http_info(resource_group_name, lab_name, name, expand:nil, custom_h end # - # Get notificationchannel. + # Get notification channels. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -354,7 +354,7 @@ def create_or_update_async(resource_group_name, lab_name, name, notification_cha end # - # Delete notificationchannel. + # Delete notification channel. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -369,7 +369,7 @@ def delete(resource_group_name, lab_name, name, custom_headers:nil) end # - # Delete notificationchannel. + # Delete notification channel. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -384,7 +384,7 @@ def delete_with_http_info(resource_group_name, lab_name, name, custom_headers:ni end # - # Delete notificationchannel. + # Delete notification channel. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -439,7 +439,7 @@ def delete_async(resource_group_name, lab_name, name, custom_headers:nil) end # - # Modify properties of notificationchannels. + # Modify properties of notification channels. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -456,7 +456,7 @@ def update(resource_group_name, lab_name, name, notification_channel, custom_hea end # - # Modify properties of notificationchannels. + # Modify properties of notification channels. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -472,7 +472,7 @@ def update_with_http_info(resource_group_name, lab_name, name, notification_chan end # - # Modify properties of notificationchannels. + # Modify properties of notification channels. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. @@ -645,7 +645,7 @@ def notify_async(resource_group_name, lab_name, name, notify_parameters, custom_ end # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. @@ -660,7 +660,7 @@ def list_next(next_page_link, custom_headers:nil) end # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. @@ -674,7 +674,7 @@ def list_next_with_http_info(next_page_link, custom_headers:nil) end # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param next_page_link [String] The NextLink from the previous successful call # to List operation. @@ -733,7 +733,7 @@ def list_next_async(next_page_link, custom_headers:nil) end # - # List notificationchannels in a given lab. + # List notification channels in a given lab. # # @param resource_group_name [String] The name of the resource group. # @param lab_name [String] The name of the lab. diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs.rb new file mode 100644 index 0000000000..39368d554b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs.rb @@ -0,0 +1,241 @@ +# 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 '2018-09-15/generated/azure_mgmt_devtestlabs/module_definition' +require 'ms_rest_azure' + +module Azure::DevTestLabs::Mgmt::V2018_09_15 + autoload :ProviderOperations, '2018-09-15/generated/azure_mgmt_devtestlabs/provider_operations.rb' + autoload :Labs, '2018-09-15/generated/azure_mgmt_devtestlabs/labs.rb' + autoload :Operations, '2018-09-15/generated/azure_mgmt_devtestlabs/operations.rb' + autoload :GlobalSchedules, '2018-09-15/generated/azure_mgmt_devtestlabs/global_schedules.rb' + autoload :ArtifactSources, '2018-09-15/generated/azure_mgmt_devtestlabs/artifact_sources.rb' + autoload :ArmTemplates, '2018-09-15/generated/azure_mgmt_devtestlabs/arm_templates.rb' + autoload :Artifacts, '2018-09-15/generated/azure_mgmt_devtestlabs/artifacts.rb' + autoload :Costs, '2018-09-15/generated/azure_mgmt_devtestlabs/costs.rb' + autoload :CustomImages, '2018-09-15/generated/azure_mgmt_devtestlabs/custom_images.rb' + autoload :Formulas, '2018-09-15/generated/azure_mgmt_devtestlabs/formulas.rb' + autoload :GalleryImages, '2018-09-15/generated/azure_mgmt_devtestlabs/gallery_images.rb' + autoload :NotificationChannels, '2018-09-15/generated/azure_mgmt_devtestlabs/notification_channels.rb' + autoload :PolicySets, '2018-09-15/generated/azure_mgmt_devtestlabs/policy_sets.rb' + autoload :Policies, '2018-09-15/generated/azure_mgmt_devtestlabs/policies.rb' + autoload :Schedules, '2018-09-15/generated/azure_mgmt_devtestlabs/schedules.rb' + autoload :ServiceRunners, '2018-09-15/generated/azure_mgmt_devtestlabs/service_runners.rb' + autoload :Users, '2018-09-15/generated/azure_mgmt_devtestlabs/users.rb' + autoload :Disks, '2018-09-15/generated/azure_mgmt_devtestlabs/disks.rb' + autoload :Environments, '2018-09-15/generated/azure_mgmt_devtestlabs/environments.rb' + autoload :Secrets, '2018-09-15/generated/azure_mgmt_devtestlabs/secrets.rb' + autoload :ServiceFabrics, '2018-09-15/generated/azure_mgmt_devtestlabs/service_fabrics.rb' + autoload :ServiceFabricSchedules, '2018-09-15/generated/azure_mgmt_devtestlabs/service_fabric_schedules.rb' + autoload :VirtualMachines, '2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb' + autoload :VirtualMachineSchedules, '2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb' + autoload :VirtualNetworks, '2018-09-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb' + autoload :DevTestLabsClient, '2018-09-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb' + + module Models + autoload :SharedPublicIpAddressConfiguration, '2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb' + autoload :WeekDetails, '2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details.rb' + autoload :NetworkInterfaceProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb' + autoload :HourDetails, '2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details.rb' + autoload :ScheduleCreationParameter, '2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter.rb' + autoload :EnvironmentDeploymentPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties_fragment.rb' + autoload :VirtualNetworkList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_list.rb' + autoload :Subnet, '2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet.rb' + autoload :DayDetailsFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details_fragment.rb' + autoload :DtlEnvironmentList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_list.rb' + autoload :NotificationSettingsFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb' + autoload :EvaluatePoliciesProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb' + autoload :UserSecretStoreFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb' + autoload :EvaluatePoliciesRequest, '2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb' + autoload :ArtifactInstallProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb' + autoload :PolicyViolation, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_violation.rb' + autoload :ParametersValueFileInfo, '2018-09-15/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb' + autoload :PolicySetResult, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb' + autoload :ArmTemplateInfo, '2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb' + autoload :EvaluatePoliciesResponse, '2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb' + autoload :ArmTemplateParameterProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb' + autoload :Event, '2018-09-15/generated/azure_mgmt_devtestlabs/models/event.rb' + autoload :UserSecretStore, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb' + autoload :EventFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/event_fragment.rb' + autoload :ArtifactDeploymentStatusPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb' + autoload :ExportResourceUsageParameters, '2018-09-15/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb' + autoload :ArtifactInstallPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb' + autoload :ExternalSubnet, '2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet.rb' + autoload :UserIdentity, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity.rb' + autoload :ExternalSubnetFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb' + autoload :ArtifactSourceList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_list.rb' + autoload :GalleryImageReference, '2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb' + autoload :AttachNewDataDiskOptions, '2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb' + autoload :InboundNatRule, '2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb' + autoload :BulkCreationParameters, '2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb' + autoload :DayDetails, '2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details.rb' + autoload :NotificationSettings, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings.rb' + autoload :ComputeDataDisk, '2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb' + autoload :ShutdownNotificationContent, '2018-09-15/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb' + autoload :ComputeVmInstanceViewStatus, '2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb' + autoload :LabVirtualMachineCreationParameter, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb' + autoload :ComputeVmProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb' + autoload :FormulaPropertiesFromVm, '2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb' + autoload :PercentageCostThresholdProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb' + autoload :ServiceRunnerList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner_list.rb' + autoload :WindowsOsInfo, '2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb' + autoload :GalleryImageReferenceFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb' + autoload :CustomImagePropertiesFromVm, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb' + autoload :InboundNatRuleFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb' + autoload :DataDiskStorageTypeInfo, '2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info.rb' + autoload :SharedPublicIpAddressConfigurationFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb' + autoload :SubnetOverrideFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb' + autoload :NetworkInterfacePropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb' + autoload :LinuxOsInfoFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info_fragment.rb' + autoload :ScheduleCreationParameterFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter_fragment.rb' + autoload :CustomImagePropertiesCustomFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom_fragment.rb' + autoload :LabVirtualMachineCreationParameterFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter_fragment.rb' + autoload :CustomImagePropertiesFromPlanFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan_fragment.rb' + autoload :FormulaPropertiesFromVmFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm_fragment.rb' + autoload :CustomImageList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_list.rb' + autoload :ServiceFabricList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_list.rb' + autoload :DataDiskPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties_fragment.rb' + autoload :FormulaList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_list.rb' + autoload :DetachDiskProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb' + autoload :SecretList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_list.rb' + autoload :SubnetSharedPublicIpAddressConfiguration, '2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb' + autoload :GalleryImageList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_list.rb' + autoload :EnvironmentDeploymentProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb' + autoload :ParameterInfo, '2018-09-15/generated/azure_mgmt_devtestlabs/models/parameter_info.rb' + autoload :WeekDetailsFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb' + autoload :GenerateArmTemplateRequest, '2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb' + autoload :UserList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user_list.rb' + autoload :GenerateUploadUriParameter, '2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb' + autoload :ApplyArtifactsRequest, '2018-09-15/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb' + autoload :GenerateUploadUriResponse, '2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb' + autoload :ArmTemplateList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_list.rb' + autoload :IdentityProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb' + autoload :ArtifactDeploymentStatusProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb' + autoload :ImportLabVirtualMachineRequest, '2018-09-15/generated/azure_mgmt_devtestlabs/models/import_lab_virtual_machine_request.rb' + autoload :ArtifactList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_list.rb' + autoload :LabAnnouncementProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties.rb' + autoload :AttachDiskProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb' + autoload :LabSupportProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties.rb' + autoload :BulkCreationParametersFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters_fragment.rb' + autoload :ScheduleList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_list.rb' + autoload :ComputeDataDiskFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb' + autoload :LabAnnouncementPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties_fragment.rb' + autoload :ComputeVmPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb' + autoload :TargetCostProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb' + autoload :LinuxOsInfo, '2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb' + autoload :LabCostSummaryProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb' + autoload :CustomImagePropertiesFromPlan, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan.rb' + autoload :LabCostDetailsProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_details_properties.rb' + autoload :CustomImagePropertiesFromVmFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm_fragment.rb' + autoload :LabResourceCostProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_resource_cost_properties.rb' + autoload :SubnetSharedPublicIpAddressConfigurationFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb' + autoload :RetargetScheduleProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb' + autoload :DetachDataDiskProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb' + autoload :LabSupportPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties_fragment.rb' + autoload :DiskList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_list.rb' + autoload :Resource, '2018-09-15/generated/azure_mgmt_devtestlabs/models/resource.rb' + autoload :HourDetailsFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb' + autoload :LabList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_list.rb' + autoload :UserIdentityFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb' + autoload :LabVhd, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb' + autoload :ArtifactParameterPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb' + autoload :LabVhdList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd_list.rb' + autoload :AttachNewDataDiskOptionsFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options_fragment.rb' + autoload :ResizeLabVirtualMachineProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/resize_lab_virtual_machine_properties.rb' + autoload :ComputeVmInstanceViewStatusFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb' + autoload :RdpConnection, '2018-09-15/generated/azure_mgmt_devtestlabs/models/rdp_connection.rb' + autoload :CustomImagePropertiesCustom, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb' + autoload :LabVirtualMachineList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_list.rb' + autoload :DataDiskStorageTypeInfoFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info_fragment.rb' + autoload :ProviderOperationResult, '2018-09-15/generated/azure_mgmt_devtestlabs/models/provider_operation_result.rb' + autoload :SubnetOverride, '2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override.rb' + autoload :PortFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/port_fragment.rb' + autoload :ArtifactParameterProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb' + autoload :NotificationChannelList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_list.rb' + autoload :UpdateResource, '2018-09-15/generated/azure_mgmt_devtestlabs/models/update_resource.rb' + autoload :NotifyParameters, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb' + autoload :CostThresholdProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb' + autoload :OperationError, '2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_error.rb' + autoload :DataDiskProperties, '2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb' + autoload :OperationMetadataDisplay, '2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata_display.rb' + autoload :ArmTemplateParameterPropertiesFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties_fragment.rb' + autoload :OperationMetadata, '2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata.rb' + autoload :WindowsOsInfoFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info_fragment.rb' + autoload :OperationResult, '2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_result.rb' + autoload :Port, '2018-09-15/generated/azure_mgmt_devtestlabs/models/port.rb' + autoload :SubnetFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb' + autoload :PolicyList, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_list.rb' + autoload :Schedule, '2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule.rb' + autoload :ApplicableSchedule, '2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb' + autoload :ScheduleFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb' + autoload :ApplicableScheduleFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb' + autoload :ArmTemplate, '2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template.rb' + autoload :Artifact, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact.rb' + autoload :ArtifactSource, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source.rb' + autoload :ArtifactSourceFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb' + autoload :CustomImage, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image.rb' + autoload :CustomImageFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_fragment.rb' + autoload :Disk, '2018-09-15/generated/azure_mgmt_devtestlabs/models/disk.rb' + autoload :DiskFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_fragment.rb' + autoload :DtlEnvironment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb' + autoload :DtlEnvironmentFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_fragment.rb' + autoload :Formula, '2018-09-15/generated/azure_mgmt_devtestlabs/models/formula.rb' + autoload :FormulaFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_fragment.rb' + autoload :GalleryImage, '2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image.rb' + autoload :Lab, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab.rb' + autoload :LabCost, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost.rb' + autoload :LabFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb' + autoload :LabVirtualMachine, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb' + autoload :LabVirtualMachineFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb' + autoload :NotificationChannel, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel.rb' + autoload :NotificationChannelFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_fragment.rb' + autoload :Policy, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy.rb' + autoload :PolicyFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb' + autoload :Secret, '2018-09-15/generated/azure_mgmt_devtestlabs/models/secret.rb' + autoload :SecretFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_fragment.rb' + autoload :ServiceFabric, '2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric.rb' + autoload :ServiceFabricFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_fragment.rb' + autoload :ServiceRunner, '2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner.rb' + autoload :User, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user.rb' + autoload :UserFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/user_fragment.rb' + autoload :VirtualNetwork, '2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network.rb' + autoload :VirtualNetworkFragment, '2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb' + autoload :EnableStatus, '2018-09-15/generated/azure_mgmt_devtestlabs/models/enable_status.rb' + autoload :SourceControlType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/source_control_type.rb' + autoload :StorageType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/storage_type.rb' + autoload :CostThresholdStatus, '2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb' + autoload :WindowsOsState, '2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb' + autoload :LinuxOsState, '2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb' + autoload :CustomImageOsType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb' + autoload :HostCachingOptions, '2018-09-15/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb' + autoload :NotificationChannelEventType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb' + autoload :TransportProtocol, '2018-09-15/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb' + autoload :VirtualMachineCreationSource, '2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb' + autoload :FileUploadOptions, '2018-09-15/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb' + autoload :PremiumDataDisk, '2018-09-15/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb' + autoload :EnvironmentPermission, '2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_permission.rb' + autoload :TargetCostStatus, '2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb' + autoload :ReportingCycleType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb' + autoload :CostType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_type.rb' + autoload :HttpStatusCode, '2018-09-15/generated/azure_mgmt_devtestlabs/models/http_status_code.rb' + autoload :PolicyStatus, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_status.rb' + autoload :PolicyFactName, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb' + autoload :PolicyEvaluatorType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb' + autoload :UsagePermissionType, '2018-09-15/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb' + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/arm_templates.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/arm_templates.rb new file mode 100644 index 0000000000..06fdb56ead --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/arm_templates.rb @@ -0,0 +1,369 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class ArmTemplates + include MsRestAzure + + # + # Creates and initializes a new instance of the ArmTemplates class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List azure resource manager templates in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, artifact_source_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List azure resource manager templates in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, artifact_source_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List azure resource manager templates in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates' + + 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,'labName' => lab_name,'artifactSourceName' => artifact_source_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateList.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 + + # + # Get azure resource manager template. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the azure Resource Manager template. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArmTemplate] operation results. + # + def get(resource_group_name, lab_name, artifact_source_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, artifact_source_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get azure resource manager template. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the azure Resource Manager template. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @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, lab_name, artifact_source_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, artifact_source_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get azure resource manager template. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the azure Resource Manager template. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @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, lab_name, artifact_source_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/armtemplates/{name}' + + 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,'labName' => lab_name,'artifactSourceName' => artifact_source_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplate.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 + + # + # List azure resource manager templates in a given artifact source. + # + # @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 [ArmTemplateList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List azure resource manager templates in a given artifact source. + # + # @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:custom_headers).value! + end + + # + # List azure resource manager templates in a given artifact source. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateList.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 + + # + # List azure resource manager templates in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArmTemplateList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, artifact_source_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifact_sources.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifact_sources.rb new file mode 100644 index 0000000000..154488cbe8 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifact_sources.rb @@ -0,0 +1,673 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class ArtifactSources + include MsRestAzure + + # + # Creates and initializes a new instance of the ArtifactSources class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List artifact sources in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List artifact sources in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List artifact sources in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceList.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 + + # + # Get artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArtifactSource] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource.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 + + # + # Create or replace an existing artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param artifact_source [ArtifactSource] Properties of an artifact source. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArtifactSource] operation results. + # + def create_or_update(resource_group_name, lab_name, name, artifact_source, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, artifact_source, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param artifact_source [ArtifactSource] Properties of an artifact source. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, name, artifact_source, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, name, artifact_source, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param artifact_source [ArtifactSource] Properties of an artifact source. + # @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 create_or_update_async(resource_group_name, lab_name, name, artifact_source, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'artifact_source is nil' if artifact_source.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource.mapper() + request_content = @client.serialize(request_mapper, artifact_source) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource.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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource.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 + + # + # Delete artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @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 delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @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 delete_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources/{name}' + + 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,'labName' => lab_name,'name' => 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 == 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 + + # + # Modify properties of artifact sources. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param artifact_source [ArtifactSourceFragment] Properties of an artifact + # source. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArtifactSource] operation results. + # + def update(resource_group_name, lab_name, name, artifact_source, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, artifact_source, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of artifact sources. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param artifact_source [ArtifactSourceFragment] Properties of an artifact + # source. + # @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 update_with_http_info(resource_group_name, lab_name, name, artifact_source, custom_headers:nil) + update_async(resource_group_name, lab_name, name, artifact_source, custom_headers:custom_headers).value! + end + + # + # Modify properties of artifact sources. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the artifact source. + # @param artifact_source [ArtifactSourceFragment] Properties of an artifact + # source. + # @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 update_async(resource_group_name, lab_name, name, artifact_source, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'artifact_source is nil' if artifact_source.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceFragment.mapper() + request_content = @client.serialize(request_mapper, artifact_source) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource.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 + + # + # List artifact sources in a given lab. + # + # @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 [ArtifactSourceList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List artifact sources in a given lab. + # + # @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:custom_headers).value! + end + + # + # List artifact sources in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceList.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 + + # + # List artifact sources in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=displayName)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArtifactSourceList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifacts.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifacts.rb new file mode 100644 index 0000000000..60d5840bff --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/artifacts.rb @@ -0,0 +1,486 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Artifacts + include MsRestAzure + + # + # Creates and initializes a new instance of the Artifacts class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List artifacts in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, artifact_source_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List artifacts in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, artifact_source_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List artifacts in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts' + + 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,'labName' => lab_name,'artifactSourceName' => artifact_source_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactList.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 + + # + # Get artifact. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the artifact. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Artifact] operation results. + # + def get(resource_group_name, lab_name, artifact_source_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, artifact_source_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get artifact. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the artifact. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @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, lab_name, artifact_source_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, artifact_source_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get artifact. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the artifact. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @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, lab_name, artifact_source_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}' + + 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,'labName' => lab_name,'artifactSourceName' => artifact_source_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Artifact.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 + + # + # Generates an ARM template for the given artifact, uploads the required files + # to a storage account, and validates the generated artifact. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the artifact. + # @param generate_arm_template_request [GenerateArmTemplateRequest] Parameters + # for generating an ARM template for deploying artifacts. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArmTemplateInfo] operation results. + # + def generate_arm_template(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers:nil) + response = generate_arm_template_async(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Generates an ARM template for the given artifact, uploads the required files + # to a storage account, and validates the generated artifact. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the artifact. + # @param generate_arm_template_request [GenerateArmTemplateRequest] Parameters + # for generating an ARM template for deploying artifacts. + # @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 generate_arm_template_with_http_info(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers:nil) + generate_arm_template_async(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers:custom_headers).value! + end + + # + # Generates an ARM template for the given artifact, uploads the required files + # to a storage account, and validates the generated artifact. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param name [String] The name of the artifact. + # @param generate_arm_template_request [GenerateArmTemplateRequest] Parameters + # for generating an ARM template for deploying artifacts. + # @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 generate_arm_template_async(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'generate_arm_template_request is nil' if generate_arm_template_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateArmTemplateRequest.mapper() + request_content = @client.serialize(request_mapper, generate_arm_template_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}/generateArmTemplate' + + 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,'labName' => lab_name,'artifactSourceName' => artifact_source_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateInfo.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 + + # + # List artifacts in a given artifact source. + # + # @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 [ArtifactList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List artifacts in a given artifact source. + # + # @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:custom_headers).value! + end + + # + # List artifacts in a given artifact source. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactList.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 + + # + # List artifacts in a given artifact source. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param artifact_source_name [String] The name of the artifact source. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=title)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ArtifactList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, artifact_source_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, artifact_source_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/costs.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/costs.rb new file mode 100644 index 0000000000..8ec4c3b273 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/costs.rb @@ -0,0 +1,244 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Costs + include MsRestAzure + + # + # Creates and initializes a new instance of the Costs class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # Get cost. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the cost. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=labCostDetails)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabCost] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get cost. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the cost. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=labCostDetails)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get cost. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the cost. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=labCostDetails)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/costs/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost.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 + + # + # Create or replace an existing cost. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the cost. + # @param lab_cost [LabCost] A cost item. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabCost] operation results. + # + def create_or_update(resource_group_name, lab_name, name, lab_cost, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, lab_cost, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing cost. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the cost. + # @param lab_cost [LabCost] A cost item. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, name, lab_cost, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, name, lab_cost, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing cost. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the cost. + # @param lab_cost [LabCost] A cost item. + # @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 create_or_update_async(resource_group_name, lab_name, name, lab_cost, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'lab_cost is nil' if lab_cost.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost.mapper() + request_content = @client.serialize(request_mapper, lab_cost) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost.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::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost.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 + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/custom_images.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/custom_images.rb new file mode 100644 index 0000000000..647640a441 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/custom_images.rb @@ -0,0 +1,759 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class CustomImages + include MsRestAzure + + # + # Creates and initializes a new instance of the CustomImages class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List custom images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List custom images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List custom images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/customimages' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageList.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 + + # + # Get custom image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomImage] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get custom image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get custom image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/customimages/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage.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 + + # + # Create or replace an existing custom image. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImage] A custom image. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomImage] operation results. + # + def create_or_update(resource_group_name, lab_name, name, custom_image, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, custom_image, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImage] A custom image. + # @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_or_update_async(resource_group_name, lab_name, name, custom_image, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, name, custom_image, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage.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 + + # + # Delete custom image. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @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, lab_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Modify properties of custom images. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImageFragment] A custom image. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomImage] operation results. + # + def update(resource_group_name, lab_name, name, custom_image, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, custom_image, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of custom images. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImageFragment] A custom image. + # @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 update_with_http_info(resource_group_name, lab_name, name, custom_image, custom_headers:nil) + update_async(resource_group_name, lab_name, name, custom_image, custom_headers:custom_headers).value! + end + + # + # Modify properties of custom images. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImageFragment] A custom image. + # @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 update_async(resource_group_name, lab_name, name, custom_image, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'custom_image is nil' if custom_image.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageFragment.mapper() + request_content = @client.serialize(request_mapper, custom_image) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage.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 + + # + # Create or replace an existing custom image. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImage] A custom image. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomImage] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, name, custom_image, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, name, custom_image, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing custom image. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImage] A custom image. + # @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_or_update_with_http_info(resource_group_name, lab_name, name, custom_image, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, name, custom_image, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing custom image. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @param custom_image [CustomImage] A custom image. + # @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_or_update_async(resource_group_name, lab_name, name, custom_image, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'custom_image is nil' if custom_image.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage.mapper() + request_content = @client.serialize(request_mapper, custom_image) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage.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::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage.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 + + # + # Delete custom image. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @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, lab_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete custom image. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @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, lab_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete custom image. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the custom image. + # @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, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/customimages/{name}' + + 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,'labName' => lab_name,'name' => 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 + + # + # List custom images in a given lab. + # + # @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 [CustomImageList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List custom images in a given lab. + # + # @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:custom_headers).value! + end + + # + # List custom images in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageList.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 + + # + # List custom images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=vm)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomImageList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb new file mode 100644 index 0000000000..6ddc0ae70d --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb @@ -0,0 +1,227 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # A service client - single point of access to the REST API. + # + class DevTestLabsClient < 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] Client API version. + attr_reader :api_version + + # @return [String] The subscription ID. + attr_accessor :subscription_id + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. 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 [ProviderOperations] provider_operations + attr_reader :provider_operations + + # @return [Labs] labs + attr_reader :labs + + # @return [Operations] operations + attr_reader :operations + + # @return [GlobalSchedules] global_schedules + attr_reader :global_schedules + + # @return [ArtifactSources] artifact_sources + attr_reader :artifact_sources + + # @return [ArmTemplates] arm_templates + attr_reader :arm_templates + + # @return [Artifacts] artifacts + attr_reader :artifacts + + # @return [Costs] costs + attr_reader :costs + + # @return [CustomImages] custom_images + attr_reader :custom_images + + # @return [Formulas] formulas + attr_reader :formulas + + # @return [GalleryImages] gallery_images + attr_reader :gallery_images + + # @return [NotificationChannels] notification_channels + attr_reader :notification_channels + + # @return [PolicySets] policy_sets + attr_reader :policy_sets + + # @return [Policies] policies + attr_reader :policies + + # @return [Schedules] schedules + attr_reader :schedules + + # @return [ServiceRunners] service_runners + attr_reader :service_runners + + # @return [Users] users + attr_reader :users + + # @return [Disks] disks + attr_reader :disks + + # @return [Environments] environments + attr_reader :environments + + # @return [Secrets] secrets + attr_reader :secrets + + # @return [ServiceFabrics] service_fabrics + attr_reader :service_fabrics + + # @return [ServiceFabricSchedules] service_fabric_schedules + attr_reader :service_fabric_schedules + + # @return [VirtualMachines] virtual_machines + attr_reader :virtual_machines + + # @return [VirtualMachineSchedules] virtual_machine_schedules + attr_reader :virtual_machine_schedules + + # @return [VirtualNetworks] virtual_networks + attr_reader :virtual_networks + + # + # Creates initializes a new instance of the DevTestLabsClient 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 + + @provider_operations = ProviderOperations.new(self) + @labs = Labs.new(self) + @operations = Operations.new(self) + @global_schedules = GlobalSchedules.new(self) + @artifact_sources = ArtifactSources.new(self) + @arm_templates = ArmTemplates.new(self) + @artifacts = Artifacts.new(self) + @costs = Costs.new(self) + @custom_images = CustomImages.new(self) + @formulas = Formulas.new(self) + @gallery_images = GalleryImages.new(self) + @notification_channels = NotificationChannels.new(self) + @policy_sets = PolicySets.new(self) + @policies = Policies.new(self) + @schedules = Schedules.new(self) + @service_runners = ServiceRunners.new(self) + @users = Users.new(self) + @disks = Disks.new(self) + @environments = Environments.new(self) + @secrets = Secrets.new(self) + @service_fabrics = ServiceFabrics.new(self) + @service_fabric_schedules = ServiceFabricSchedules.new(self) + @virtual_machines = VirtualMachines.new(self) + @virtual_machine_schedules = VirtualMachineSchedules.new(self) + @virtual_networks = VirtualNetworks.new(self) + @api_version = '2018-09-15' + @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 + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + 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_devtestlabs' + sdk_information = "#{sdk_information}/0.17.2" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/disks.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/disks.rb new file mode 100644 index 0000000000..d26a47fa6d --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/disks.rb @@ -0,0 +1,1090 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Disks + include MsRestAzure + + # + # Creates and initializes a new instance of the Disks class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List disks in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List disks in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List disks in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/disks' + + 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,'labName' => lab_name,'userName' => user_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::DiskList.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 + + # + # Get disk. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Disk] operation results. + # + def get(resource_group_name, lab_name, user_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get disk. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @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, lab_name, user_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get disk. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @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, lab_name, user_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Disk.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 + + # + # Create or replace an existing disk. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [Disk] A Disk. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Disk] operation results. + # + def create_or_update(resource_group_name, lab_name, user_name, name, disk, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [Disk] A Disk. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Disk.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 + + # + # Delete disk. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @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, lab_name, user_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers: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 + + # + # Modify properties of disks. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [DiskFragment] A Disk. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Disk] operation results. + # + def update(resource_group_name, lab_name, user_name, name, disk, custom_headers:nil) + response = update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of disks. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [DiskFragment] A Disk. + # @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 update_with_http_info(resource_group_name, lab_name, user_name, name, disk, custom_headers:nil) + update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:custom_headers).value! + end + + # + # Modify properties of disks. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [DiskFragment] A Disk. + # @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 update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'disk is nil' if disk.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskFragment.mapper() + request_content = @client.serialize(request_mapper, disk) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Disk.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 + + # + # Attach and create the lease of the disk to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param attach_disk_properties [AttachDiskProperties] Properties of the disk + # to attach. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def attach(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:nil) + response = attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param attach_disk_properties [AttachDiskProperties] Properties of the disk + # to attach. + # @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 attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:nil) + # Send request + promise = begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers: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 + + # + # Detach and break the lease of the disk attached to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param detach_disk_properties [DetachDiskProperties] Properties of the disk + # to detach. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def detach(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:nil) + response = detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param detach_disk_properties [DetachDiskProperties] Properties of the disk + # to detach. + # @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 detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:nil) + # Send request + promise = begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers: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 + + # + # Create or replace an existing disk. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [Disk] A Disk. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Disk] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, user_name, name, disk, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing disk. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [Disk] A Disk. + # @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_or_update_with_http_info(resource_group_name, lab_name, user_name, name, disk, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing disk. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param disk [Disk] A Disk. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, disk, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'disk is nil' if disk.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Disk.mapper() + request_content = @client.serialize(request_mapper, disk) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Disk.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::DevTestLabs::Mgmt::V2018_09_15::Models::Disk.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 + + # + # Delete disk. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @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, lab_name, user_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete disk. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @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, lab_name, user_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Delete disk. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @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, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + + # + # Attach and create the lease of the disk to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param attach_disk_properties [AttachDiskProperties] Properties of the disk + # to attach. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_attach(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:nil) + response = begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # Attach and create the lease of the disk to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param attach_disk_properties [AttachDiskProperties] Properties of the disk + # to attach. + # @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_attach_with_http_info(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:nil) + begin_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers:custom_headers).value! + end + + # + # Attach and create the lease of the disk to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param attach_disk_properties [AttachDiskProperties] Properties of the disk + # to attach. + # @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_attach_async(resource_group_name, lab_name, user_name, name, attach_disk_properties, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'attach_disk_properties is nil' if attach_disk_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachDiskProperties.mapper() + request_content = @client.serialize(request_mapper, attach_disk_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/attach' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 || status_code == 202 + 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 + + # + # Detach and break the lease of the disk attached to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param detach_disk_properties [DetachDiskProperties] Properties of the disk + # to detach. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_detach(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:nil) + response = begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # Detach and break the lease of the disk attached to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param detach_disk_properties [DetachDiskProperties] Properties of the disk + # to detach. + # @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_detach_with_http_info(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:nil) + begin_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers:custom_headers).value! + end + + # + # Detach and break the lease of the disk attached to the virtual machine. This + # operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the disk. + # @param detach_disk_properties [DetachDiskProperties] Properties of the disk + # to detach. + # @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_detach_async(resource_group_name, lab_name, user_name, name, detach_disk_properties, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'detach_disk_properties is nil' if detach_disk_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDiskProperties.mapper() + request_content = @client.serialize(request_mapper, detach_disk_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}/detach' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 || status_code == 202 + 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 + + # + # List disks in a given user profile. + # + # @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 [DiskList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List disks in a given user profile. + # + # @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:custom_headers).value! + end + + # + # List disks in a given user profile. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::DiskList.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 + + # + # List disks in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=diskType)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DiskList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/environments.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/environments.rb new file mode 100644 index 0000000000..f2d74f0ca3 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/environments.rb @@ -0,0 +1,793 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Environments + include MsRestAzure + + # + # Creates and initializes a new instance of the Environments class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List environments in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List environments in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List environments in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/environments' + + 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,'labName' => lab_name,'userName' => user_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentList.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 + + # + # Get environment. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DtlEnvironment] operation results. + # + def get(resource_group_name, lab_name, user_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get environment. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @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, lab_name, user_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get environment. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @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, lab_name, user_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/environments/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment.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 + + # + # Create or replace an existing environment. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironment] An environment, which is essentially + # an ARM template deployment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DtlEnvironment] operation results. + # + def create_or_update(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironment] An environment, which is essentially + # an ARM template deployment. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment.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 + + # + # Delete environment. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @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, lab_name, user_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers: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 + + # + # Modify properties of environments. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironmentFragment] An environment, which is + # essentially an ARM template deployment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DtlEnvironment] operation results. + # + def update(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:nil) + response = update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of environments. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironmentFragment] An environment, which is + # essentially an ARM template deployment. + # @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 update_with_http_info(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:nil) + update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:custom_headers).value! + end + + # + # Modify properties of environments. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironmentFragment] An environment, which is + # essentially an ARM template deployment. + # @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 update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'dtl_environment is nil' if dtl_environment.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentFragment.mapper() + request_content = @client.serialize(request_mapper, dtl_environment) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment.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 + + # + # Create or replace an existing environment. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironment] An environment, which is essentially + # an ARM template deployment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DtlEnvironment] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing environment. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironment] An environment, which is essentially + # an ARM template deployment. + # @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_or_update_with_http_info(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing environment. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @param dtl_environment [DtlEnvironment] An environment, which is essentially + # an ARM template deployment. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, dtl_environment, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'dtl_environment is nil' if dtl_environment.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment.mapper() + request_content = @client.serialize(request_mapper, dtl_environment) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/environments/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment.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::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment.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 + + # + # Delete environment. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @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, lab_name, user_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete environment. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @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, lab_name, user_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Delete environment. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the environment. + # @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, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/environments/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + + # + # List environments in a given user profile. + # + # @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 [DtlEnvironmentList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List environments in a given user profile. + # + # @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:custom_headers).value! + end + + # + # List environments in a given user profile. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentList.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 + + # + # List environments in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=deploymentProperties)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [DtlEnvironmentList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/formulas.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/formulas.rb new file mode 100644 index 0000000000..b92f3e6976 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/formulas.rb @@ -0,0 +1,727 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Formulas + include MsRestAzure + + # + # Creates and initializes a new instance of the Formulas class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List formulas in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List formulas in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List formulas in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/formulas' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaList.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 + + # + # Get formula. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Formula] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get formula. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get formula. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/formulas/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Formula.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 + + # + # Create or replace an existing Formula. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [Formula] A formula for creating a VM, specifying an image + # base and other parameters + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Formula] operation results. + # + def create_or_update(resource_group_name, lab_name, name, formula, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, formula, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [Formula] A formula for creating a VM, specifying an image + # base and other parameters + # @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_or_update_async(resource_group_name, lab_name, name, formula, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, name, formula, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Formula.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 + + # + # Delete formula. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete formula. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @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 delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete formula. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @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 delete_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/formulas/{name}' + + 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,'labName' => lab_name,'name' => 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 == 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 + + # + # Modify properties of formulas. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [FormulaFragment] A formula for creating a VM, specifying an + # image base and other parameters + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Formula] operation results. + # + def update(resource_group_name, lab_name, name, formula, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, formula, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of formulas. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [FormulaFragment] A formula for creating a VM, specifying an + # image base and other parameters + # @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 update_with_http_info(resource_group_name, lab_name, name, formula, custom_headers:nil) + update_async(resource_group_name, lab_name, name, formula, custom_headers:custom_headers).value! + end + + # + # Modify properties of formulas. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [FormulaFragment] A formula for creating a VM, specifying an + # image base and other parameters + # @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 update_async(resource_group_name, lab_name, name, formula, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'formula is nil' if formula.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaFragment.mapper() + request_content = @client.serialize(request_mapper, formula) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Formula.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 + + # + # Create or replace an existing Formula. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [Formula] A formula for creating a VM, specifying an image + # base and other parameters + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Formula] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, name, formula, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, name, formula, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Formula. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [Formula] A formula for creating a VM, specifying an image + # base and other parameters + # @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_or_update_with_http_info(resource_group_name, lab_name, name, formula, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, name, formula, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Formula. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the formula. + # @param formula [Formula] A formula for creating a VM, specifying an image + # base and other parameters + # @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_or_update_async(resource_group_name, lab_name, name, formula, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'formula is nil' if formula.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Formula.mapper() + request_content = @client.serialize(request_mapper, formula) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Formula.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::DevTestLabs::Mgmt::V2018_09_15::Models::Formula.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 + + # + # List formulas in a given lab. + # + # @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 [FormulaList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List formulas in a given lab. + # + # @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:custom_headers).value! + end + + # + # List formulas in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaList.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 + + # + # List formulas in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [FormulaList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/gallery_images.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/gallery_images.rb new file mode 100644 index 0000000000..061ec380d8 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/gallery_images.rb @@ -0,0 +1,259 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class GalleryImages + include MsRestAzure + + # + # Creates and initializes a new instance of the GalleryImages class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List gallery images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List gallery images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List gallery images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/galleryimages' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageList.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 + + # + # List gallery images in a given lab. + # + # @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 [GalleryImageList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List gallery images in a given lab. + # + # @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:custom_headers).value! + end + + # + # List gallery images in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageList.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 + + # + # List gallery images in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GalleryImageList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/global_schedules.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/global_schedules.rb new file mode 100644 index 0000000000..5e118a3d6a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/global_schedules.rb @@ -0,0 +1,1131 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class GlobalSchedules + include MsRestAzure + + # + # Creates and initializes a new instance of the GlobalSchedules class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List schedules in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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_subscription(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_by_subscription_as_lazy(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List schedules in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List schedules in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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_subscription_async(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/schedules' + + 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: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # List schedules in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List schedules in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List schedules in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/schedules' + + 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: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def get(resource_group_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, name, expand:nil, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/schedules/{name}' + + 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,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def create_or_update(resource_group_name, name, schedule, custom_headers:nil) + response = create_or_update_async(resource_group_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_with_http_info(resource_group_name, name, schedule, custom_headers:nil) + create_or_update_async(resource_group_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_async(resource_group_name, name, schedule, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}' + + 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,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, name, custom_headers:nil) + response = delete_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @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 delete_with_http_info(resource_group_name, name, custom_headers:nil) + delete_async(resource_group_name, name, custom_headers:custom_headers).value! + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @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 delete_async(resource_group_name, name, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/schedules/{name}' + + 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,'name' => 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 == 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 + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def update(resource_group_name, name, schedule, custom_headers:nil) + response = update_async(resource_group_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_with_http_info(resource_group_name, name, schedule, custom_headers:nil) + update_async(resource_group_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_async(resource_group_name, name, schedule, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}' + + 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,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def execute(resource_group_name, name, custom_headers:nil) + response = execute_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @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 execute_async(resource_group_name, name, custom_headers:nil) + # Send request + promise = begin_execute_async(resource_group_name, name, custom_headers: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 schedule's target resource Id. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param retarget_schedule_properties [RetargetScheduleProperties] Properties + # for retargeting a virtual machine schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def retarget(resource_group_name, name, retarget_schedule_properties, custom_headers:nil) + response = retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param retarget_schedule_properties [RetargetScheduleProperties] Properties + # for retargeting a virtual machine schedule. + # @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 retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers:nil) + # Send request + promise = begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers: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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_execute(resource_group_name, name, custom_headers:nil) + response = begin_execute_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @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_execute_with_http_info(resource_group_name, name, custom_headers:nil) + begin_execute_async(resource_group_name, name, custom_headers:custom_headers).value! + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @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_execute_async(resource_group_name, name, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/schedules/{name}/execute' + + 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,'name' => 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 || status_code == 202 + 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 schedule's target resource Id. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param retarget_schedule_properties [RetargetScheduleProperties] Properties + # for retargeting a virtual machine schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_retarget(resource_group_name, name, retarget_schedule_properties, custom_headers:nil) + response = begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers:custom_headers).value! + nil + end + + # + # Updates a schedule's target resource Id. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param retarget_schedule_properties [RetargetScheduleProperties] Properties + # for retargeting a virtual machine schedule. + # @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_retarget_with_http_info(resource_group_name, name, retarget_schedule_properties, custom_headers:nil) + begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers:custom_headers).value! + end + + # + # Updates a schedule's target resource Id. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the schedule. + # @param retarget_schedule_properties [RetargetScheduleProperties] Properties + # for retargeting a virtual machine schedule. + # @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_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'retarget_schedule_properties is nil' if retarget_schedule_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RetargetScheduleProperties.mapper() + request_content = @client.serialize(request_mapper, retarget_schedule_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/retarget' + + 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,'name' => 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 || status_code == 202 + 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 + + # + # List schedules in a 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 [ScheduleList] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List schedules in a 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_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List schedules in a 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_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # List schedules in a 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 [ScheduleList] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List schedules in a 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:custom_headers).value! + end + + # + # List schedules in a 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # List schedules in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ScheduleList] which provide lazy access to pages of the response. + # + def list_by_subscription_as_lazy(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List schedules in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ScheduleList] which provide lazy access to pages of the response. + # + def list_by_resource_group_as_lazy(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/labs.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/labs.rb new file mode 100644 index 0000000000..7ad7a5058e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/labs.rb @@ -0,0 +1,1820 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Labs + include MsRestAzure + + # + # Creates and initializes a new instance of the Labs class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List labs in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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_subscription(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_by_subscription_as_lazy(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List labs in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List labs in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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_subscription_async(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs' + + 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: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::LabList.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 + + # + # List labs in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List labs in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List labs in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs' + + 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: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::LabList.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 + + # + # Get lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def get(resource_group_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @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, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @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, name, expand:nil, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{name}' + + 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,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Lab.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 + + # + # Create or replace an existing lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [Lab] A lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def create_or_update(resource_group_name, name, lab, custom_headers:nil) + response = create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [Lab] A lab. + # @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_or_update_async(resource_group_name, name, lab, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Lab.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 + + # + # Delete lab. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, name, custom_headers:nil) + response = delete_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, name, custom_headers: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 + + # + # Modify properties of labs. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [LabFragment] A lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def update(resource_group_name, name, lab, custom_headers:nil) + response = update_async(resource_group_name, name, lab, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of labs. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [LabFragment] A lab. + # @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 update_with_http_info(resource_group_name, name, lab, custom_headers:nil) + update_async(resource_group_name, name, lab, custom_headers:custom_headers).value! + end + + # + # Modify properties of labs. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [LabFragment] A lab. + # @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 update_async(resource_group_name, name, lab, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'lab is nil' if lab.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabFragment.mapper() + request_content = @client.serialize(request_mapper, lab) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}' + + 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,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Lab.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 + + # + # Claim a random claimable virtual machine in the lab. This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def claim_any_vm(resource_group_name, name, custom_headers:nil) + response = claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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 claim_any_vm_async(resource_group_name, name, custom_headers:nil) + # Send request + promise = begin_claim_any_vm_async(resource_group_name, name, custom_headers: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 + + # + # Create virtual machines in a lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab_virtual_machine_creation_parameter + # [LabVirtualMachineCreationParameter] Properties for creating a virtual + # machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def create_environment(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil) + response = create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab_virtual_machine_creation_parameter + # [LabVirtualMachineCreationParameter] Properties for creating a virtual + # machine. + # @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_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil) + # Send request + promise = begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: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 + + # + # Exports the lab resource usage into a storage account This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param export_resource_usage_parameters [ExportResourceUsageParameters] The + # parameters of the export operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def export_resource_usage(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil) + response = export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param export_resource_usage_parameters [ExportResourceUsageParameters] The + # parameters of the export operation. + # @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 export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil) + # Send request + promise = begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers: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 + + # + # Generate a URI for uploading custom disk images to a Lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param generate_upload_uri_parameter [GenerateUploadUriParameter] Properties + # for generating an upload URI. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GenerateUploadUriResponse] operation results. + # + def generate_upload_uri(resource_group_name, name, generate_upload_uri_parameter, custom_headers:nil) + response = generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Generate a URI for uploading custom disk images to a Lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param generate_upload_uri_parameter [GenerateUploadUriParameter] Properties + # for generating an upload URI. + # @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 generate_upload_uri_with_http_info(resource_group_name, name, generate_upload_uri_parameter, custom_headers:nil) + generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers:custom_headers).value! + end + + # + # Generate a URI for uploading custom disk images to a Lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param generate_upload_uri_parameter [GenerateUploadUriParameter] Properties + # for generating an upload URI. + # @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 generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'generate_upload_uri_parameter is nil' if generate_upload_uri_parameter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriParameter.mapper() + request_content = @client.serialize(request_mapper, generate_upload_uri_parameter) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri' + + 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,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriResponse.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 + + # + # Import a virtual machine into a different lab. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param import_lab_virtual_machine_request [ImportLabVirtualMachineRequest] + # This represents the payload required to import a virtual machine from a + # different lab into the current one + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def import_virtual_machine(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:nil) + response = import_virtual_machine_async(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param import_lab_virtual_machine_request [ImportLabVirtualMachineRequest] + # This represents the payload required to import a virtual machine from a + # different lab into the current one + # @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 import_virtual_machine_async(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:nil) + # Send request + promise = begin_import_virtual_machine_async(resource_group_name, name, import_lab_virtual_machine_request, custom_headers: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 + + # + # List disk images available for custom image creation. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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_vhds(resource_group_name, name, custom_headers:nil) + first_page = list_vhds_as_lazy(resource_group_name, name, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List disk images available for custom image creation. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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_vhds_with_http_info(resource_group_name, name, custom_headers:nil) + list_vhds_async(resource_group_name, name, custom_headers:custom_headers).value! + end + + # + # List disk images available for custom image creation. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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_vhds_async(resource_group_name, name, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{name}/listVhds' + + 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,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhdList.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 + + # + # Create or replace an existing lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [Lab] A lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def begin_create_or_update(resource_group_name, name, lab, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [Lab] A lab. + # @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_or_update_with_http_info(resource_group_name, name, lab, custom_headers:nil) + begin_create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab [Lab] A lab. + # @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_or_update_async(resource_group_name, name, lab, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'lab is nil' if lab.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Lab.mapper() + request_content = @client.serialize(request_mapper, lab) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}' + + 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,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Lab.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::DevTestLabs::Mgmt::V2018_09_15::Models::Lab.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 + + # + # Delete lab. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete lab. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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, name, custom_headers:nil) + begin_delete_async(resource_group_name, name, custom_headers:custom_headers).value! + end + + # + # Delete lab. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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, name, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{name}' + + 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,'name' => 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 + + # + # Claim a random claimable virtual machine in the lab. This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_claim_any_vm(resource_group_name, name, custom_headers:nil) + response = begin_claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Claim a random claimable virtual machine in the lab. This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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_claim_any_vm_with_http_info(resource_group_name, name, custom_headers:nil) + begin_claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers).value! + end + + # + # Claim a random claimable virtual machine in the lab. This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @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_claim_any_vm_async(resource_group_name, name, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{name}/claimAnyVm' + + 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,'name' => 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 || status_code == 202 + 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 + + # + # Create virtual machines in a lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab_virtual_machine_creation_parameter + # [LabVirtualMachineCreationParameter] Properties for creating a virtual + # machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_create_environment(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil) + response = begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers).value! + nil + end + + # + # Create virtual machines in a lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab_virtual_machine_creation_parameter + # [LabVirtualMachineCreationParameter] Properties for creating a virtual + # machine. + # @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_environment_with_http_info(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil) + begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers).value! + end + + # + # Create virtual machines in a lab. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param lab_virtual_machine_creation_parameter + # [LabVirtualMachineCreationParameter] Properties for creating a virtual + # machine. + # @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_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'lab_virtual_machine_creation_parameter is nil' if lab_virtual_machine_creation_parameter.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameter.mapper() + request_content = @client.serialize(request_mapper, lab_virtual_machine_creation_parameter) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment' + + 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,'name' => 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 || status_code == 202 + 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 + + # + # Exports the lab resource usage into a storage account This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param export_resource_usage_parameters [ExportResourceUsageParameters] The + # parameters of the export operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_export_resource_usage(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil) + response = begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers).value! + nil + end + + # + # Exports the lab resource usage into a storage account This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param export_resource_usage_parameters [ExportResourceUsageParameters] The + # parameters of the export 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 begin_export_resource_usage_with_http_info(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil) + begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers).value! + end + + # + # Exports the lab resource usage into a storage account This operation can take + # a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param export_resource_usage_parameters [ExportResourceUsageParameters] The + # parameters of the export 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 begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'export_resource_usage_parameters is nil' if export_resource_usage_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExportResourceUsageParameters.mapper() + request_content = @client.serialize(request_mapper, export_resource_usage_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/exportResourceUsage' + + 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,'name' => 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 || status_code == 202 + 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 + + # + # Import a virtual machine into a different lab. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param import_lab_virtual_machine_request [ImportLabVirtualMachineRequest] + # This represents the payload required to import a virtual machine from a + # different lab into the current one + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_import_virtual_machine(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:nil) + response = begin_import_virtual_machine_async(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:custom_headers).value! + nil + end + + # + # Import a virtual machine into a different lab. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param import_lab_virtual_machine_request [ImportLabVirtualMachineRequest] + # This represents the payload required to import a virtual machine from a + # different lab into the current one + # @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_import_virtual_machine_with_http_info(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:nil) + begin_import_virtual_machine_async(resource_group_name, name, import_lab_virtual_machine_request, custom_headers:custom_headers).value! + end + + # + # Import a virtual machine into a different lab. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param import_lab_virtual_machine_request [ImportLabVirtualMachineRequest] + # This represents the payload required to import a virtual machine from a + # different lab into the current one + # @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_import_virtual_machine_async(resource_group_name, name, import_lab_virtual_machine_request, custom_headers: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, 'name is nil' if name.nil? + fail ArgumentError, 'import_lab_virtual_machine_request is nil' if import_lab_virtual_machine_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ImportLabVirtualMachineRequest.mapper() + request_content = @client.serialize(request_mapper, import_lab_virtual_machine_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/importVirtualMachine' + + 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,'name' => 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 || status_code == 202 + 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 + + # + # List labs in a 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 [LabList] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List labs in a 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_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List labs in a 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_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabList.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 + + # + # List labs in a 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 [LabList] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List labs in a 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:custom_headers).value! + end + + # + # List labs in a 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabList.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 + + # + # List disk images available for custom image creation. + # + # @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 [LabVhdList] operation results. + # + def list_vhds_next(next_page_link, custom_headers:nil) + response = list_vhds_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List disk images available for custom image creation. + # + # @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_vhds_next_with_http_info(next_page_link, custom_headers:nil) + list_vhds_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List disk images available for custom image creation. + # + # @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_vhds_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhdList.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 + + # + # List labs in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabList] which provide lazy access to pages of the response. + # + def list_by_subscription_as_lazy(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List labs in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=defaultStorageAccount)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabList] which provide lazy access to pages of the response. + # + def list_by_resource_group_as_lazy(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + # + # List disk images available for custom image creation. + # + # @param resource_group_name [String] The name of the resource group. + # @param name [String] The name of the lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabVhdList] which provide lazy access to pages of the response. + # + def list_vhds_as_lazy(resource_group_name, name, custom_headers:nil) + response = list_vhds_async(resource_group_name, name, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_vhds_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb new file mode 100644 index 0000000000..2effd38de4 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Schedules applicable to a virtual machine. The schedules may have been + # defined on a VM or on lab level. + # + class ApplicableSchedule < Resource + + include MsRestAzure + + # @return [Schedule] The auto-shutdown schedule, if one has been set at + # the lab or lab resource level. + attr_accessor :lab_vms_shutdown + + # @return [Schedule] The auto-startup schedule, if one has been set at + # the lab or lab resource level. + attr_accessor :lab_vms_startup + + + # + # Mapper for ApplicableSchedule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ApplicableSchedule', + type: { + name: 'Composite', + class_name: 'ApplicableSchedule', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + lab_vms_shutdown: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVmsShutdown', + type: { + name: 'Composite', + class_name: 'Schedule' + } + }, + lab_vms_startup: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVmsStartup', + type: { + name: 'Composite', + class_name: 'Schedule' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb new file mode 100644 index 0000000000..747a1b226e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb @@ -0,0 +1,78 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Schedules applicable to a virtual machine. The schedules may have been + # defined on a VM or on lab level. + # + class ApplicableScheduleFragment < UpdateResource + + include MsRestAzure + + # @return [ScheduleFragment] The auto-shutdown schedule, if one has been + # set at the lab or lab resource level. + attr_accessor :lab_vms_shutdown + + # @return [ScheduleFragment] The auto-startup schedule, if one has been + # set at the lab or lab resource level. + attr_accessor :lab_vms_startup + + + # + # Mapper for ApplicableScheduleFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ApplicableScheduleFragment', + type: { + name: 'Composite', + class_name: 'ApplicableScheduleFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + lab_vms_shutdown: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVmsShutdown', + type: { + name: 'Composite', + class_name: 'ScheduleFragment' + } + }, + lab_vms_startup: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVmsStartup', + type: { + name: 'Composite', + class_name: 'ScheduleFragment' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb new file mode 100644 index 0000000000..2837127d47 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb @@ -0,0 +1,56 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Request body for applying artifacts to a virtual machine. + # + class ApplyArtifactsRequest + + include MsRestAzure + + # @return [Array] The list of artifacts to + # apply. + attr_accessor :artifacts + + + # + # Mapper for ApplyArtifactsRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ApplyArtifactsRequest', + type: { + name: 'Composite', + class_name: 'ApplyArtifactsRequest', + model_properties: { + artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'artifacts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallPropertiesElementType', + type: { + name: 'Composite', + class_name: 'ArtifactInstallProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template.rb new file mode 100644 index 0000000000..87fb676679 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template.rb @@ -0,0 +1,194 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An Azure Resource Manager template. + # + class ArmTemplate < Resource + + include MsRestAzure + + # @return [String] The display name of the ARM template. + attr_accessor :display_name + + # @return [String] The description of the ARM template. + attr_accessor :description + + # @return [String] The publisher of the ARM template. + attr_accessor :publisher + + # @return [String] The URI to the icon of the ARM template. + attr_accessor :icon + + # @return The contents of the ARM template. + attr_accessor :contents + + # @return [DateTime] The creation date of the armTemplate. + attr_accessor :created_date + + # @return [Array] File name and parameter values + # information from all azuredeploy.*.parameters.json for the ARM + # template. + attr_accessor :parameters_value_files_info + + # @return [Boolean] Whether or not ARM template is enabled for use by lab + # user. + attr_accessor :enabled + + + # + # Mapper for ArmTemplate class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplate', + type: { + name: 'Composite', + class_name: 'ArmTemplate', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + display_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.publisher', + type: { + name: 'String' + } + }, + icon: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.icon', + type: { + name: 'String' + } + }, + contents: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.contents', + type: { + name: 'Object' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + parameters_value_files_info: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.parametersValueFilesInfo', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ParametersValueFileInfoElementType', + type: { + name: 'Composite', + class_name: 'ParametersValueFileInfo' + } + } + } + }, + enabled: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.enabled', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb new file mode 100644 index 0000000000..5a46347fc9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_info.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a generated ARM template. + # + class ArmTemplateInfo + + include MsRestAzure + + # @return The template's contents. + attr_accessor :template + + # @return The parameters of the ARM template. + attr_accessor :parameters + + + # + # Mapper for ArmTemplateInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateInfo', + type: { + name: 'Composite', + class_name: 'ArmTemplateInfo', + model_properties: { + template: { + client_side_validation: true, + required: false, + serialized_name: 'template', + type: { + name: 'Object' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_list.rb new file mode 100644 index 0000000000..0c7faac551 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class ArmTemplateList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ArmTemplateList] 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 ArmTemplateList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateList', + type: { + name: 'Composite', + class_name: 'ArmTemplateList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateElementType', + type: { + name: 'Composite', + class_name: 'ArmTemplate' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb new file mode 100644 index 0000000000..f1a342b291 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an Azure Resource Manager template parameter. + # + class ArmTemplateParameterProperties + + include MsRestAzure + + # @return [String] The name of the template parameter. + attr_accessor :name + + # @return [String] The value of the template parameter. + attr_accessor :value + + + # + # Mapper for ArmTemplateParameterProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateParameterProperties', + type: { + name: 'Composite', + class_name: 'ArmTemplateParameterProperties', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties_fragment.rb new file mode 100644 index 0000000000..3666ef9634 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an Azure Resource Manager template parameter. + # + class ArmTemplateParameterPropertiesFragment + + include MsRestAzure + + # @return [String] The name of the template parameter. + attr_accessor :name + + # @return [String] The value of the template parameter. + attr_accessor :value + + + # + # Mapper for ArmTemplateParameterPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateParameterPropertiesFragment', + type: { + name: 'Composite', + class_name: 'ArmTemplateParameterPropertiesFragment', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact.rb new file mode 100644 index 0000000000..430de5bf4c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact.rb @@ -0,0 +1,182 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An artifact. + # + class Artifact < Resource + + include MsRestAzure + + # @return [String] The artifact's title. + attr_accessor :title + + # @return [String] The artifact's description. + attr_accessor :description + + # @return [String] The artifact's publisher. + attr_accessor :publisher + + # @return [String] The file path to the artifact. + attr_accessor :file_path + + # @return [String] The URI to the artifact icon. + attr_accessor :icon + + # @return [String] The artifact's target OS. + attr_accessor :target_os_type + + # @return The artifact's parameters. + attr_accessor :parameters + + # @return [DateTime] The artifact's creation date. + attr_accessor :created_date + + + # + # Mapper for Artifact class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Artifact', + type: { + name: 'Composite', + class_name: 'Artifact', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + title: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.publisher', + type: { + name: 'String' + } + }, + file_path: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.filePath', + type: { + name: 'String' + } + }, + icon: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.icon', + type: { + name: 'String' + } + }, + target_os_type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.targetOsType', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.parameters', + type: { + name: 'Object' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb new file mode 100644 index 0000000000..de1525cf7e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact deployment. + # + class ArtifactDeploymentStatusProperties + + include MsRestAzure + + # @return [String] The deployment status of the artifact. + attr_accessor :deployment_status + + # @return [Integer] The total count of the artifacts that were + # successfully applied. + attr_accessor :artifacts_applied + + # @return [Integer] The total count of the artifacts that were + # tentatively applied. + attr_accessor :total_artifacts + + + # + # Mapper for ArtifactDeploymentStatusProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactDeploymentStatusProperties', + type: { + name: 'Composite', + class_name: 'ArtifactDeploymentStatusProperties', + model_properties: { + deployment_status: { + client_side_validation: true, + required: false, + serialized_name: 'deploymentStatus', + type: { + name: 'String' + } + }, + artifacts_applied: { + client_side_validation: true, + required: false, + serialized_name: 'artifactsApplied', + type: { + name: 'Number' + } + }, + total_artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'totalArtifacts', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb new file mode 100644 index 0000000000..e8c32d4f3f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb @@ -0,0 +1,71 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact deployment. + # + class ArtifactDeploymentStatusPropertiesFragment + + include MsRestAzure + + # @return [String] The deployment status of the artifact. + attr_accessor :deployment_status + + # @return [Integer] The total count of the artifacts that were + # successfully applied. + attr_accessor :artifacts_applied + + # @return [Integer] The total count of the artifacts that were + # tentatively applied. + attr_accessor :total_artifacts + + + # + # Mapper for ArtifactDeploymentStatusPropertiesFragment class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactDeploymentStatusPropertiesFragment', + type: { + name: 'Composite', + class_name: 'ArtifactDeploymentStatusPropertiesFragment', + model_properties: { + deployment_status: { + client_side_validation: true, + required: false, + serialized_name: 'deploymentStatus', + type: { + name: 'String' + } + }, + artifacts_applied: { + client_side_validation: true, + required: false, + serialized_name: 'artifactsApplied', + type: { + name: 'Number' + } + }, + total_artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'totalArtifacts', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb new file mode 100644 index 0000000000..148a7f5839 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb @@ -0,0 +1,123 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact. + # + class ArtifactInstallProperties + + include MsRestAzure + + # @return [String] The artifact's identifier. + attr_accessor :artifact_id + + # @return [String] The artifact's title. + attr_accessor :artifact_title + + # @return [Array] The parameters of the + # artifact. + attr_accessor :parameters + + # @return [String] The status of the artifact. + attr_accessor :status + + # @return [String] The status message from the deployment. + attr_accessor :deployment_status_message + + # @return [String] The status message from the virtual machine extension. + attr_accessor :vm_extension_status_message + + # @return [DateTime] The time that the artifact starts to install on the + # virtual machine. + attr_accessor :install_time + + + # + # Mapper for ArtifactInstallProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallProperties', + type: { + name: 'Composite', + class_name: 'ArtifactInstallProperties', + model_properties: { + artifact_id: { + client_side_validation: true, + required: false, + serialized_name: 'artifactId', + type: { + name: 'String' + } + }, + artifact_title: { + client_side_validation: true, + required: false, + serialized_name: 'artifactTitle', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactParameterPropertiesElementType', + type: { + name: 'Composite', + class_name: 'ArtifactParameterProperties' + } + } + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + deployment_status_message: { + client_side_validation: true, + required: false, + serialized_name: 'deploymentStatusMessage', + type: { + name: 'String' + } + }, + vm_extension_status_message: { + client_side_validation: true, + required: false, + serialized_name: 'vmExtensionStatusMessage', + type: { + name: 'String' + } + }, + install_time: { + client_side_validation: true, + required: false, + serialized_name: 'installTime', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb new file mode 100644 index 0000000000..d9c37c8edd --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb @@ -0,0 +1,123 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact. + # + class ArtifactInstallPropertiesFragment + + include MsRestAzure + + # @return [String] The artifact's identifier. + attr_accessor :artifact_id + + # @return [String] The artifact's title. + attr_accessor :artifact_title + + # @return [Array] The parameters of + # the artifact. + attr_accessor :parameters + + # @return [String] The status of the artifact. + attr_accessor :status + + # @return [String] The status message from the deployment. + attr_accessor :deployment_status_message + + # @return [String] The status message from the virtual machine extension. + attr_accessor :vm_extension_status_message + + # @return [DateTime] The time that the artifact starts to install on the + # virtual machine. + attr_accessor :install_time + + + # + # Mapper for ArtifactInstallPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallPropertiesFragment', + type: { + name: 'Composite', + class_name: 'ArtifactInstallPropertiesFragment', + model_properties: { + artifact_id: { + client_side_validation: true, + required: false, + serialized_name: 'artifactId', + type: { + name: 'String' + } + }, + artifact_title: { + client_side_validation: true, + required: false, + serialized_name: 'artifactTitle', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactParameterPropertiesFragmentElementType', + type: { + name: 'Composite', + class_name: 'ArtifactParameterPropertiesFragment' + } + } + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + deployment_status_message: { + client_side_validation: true, + required: false, + serialized_name: 'deploymentStatusMessage', + type: { + name: 'String' + } + }, + vm_extension_status_message: { + client_side_validation: true, + required: false, + serialized_name: 'vmExtensionStatusMessage', + type: { + name: 'String' + } + }, + install_time: { + client_side_validation: true, + required: false, + serialized_name: 'installTime', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_list.rb new file mode 100644 index 0000000000..e99ec123a0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class ArtifactList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ArtifactList] 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 ArtifactList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactList', + type: { + name: 'Composite', + class_name: 'ArtifactList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactElementType', + type: { + name: 'Composite', + class_name: 'Artifact' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb new file mode 100644 index 0000000000..b7bec02280 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact parameter. + # + class ArtifactParameterProperties + + include MsRestAzure + + # @return [String] The name of the artifact parameter. + attr_accessor :name + + # @return [String] The value of the artifact parameter. + attr_accessor :value + + + # + # Mapper for ArtifactParameterProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactParameterProperties', + type: { + name: 'Composite', + class_name: 'ArtifactParameterProperties', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb new file mode 100644 index 0000000000..75a762583a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact parameter. + # + class ArtifactParameterPropertiesFragment + + include MsRestAzure + + # @return [String] The name of the artifact parameter. + attr_accessor :name + + # @return [String] The value of the artifact parameter. + attr_accessor :value + + + # + # Mapper for ArtifactParameterPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactParameterPropertiesFragment', + type: { + name: 'Composite', + class_name: 'ArtifactParameterPropertiesFragment', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source.rb new file mode 100644 index 0000000000..8e090b061a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source.rb @@ -0,0 +1,215 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact source. + # + class ArtifactSource < Resource + + include MsRestAzure + + # @return [String] The artifact source's display name. + attr_accessor :display_name + + # @return [String] The artifact source's URI. + attr_accessor :uri + + # @return [SourceControlType] The artifact source's type. Possible values + # include: 'VsoGit', 'GitHub' + attr_accessor :source_type + + # @return [String] The folder containing artifacts. + attr_accessor :folder_path + + # @return [String] The folder containing Azure Resource Manager + # templates. + attr_accessor :arm_template_folder_path + + # @return [String] The artifact source's branch reference. + attr_accessor :branch_ref + + # @return [String] The security token to authenticate to the artifact + # source. + attr_accessor :security_token + + # @return [EnableStatus] Indicates if the artifact source is enabled + # (values: Enabled, Disabled). Possible values include: 'Enabled', + # 'Disabled' + attr_accessor :status + + # @return [DateTime] The artifact source's creation date. + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for ArtifactSource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactSource', + type: { + name: 'Composite', + class_name: 'ArtifactSource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uri', + type: { + name: 'String' + } + }, + source_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sourceType', + type: { + name: 'String' + } + }, + folder_path: { + client_side_validation: true, + required: false, + serialized_name: 'properties.folderPath', + type: { + name: 'String' + } + }, + arm_template_folder_path: { + client_side_validation: true, + required: false, + serialized_name: 'properties.armTemplateFolderPath', + type: { + name: 'String' + } + }, + branch_ref: { + client_side_validation: true, + required: false, + serialized_name: 'properties.branchRef', + type: { + name: 'String' + } + }, + security_token: { + client_side_validation: true, + required: false, + serialized_name: 'properties.securityToken', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb new file mode 100644 index 0000000000..d1d0c6ab50 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb @@ -0,0 +1,144 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an artifact source. + # + class ArtifactSourceFragment < UpdateResource + + include MsRestAzure + + # @return [String] The artifact source's display name. + attr_accessor :display_name + + # @return [String] The artifact source's URI. + attr_accessor :uri + + # @return [SourceControlType] The artifact source's type. Possible values + # include: 'VsoGit', 'GitHub' + attr_accessor :source_type + + # @return [String] The folder containing artifacts. + attr_accessor :folder_path + + # @return [String] The folder containing Azure Resource Manager + # templates. + attr_accessor :arm_template_folder_path + + # @return [String] The artifact source's branch reference. + attr_accessor :branch_ref + + # @return [String] The security token to authenticate to the artifact + # source. + attr_accessor :security_token + + # @return [EnableStatus] Indicates if the artifact source is enabled + # (values: Enabled, Disabled). Possible values include: 'Enabled', + # 'Disabled' + attr_accessor :status + + + # + # Mapper for ArtifactSourceFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactSourceFragment', + type: { + name: 'Composite', + class_name: 'ArtifactSourceFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.displayName', + type: { + name: 'String' + } + }, + uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uri', + type: { + name: 'String' + } + }, + source_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sourceType', + type: { + name: 'String' + } + }, + folder_path: { + client_side_validation: true, + required: false, + serialized_name: 'properties.folderPath', + type: { + name: 'String' + } + }, + arm_template_folder_path: { + client_side_validation: true, + required: false, + serialized_name: 'properties.armTemplateFolderPath', + type: { + name: 'String' + } + }, + branch_ref: { + client_side_validation: true, + required: false, + serialized_name: 'properties.branchRef', + type: { + name: 'String' + } + }, + security_token: { + client_side_validation: true, + required: false, + serialized_name: 'properties.securityToken', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_list.rb new file mode 100644 index 0000000000..ebece9215c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/artifact_source_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class ArtifactSourceList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ArtifactSourceList] 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 ArtifactSourceList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactSourceList', + type: { + name: 'Composite', + class_name: 'ArtifactSourceList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactSourceElementType', + type: { + name: 'Composite', + class_name: 'ArtifactSource' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb new file mode 100644 index 0000000000..3a0ba647ae --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of the disk to attach. + # + class AttachDiskProperties + + include MsRestAzure + + # @return [String] The resource ID of the Lab virtual machine to which + # the disk is attached. + attr_accessor :leased_by_lab_vm_id + + + # + # Mapper for AttachDiskProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AttachDiskProperties', + type: { + name: 'Composite', + class_name: 'AttachDiskProperties', + model_properties: { + leased_by_lab_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'leasedByLabVmId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb new file mode 100644 index 0000000000..1acdd2089b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb @@ -0,0 +1,69 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties to attach new disk to the Virtual Machine. + # + class AttachNewDataDiskOptions + + include MsRestAzure + + # @return [Integer] Size of the disk to be attached in Gibibytes. + attr_accessor :disk_size_gi_b + + # @return [String] The name of the disk to be attached. + attr_accessor :disk_name + + # @return [StorageType] The storage type for the disk (i.e. Standard, + # Premium). Possible values include: 'Standard', 'Premium' + attr_accessor :disk_type + + + # + # Mapper for AttachNewDataDiskOptions class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AttachNewDataDiskOptions', + type: { + name: 'Composite', + class_name: 'AttachNewDataDiskOptions', + model_properties: { + disk_size_gi_b: { + client_side_validation: true, + required: false, + serialized_name: 'diskSizeGiB', + type: { + name: 'Number' + } + }, + disk_name: { + client_side_validation: true, + required: false, + serialized_name: 'diskName', + type: { + name: 'String' + } + }, + disk_type: { + client_side_validation: true, + required: false, + serialized_name: 'diskType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options_fragment.rb new file mode 100644 index 0000000000..47a869dc44 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options_fragment.rb @@ -0,0 +1,69 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties to attach new disk to the Virtual Machine. + # + class AttachNewDataDiskOptionsFragment + + include MsRestAzure + + # @return [Integer] Size of the disk to be attached in Gibibytes. + attr_accessor :disk_size_gi_b + + # @return [String] The name of the disk to be attached. + attr_accessor :disk_name + + # @return [StorageType] The storage type for the disk (i.e. Standard, + # Premium). Possible values include: 'Standard', 'Premium' + attr_accessor :disk_type + + + # + # Mapper for AttachNewDataDiskOptionsFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AttachNewDataDiskOptionsFragment', + type: { + name: 'Composite', + class_name: 'AttachNewDataDiskOptionsFragment', + model_properties: { + disk_size_gi_b: { + client_side_validation: true, + required: false, + serialized_name: 'diskSizeGiB', + type: { + name: 'Number' + } + }, + disk_name: { + client_side_validation: true, + required: false, + serialized_name: 'diskName', + type: { + name: 'String' + } + }, + disk_type: { + client_side_validation: true, + required: false, + serialized_name: 'diskType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb new file mode 100644 index 0000000000..360cc2147c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Parameters for creating multiple virtual machines as a single action. + # + class BulkCreationParameters + + include MsRestAzure + + # @return [Integer] The number of virtual machine instances to create. + attr_accessor :instance_count + + + # + # Mapper for BulkCreationParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'BulkCreationParameters', + type: { + name: 'Composite', + class_name: 'BulkCreationParameters', + model_properties: { + instance_count: { + client_side_validation: true, + required: false, + serialized_name: 'instanceCount', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters_fragment.rb new file mode 100644 index 0000000000..956446693c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Parameters for creating multiple virtual machines as a single action. + # + class BulkCreationParametersFragment + + include MsRestAzure + + # @return [Integer] The number of virtual machine instances to create. + attr_accessor :instance_count + + + # + # Mapper for BulkCreationParametersFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'BulkCreationParametersFragment', + type: { + name: 'Composite', + class_name: 'BulkCreationParametersFragment', + model_properties: { + instance_count: { + client_side_validation: true, + required: false, + serialized_name: 'instanceCount', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb new file mode 100644 index 0000000000..d6ea1e1267 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb @@ -0,0 +1,80 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A data disks attached to a virtual machine. + # + class ComputeDataDisk + + include MsRestAzure + + # @return [String] Gets data disk name. + attr_accessor :name + + # @return [String] When backed by a blob, the URI of underlying blob. + attr_accessor :disk_uri + + # @return [String] When backed by managed disk, this is the ID of the + # compute disk resource. + attr_accessor :managed_disk_id + + # @return [Integer] Gets data disk size in GiB. + attr_accessor :disk_size_gi_b + + + # + # Mapper for ComputeDataDisk class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ComputeDataDisk', + type: { + name: 'Composite', + class_name: 'ComputeDataDisk', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + disk_uri: { + client_side_validation: true, + required: false, + serialized_name: 'diskUri', + type: { + name: 'String' + } + }, + managed_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'managedDiskId', + type: { + name: 'String' + } + }, + disk_size_gi_b: { + client_side_validation: true, + required: false, + serialized_name: 'diskSizeGiB', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb new file mode 100644 index 0000000000..deff7c9f3a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb @@ -0,0 +1,80 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A data disks attached to a virtual machine. + # + class ComputeDataDiskFragment + + include MsRestAzure + + # @return [String] Gets data disk name. + attr_accessor :name + + # @return [String] When backed by a blob, the URI of underlying blob. + attr_accessor :disk_uri + + # @return [String] When backed by managed disk, this is the ID of the + # compute disk resource. + attr_accessor :managed_disk_id + + # @return [Integer] Gets data disk size in GiB. + attr_accessor :disk_size_gi_b + + + # + # Mapper for ComputeDataDiskFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ComputeDataDiskFragment', + type: { + name: 'Composite', + class_name: 'ComputeDataDiskFragment', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + disk_uri: { + client_side_validation: true, + required: false, + serialized_name: 'diskUri', + type: { + name: 'String' + } + }, + managed_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'managedDiskId', + type: { + name: 'String' + } + }, + disk_size_gi_b: { + client_side_validation: true, + required: false, + serialized_name: 'diskSizeGiB', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb new file mode 100644 index 0000000000..6f51d52920 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Status information about a virtual machine. + # + class ComputeVmInstanceViewStatus + + include MsRestAzure + + # @return [String] Gets the status Code. + attr_accessor :code + + # @return [String] Gets the short localizable label for the status. + attr_accessor :display_status + + # @return [String] Gets the message associated with the status. + attr_accessor :message + + + # + # Mapper for ComputeVmInstanceViewStatus class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ComputeVmInstanceViewStatus', + type: { + name: 'Composite', + class_name: 'ComputeVmInstanceViewStatus', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + display_status: { + client_side_validation: true, + required: false, + serialized_name: 'displayStatus', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb new file mode 100644 index 0000000000..bab9037f35 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Status information about a virtual machine. + # + class ComputeVmInstanceViewStatusFragment + + include MsRestAzure + + # @return [String] Gets the status Code. + attr_accessor :code + + # @return [String] Gets the short localizable label for the status. + attr_accessor :display_status + + # @return [String] Gets the message associated with the status. + attr_accessor :message + + + # + # Mapper for ComputeVmInstanceViewStatusFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ComputeVmInstanceViewStatusFragment', + type: { + name: 'Composite', + class_name: 'ComputeVmInstanceViewStatusFragment', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + display_status: { + client_side_validation: true, + required: false, + serialized_name: 'displayStatus', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb new file mode 100644 index 0000000000..a225ec33e5 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a virtual machine returned by the Microsoft.Compute API. + # + class ComputeVmProperties + + include MsRestAzure + + # @return [Array] Gets the statuses of the + # virtual machine. + attr_accessor :statuses + + # @return [String] Gets the OS type of the virtual machine. + attr_accessor :os_type + + # @return [String] Gets the size of the virtual machine. + attr_accessor :vm_size + + # @return [String] Gets the network interface ID of the virtual machine. + attr_accessor :network_interface_id + + # @return [String] Gets OS disk blob uri for the virtual machine. + attr_accessor :os_disk_id + + # @return [Array] Gets data disks blob uri for the virtual + # machine. + attr_accessor :data_disk_ids + + # @return [Array] Gets all data disks attached to the + # virtual machine. + attr_accessor :data_disks + + + # + # Mapper for ComputeVmProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ComputeVmProperties', + type: { + name: 'Composite', + class_name: 'ComputeVmProperties', + model_properties: { + statuses: { + client_side_validation: true, + required: false, + serialized_name: 'statuses', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ComputeVmInstanceViewStatusElementType', + type: { + name: 'Composite', + class_name: 'ComputeVmInstanceViewStatus' + } + } + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + }, + vm_size: { + client_side_validation: true, + required: false, + serialized_name: 'vmSize', + type: { + name: 'String' + } + }, + network_interface_id: { + client_side_validation: true, + required: false, + serialized_name: 'networkInterfaceId', + type: { + name: 'String' + } + }, + os_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'osDiskId', + type: { + name: 'String' + } + }, + data_disk_ids: { + client_side_validation: true, + required: false, + serialized_name: 'dataDiskIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + data_disks: { + client_side_validation: true, + required: false, + serialized_name: 'dataDisks', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ComputeDataDiskElementType', + type: { + name: 'Composite', + class_name: 'ComputeDataDisk' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb new file mode 100644 index 0000000000..4ba1acec8a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a virtual machine returned by the Microsoft.Compute API. + # + class ComputeVmPropertiesFragment + + include MsRestAzure + + # @return [Array] Gets the statuses + # of the virtual machine. + attr_accessor :statuses + + # @return [String] Gets the OS type of the virtual machine. + attr_accessor :os_type + + # @return [String] Gets the size of the virtual machine. + attr_accessor :vm_size + + # @return [String] Gets the network interface ID of the virtual machine. + attr_accessor :network_interface_id + + # @return [String] Gets OS disk blob uri for the virtual machine. + attr_accessor :os_disk_id + + # @return [Array] Gets data disks blob uri for the virtual + # machine. + attr_accessor :data_disk_ids + + # @return [Array] Gets all data disks attached + # to the virtual machine. + attr_accessor :data_disks + + + # + # Mapper for ComputeVmPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ComputeVmPropertiesFragment', + type: { + name: 'Composite', + class_name: 'ComputeVmPropertiesFragment', + model_properties: { + statuses: { + client_side_validation: true, + required: false, + serialized_name: 'statuses', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ComputeVmInstanceViewStatusFragmentElementType', + type: { + name: 'Composite', + class_name: 'ComputeVmInstanceViewStatusFragment' + } + } + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + }, + vm_size: { + client_side_validation: true, + required: false, + serialized_name: 'vmSize', + type: { + name: 'String' + } + }, + network_interface_id: { + client_side_validation: true, + required: false, + serialized_name: 'networkInterfaceId', + type: { + name: 'String' + } + }, + os_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'osDiskId', + type: { + name: 'String' + } + }, + data_disk_ids: { + client_side_validation: true, + required: false, + serialized_name: 'dataDiskIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + data_disks: { + client_side_validation: true, + required: false, + serialized_name: 'dataDisks', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ComputeDataDiskFragmentElementType', + type: { + name: 'Composite', + class_name: 'ComputeDataDiskFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb new file mode 100644 index 0000000000..56098cdb93 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a cost threshold item. + # + class CostThresholdProperties + + include MsRestAzure + + # @return [String] The ID of the cost threshold item. + attr_accessor :threshold_id + + # @return [PercentageCostThresholdProperties] The value of the percentage + # cost threshold. + attr_accessor :percentage_threshold + + # @return [CostThresholdStatus] Indicates whether this threshold will be + # displayed on cost charts. Possible values include: 'Enabled', + # 'Disabled' + attr_accessor :display_on_chart + + # @return [CostThresholdStatus] Indicates whether notifications will be + # sent when this threshold is exceeded. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :send_notification_when_exceeded + + # @return [String] Indicates the datetime when notifications were last + # sent for this threshold. + attr_accessor :notification_sent + + + # + # Mapper for CostThresholdProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CostThresholdProperties', + type: { + name: 'Composite', + class_name: 'CostThresholdProperties', + model_properties: { + threshold_id: { + client_side_validation: true, + required: false, + serialized_name: 'thresholdId', + type: { + name: 'String' + } + }, + percentage_threshold: { + client_side_validation: true, + required: false, + serialized_name: 'percentageThreshold', + type: { + name: 'Composite', + class_name: 'PercentageCostThresholdProperties' + } + }, + display_on_chart: { + client_side_validation: true, + required: false, + serialized_name: 'displayOnChart', + type: { + name: 'String' + } + }, + send_notification_when_exceeded: { + client_side_validation: true, + required: false, + serialized_name: 'sendNotificationWhenExceeded', + type: { + name: 'String' + } + }, + notification_sent: { + client_side_validation: true, + required: false, + serialized_name: 'notificationSent', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb new file mode 100644 index 0000000000..173cb21046 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for CostThresholdStatus + # + module CostThresholdStatus + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_type.rb new file mode 100644 index 0000000000..75452deba0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/cost_type.rb @@ -0,0 +1,17 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for CostType + # + module CostType + Unavailable = "Unavailable" + Reported = "Reported" + Projected = "Projected" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image.rb new file mode 100644 index 0000000000..3a25f9554c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image.rb @@ -0,0 +1,238 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A custom image. + # + class CustomImage < Resource + + include MsRestAzure + + # @return [CustomImagePropertiesFromVm] The virtual machine from which + # the image is to be created. + attr_accessor :vm + + # @return [CustomImagePropertiesCustom] The VHD from which the image is + # to be created. + attr_accessor :vhd + + # @return [String] The description of the custom image. + attr_accessor :description + + # @return [String] The author of the custom image. + attr_accessor :author + + # @return [DateTime] The creation date of the custom image. + attr_accessor :creation_date + + # @return [String] The Managed Image Id backing the custom image. + attr_accessor :managed_image_id + + # @return [String] The Managed Snapshot Id backing the custom image. + attr_accessor :managed_snapshot_id + + # @return [Array] Storage information about the + # data disks present in the custom image + attr_accessor :data_disk_storage_info + + # @return [CustomImagePropertiesFromPlan] Storage information about the + # plan related to this custom image + attr_accessor :custom_image_plan + + # @return [Boolean] Whether or not the custom images underlying + # offer/plan has been enabled for programmatic deployment + attr_accessor :is_plan_authorized + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for CustomImage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImage', + type: { + name: 'Composite', + class_name: 'CustomImage', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + vm: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vm', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromVm' + } + }, + vhd: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vhd', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesCustom' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + author: { + client_side_validation: true, + required: false, + serialized_name: 'properties.author', + type: { + name: 'String' + } + }, + creation_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + managed_image_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.managedImageId', + type: { + name: 'String' + } + }, + managed_snapshot_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.managedSnapshotId', + type: { + name: 'String' + } + }, + data_disk_storage_info: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataDiskStorageInfo', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskStorageTypeInfoElementType', + type: { + name: 'Composite', + class_name: 'DataDiskStorageTypeInfo' + } + } + } + }, + custom_image_plan: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customImagePlan', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromPlan' + } + }, + is_plan_authorized: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isPlanAuthorized', + type: { + name: 'Boolean' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_fragment.rb new file mode 100644 index 0000000000..25c57afcae --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_fragment.rb @@ -0,0 +1,167 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A custom image. + # + class CustomImageFragment < UpdateResource + + include MsRestAzure + + # @return [CustomImagePropertiesFromVmFragment] The virtual machine from + # which the image is to be created. + attr_accessor :vm + + # @return [CustomImagePropertiesCustomFragment] The VHD from which the + # image is to be created. + attr_accessor :vhd + + # @return [String] The description of the custom image. + attr_accessor :description + + # @return [String] The author of the custom image. + attr_accessor :author + + # @return [String] The Managed Image Id backing the custom image. + attr_accessor :managed_image_id + + # @return [String] The Managed Snapshot Id backing the custom image. + attr_accessor :managed_snapshot_id + + # @return [Array] Storage information + # about the data disks present in the custom image + attr_accessor :data_disk_storage_info + + # @return [CustomImagePropertiesFromPlanFragment] Storage information + # about the plan related to this custom image + attr_accessor :custom_image_plan + + # @return [Boolean] Whether or not the custom images underlying + # offer/plan has been enabled for programmatic deployment + attr_accessor :is_plan_authorized + + + # + # Mapper for CustomImageFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImageFragment', + type: { + name: 'Composite', + class_name: 'CustomImageFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + vm: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vm', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromVmFragment' + } + }, + vhd: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vhd', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesCustomFragment' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + author: { + client_side_validation: true, + required: false, + serialized_name: 'properties.author', + type: { + name: 'String' + } + }, + managed_image_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.managedImageId', + type: { + name: 'String' + } + }, + managed_snapshot_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.managedSnapshotId', + type: { + name: 'String' + } + }, + data_disk_storage_info: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataDiskStorageInfo', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskStorageTypeInfoFragmentElementType', + type: { + name: 'Composite', + class_name: 'DataDiskStorageTypeInfoFragment' + } + } + } + }, + custom_image_plan: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customImagePlan', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromPlanFragment' + } + }, + is_plan_authorized: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isPlanAuthorized', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_list.rb new file mode 100644 index 0000000000..9c868505dc --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class CustomImageList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [CustomImageList] 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 CustomImageList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImageList', + type: { + name: 'Composite', + class_name: 'CustomImageList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CustomImageElementType', + type: { + name: 'Composite', + class_name: 'CustomImage' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb new file mode 100644 index 0000000000..4bafaf9654 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb @@ -0,0 +1,17 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for CustomImageOsType + # + module CustomImageOsType + Windows = "Windows" + Linux = "Linux" + None = "None" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb new file mode 100644 index 0000000000..b6fdcb1bce --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb @@ -0,0 +1,69 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a custom image from a VHD. + # + class CustomImagePropertiesCustom + + include MsRestAzure + + # @return [String] The image name. + attr_accessor :image_name + + # @return [Boolean] Indicates whether sysprep has been run on the VHD. + attr_accessor :sys_prep + + # @return [CustomImageOsType] The OS type of the custom image (i.e. + # Windows, Linux). Possible values include: 'Windows', 'Linux', 'None' + attr_accessor :os_type + + + # + # Mapper for CustomImagePropertiesCustom class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImagePropertiesCustom', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesCustom', + model_properties: { + image_name: { + client_side_validation: true, + required: false, + serialized_name: 'imageName', + type: { + name: 'String' + } + }, + sys_prep: { + client_side_validation: true, + required: false, + serialized_name: 'sysPrep', + type: { + name: 'Boolean' + } + }, + os_type: { + client_side_validation: true, + required: true, + serialized_name: 'osType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom_fragment.rb new file mode 100644 index 0000000000..777e138abc --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom_fragment.rb @@ -0,0 +1,69 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a custom image from a VHD. + # + class CustomImagePropertiesCustomFragment + + include MsRestAzure + + # @return [String] The image name. + attr_accessor :image_name + + # @return [Boolean] Indicates whether sysprep has been run on the VHD. + attr_accessor :sys_prep + + # @return [CustomImageOsType] The OS type of the custom image (i.e. + # Windows, Linux). Possible values include: 'Windows', 'Linux', 'None' + attr_accessor :os_type + + + # + # Mapper for CustomImagePropertiesCustomFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImagePropertiesCustomFragment', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesCustomFragment', + model_properties: { + image_name: { + client_side_validation: true, + required: false, + serialized_name: 'imageName', + type: { + name: 'String' + } + }, + sys_prep: { + client_side_validation: true, + required: false, + serialized_name: 'sysPrep', + type: { + name: 'Boolean' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan.rb new file mode 100644 index 0000000000..f8f7c3c418 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for plan on a custom image. + # + class CustomImagePropertiesFromPlan + + include MsRestAzure + + # @return [String] The id of the plan, equivalent to name of the plan + attr_accessor :id + + # @return [String] The publisher for the plan from the marketplace image + # the custom image is derived from + attr_accessor :publisher + + # @return [String] The offer for the plan from the marketplace image the + # custom image is derived from + attr_accessor :offer + + + # + # Mapper for CustomImagePropertiesFromPlan class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImagePropertiesFromPlan', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromPlan', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + serialized_name: 'publisher', + type: { + name: 'String' + } + }, + offer: { + client_side_validation: true, + required: false, + serialized_name: 'offer', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan_fragment.rb new file mode 100644 index 0000000000..c9f82d1252 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_plan_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for plan on a custom image. + # + class CustomImagePropertiesFromPlanFragment + + include MsRestAzure + + # @return [String] The id of the plan, equivalent to name of the plan + attr_accessor :id + + # @return [String] The publisher for the plan from the marketplace image + # the custom image is derived from + attr_accessor :publisher + + # @return [String] The offer for the plan from the marketplace image the + # custom image is derived from + attr_accessor :offer + + + # + # Mapper for CustomImagePropertiesFromPlanFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImagePropertiesFromPlanFragment', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromPlanFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + serialized_name: 'publisher', + type: { + name: 'String' + } + }, + offer: { + client_side_validation: true, + required: false, + serialized_name: 'offer', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb new file mode 100644 index 0000000000..e8a7285c99 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a custom image from a virtual machine. + # + class CustomImagePropertiesFromVm + + include MsRestAzure + + # @return [String] The source vm identifier. + attr_accessor :source_vm_id + + # @return [WindowsOsInfo] The Windows OS information of the VM. + attr_accessor :windows_os_info + + # @return [LinuxOsInfo] The Linux OS information of the VM. + attr_accessor :linux_os_info + + + # + # Mapper for CustomImagePropertiesFromVm class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImagePropertiesFromVm', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromVm', + model_properties: { + source_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'sourceVmId', + type: { + name: 'String' + } + }, + windows_os_info: { + client_side_validation: true, + required: false, + serialized_name: 'windowsOsInfo', + type: { + name: 'Composite', + class_name: 'WindowsOsInfo' + } + }, + linux_os_info: { + client_side_validation: true, + required: false, + serialized_name: 'linuxOsInfo', + type: { + name: 'Composite', + class_name: 'LinuxOsInfo' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm_fragment.rb new file mode 100644 index 0000000000..9a54e2178e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a custom image from a virtual machine. + # + class CustomImagePropertiesFromVmFragment + + include MsRestAzure + + # @return [String] The source vm identifier. + attr_accessor :source_vm_id + + # @return [WindowsOsInfoFragment] The Windows OS information of the VM. + attr_accessor :windows_os_info + + # @return [LinuxOsInfoFragment] The Linux OS information of the VM. + attr_accessor :linux_os_info + + + # + # Mapper for CustomImagePropertiesFromVmFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CustomImagePropertiesFromVmFragment', + type: { + name: 'Composite', + class_name: 'CustomImagePropertiesFromVmFragment', + model_properties: { + source_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'sourceVmId', + type: { + name: 'String' + } + }, + windows_os_info: { + client_side_validation: true, + required: false, + serialized_name: 'windowsOsInfo', + type: { + name: 'Composite', + class_name: 'WindowsOsInfoFragment' + } + }, + linux_os_info: { + client_side_validation: true, + required: false, + serialized_name: 'linuxOsInfo', + type: { + name: 'Composite', + class_name: 'LinuxOsInfoFragment' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb new file mode 100644 index 0000000000..1e9de1bedc --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb @@ -0,0 +1,73 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Request body for adding a new or existing data disk to a virtual machine. + # + class DataDiskProperties + + include MsRestAzure + + # @return [AttachNewDataDiskOptions] Specifies options to attach a new + # disk to the virtual machine. + attr_accessor :attach_new_data_disk_options + + # @return [String] Specifies the existing lab disk id to attach to + # virtual machine. + attr_accessor :existing_lab_disk_id + + # @return [HostCachingOptions] Caching option for a data disk (i.e. None, + # ReadOnly, ReadWrite). Possible values include: 'None', 'ReadOnly', + # 'ReadWrite' + attr_accessor :host_caching + + + # + # Mapper for DataDiskProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskProperties', + type: { + name: 'Composite', + class_name: 'DataDiskProperties', + model_properties: { + attach_new_data_disk_options: { + client_side_validation: true, + required: false, + serialized_name: 'attachNewDataDiskOptions', + type: { + name: 'Composite', + class_name: 'AttachNewDataDiskOptions' + } + }, + existing_lab_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'existingLabDiskId', + type: { + name: 'String' + } + }, + host_caching: { + client_side_validation: true, + required: false, + serialized_name: 'hostCaching', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties_fragment.rb new file mode 100644 index 0000000000..95079355e2 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_properties_fragment.rb @@ -0,0 +1,73 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Request body for adding a new or existing data disk to a virtual machine. + # + class DataDiskPropertiesFragment + + include MsRestAzure + + # @return [AttachNewDataDiskOptionsFragment] Specifies options to attach + # a new disk to the virtual machine. + attr_accessor :attach_new_data_disk_options + + # @return [String] Specifies the existing lab disk id to attach to + # virtual machine. + attr_accessor :existing_lab_disk_id + + # @return [HostCachingOptions] Caching option for a data disk (i.e. None, + # ReadOnly, ReadWrite). Possible values include: 'None', 'ReadOnly', + # 'ReadWrite' + attr_accessor :host_caching + + + # + # Mapper for DataDiskPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskPropertiesFragment', + type: { + name: 'Composite', + class_name: 'DataDiskPropertiesFragment', + model_properties: { + attach_new_data_disk_options: { + client_side_validation: true, + required: false, + serialized_name: 'attachNewDataDiskOptions', + type: { + name: 'Composite', + class_name: 'AttachNewDataDiskOptionsFragment' + } + }, + existing_lab_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'existingLabDiskId', + type: { + name: 'String' + } + }, + host_caching: { + client_side_validation: true, + required: false, + serialized_name: 'hostCaching', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info.rb new file mode 100644 index 0000000000..b98d44ee90 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info.rb @@ -0,0 +1,58 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Storage information about the data disks present in the custom image + # + class DataDiskStorageTypeInfo + + include MsRestAzure + + # @return [String] Disk Lun + attr_accessor :lun + + # @return [StorageType] Disk Storage Type. Possible values include: + # 'Standard', 'Premium' + attr_accessor :storage_type + + + # + # Mapper for DataDiskStorageTypeInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskStorageTypeInfo', + type: { + name: 'Composite', + class_name: 'DataDiskStorageTypeInfo', + model_properties: { + lun: { + client_side_validation: true, + required: false, + serialized_name: 'lun', + type: { + name: 'String' + } + }, + storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'storageType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info_fragment.rb new file mode 100644 index 0000000000..eafb7e15a2 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/data_disk_storage_type_info_fragment.rb @@ -0,0 +1,58 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Storage information about the data disks present in the custom image + # + class DataDiskStorageTypeInfoFragment + + include MsRestAzure + + # @return [String] Disk Lun + attr_accessor :lun + + # @return [StorageType] Disk Storage Type. Possible values include: + # 'Standard', 'Premium' + attr_accessor :storage_type + + + # + # Mapper for DataDiskStorageTypeInfoFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskStorageTypeInfoFragment', + type: { + name: 'Composite', + class_name: 'DataDiskStorageTypeInfoFragment', + model_properties: { + lun: { + client_side_validation: true, + required: false, + serialized_name: 'lun', + type: { + name: 'String' + } + }, + storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'storageType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details.rb new file mode 100644 index 0000000000..0cb56090f5 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a daily schedule. + # + class DayDetails + + include MsRestAzure + + # @return [String] The time of day the schedule will occur. + attr_accessor :time + + + # + # Mapper for DayDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DayDetails', + type: { + name: 'Composite', + class_name: 'DayDetails', + model_properties: { + time: { + client_side_validation: true, + required: false, + serialized_name: 'time', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details_fragment.rb new file mode 100644 index 0000000000..e2da34bf29 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/day_details_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a daily schedule. + # + class DayDetailsFragment + + include MsRestAzure + + # @return [String] The time of day the schedule will occur. + attr_accessor :time + + + # + # Mapper for DayDetailsFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DayDetailsFragment', + type: { + name: 'Composite', + class_name: 'DayDetailsFragment', + model_properties: { + time: { + client_side_validation: true, + required: false, + serialized_name: 'time', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb new file mode 100644 index 0000000000..396f9d33d3 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Request body for detaching data disk from a virtual machine. + # + class DetachDataDiskProperties + + include MsRestAzure + + # @return [String] Specifies the disk resource ID to detach from virtual + # machine. + attr_accessor :existing_lab_disk_id + + + # + # Mapper for DetachDataDiskProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DetachDataDiskProperties', + type: { + name: 'Composite', + class_name: 'DetachDataDiskProperties', + model_properties: { + existing_lab_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'existingLabDiskId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb new file mode 100644 index 0000000000..2bd2203613 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of the disk to detach. + # + class DetachDiskProperties + + include MsRestAzure + + # @return [String] The resource ID of the Lab VM to which the disk is + # attached. + attr_accessor :leased_by_lab_vm_id + + + # + # Mapper for DetachDiskProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DetachDiskProperties', + type: { + name: 'Composite', + class_name: 'DetachDiskProperties', + model_properties: { + leased_by_lab_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'leasedByLabVmId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk.rb new file mode 100644 index 0000000000..9a2909c9ca --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk.rb @@ -0,0 +1,204 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A Disk. + # + class Disk < Resource + + include MsRestAzure + + # @return [StorageType] The storage type for the disk (i.e. Standard, + # Premium). Possible values include: 'Standard', 'Premium' + attr_accessor :disk_type + + # @return [Integer] The size of the disk in Gibibytes. + attr_accessor :disk_size_gi_b + + # @return [String] The resource ID of the VM to which this disk is + # leased. + attr_accessor :leased_by_lab_vm_id + + # @return [String] When backed by a blob, the name of the VHD blob + # without extension. + attr_accessor :disk_blob_name + + # @return [String] When backed by a blob, the URI of underlying blob. + attr_accessor :disk_uri + + # @return [DateTime] The creation date of the disk. + attr_accessor :created_date + + # @return [String] The host caching policy of the disk (i.e. None, + # ReadOnly, ReadWrite). + attr_accessor :host_caching + + # @return [String] When backed by managed disk, this is the ID of the + # compute disk resource. + attr_accessor :managed_disk_id + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for Disk class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Disk', + type: { + name: 'Composite', + class_name: 'Disk', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + disk_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskType', + type: { + name: 'String' + } + }, + disk_size_gi_b: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskSizeGiB', + type: { + name: 'Number' + } + }, + leased_by_lab_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.leasedByLabVmId', + type: { + name: 'String' + } + }, + disk_blob_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskBlobName', + type: { + name: 'String' + } + }, + disk_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskUri', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + host_caching: { + client_side_validation: true, + required: false, + serialized_name: 'properties.hostCaching', + type: { + name: 'String' + } + }, + managed_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.managedDiskId', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_fragment.rb new file mode 100644 index 0000000000..d87fee453b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A Disk. + # + class DiskFragment < UpdateResource + + include MsRestAzure + + # @return [StorageType] The storage type for the disk (i.e. Standard, + # Premium). Possible values include: 'Standard', 'Premium' + attr_accessor :disk_type + + # @return [Integer] The size of the disk in Gibibytes. + attr_accessor :disk_size_gi_b + + # @return [String] The resource ID of the VM to which this disk is + # leased. + attr_accessor :leased_by_lab_vm_id + + # @return [String] When backed by a blob, the name of the VHD blob + # without extension. + attr_accessor :disk_blob_name + + # @return [String] When backed by a blob, the URI of underlying blob. + attr_accessor :disk_uri + + # @return [String] The host caching policy of the disk (i.e. None, + # ReadOnly, ReadWrite). + attr_accessor :host_caching + + # @return [String] When backed by managed disk, this is the ID of the + # compute disk resource. + attr_accessor :managed_disk_id + + + # + # Mapper for DiskFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DiskFragment', + type: { + name: 'Composite', + class_name: 'DiskFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + disk_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskType', + type: { + name: 'String' + } + }, + disk_size_gi_b: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskSizeGiB', + type: { + name: 'Number' + } + }, + leased_by_lab_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.leasedByLabVmId', + type: { + name: 'String' + } + }, + disk_blob_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskBlobName', + type: { + name: 'String' + } + }, + disk_uri: { + client_side_validation: true, + required: false, + serialized_name: 'properties.diskUri', + type: { + name: 'String' + } + }, + host_caching: { + client_side_validation: true, + required: false, + serialized_name: 'properties.hostCaching', + type: { + name: 'String' + } + }, + managed_disk_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.managedDiskId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_list.rb new file mode 100644 index 0000000000..661d089268 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/disk_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class DiskList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [DiskList] 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 DiskList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DiskList', + type: { + name: 'Composite', + class_name: 'DiskList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DiskElementType', + type: { + name: 'Composite', + class_name: 'Disk' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb new file mode 100644 index 0000000000..e1b52bcf79 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb @@ -0,0 +1,160 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An environment, which is essentially an ARM template deployment. + # + class DtlEnvironment < Resource + + include MsRestAzure + + # @return [EnvironmentDeploymentProperties] The deployment properties of + # the environment. + attr_accessor :deployment_properties + + # @return [String] The display name of the Azure Resource Manager + # template that produced the environment. + attr_accessor :arm_template_display_name + + # @return [String] The identifier of the resource group containing the + # environment's resources. + attr_accessor :resource_group_id + + # @return [String] The creator of the environment. + attr_accessor :created_by_user + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for DtlEnvironment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DtlEnvironment', + type: { + name: 'Composite', + class_name: 'DtlEnvironment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + deployment_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deploymentProperties', + type: { + name: 'Composite', + class_name: 'EnvironmentDeploymentProperties' + } + }, + arm_template_display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.armTemplateDisplayName', + type: { + name: 'String' + } + }, + resource_group_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.resourceGroupId', + type: { + name: 'String' + } + }, + created_by_user: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdByUser', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_fragment.rb new file mode 100644 index 0000000000..fa8e49e001 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An environment, which is essentially an ARM template deployment. + # + class DtlEnvironmentFragment < UpdateResource + + include MsRestAzure + + # @return [EnvironmentDeploymentPropertiesFragment] The deployment + # properties of the environment. + attr_accessor :deployment_properties + + # @return [String] The display name of the Azure Resource Manager + # template that produced the environment. + attr_accessor :arm_template_display_name + + + # + # Mapper for DtlEnvironmentFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DtlEnvironmentFragment', + type: { + name: 'Composite', + class_name: 'DtlEnvironmentFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + deployment_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.deploymentProperties', + type: { + name: 'Composite', + class_name: 'EnvironmentDeploymentPropertiesFragment' + } + }, + arm_template_display_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.armTemplateDisplayName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_list.rb new file mode 100644 index 0000000000..a164b60ac6 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/dtl_environment_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class DtlEnvironmentList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [DtlEnvironmentList] 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 DtlEnvironmentList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'DtlEnvironmentList', + type: { + name: 'Composite', + class_name: 'DtlEnvironmentList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DtlEnvironmentElementType', + type: { + name: 'Composite', + class_name: 'DtlEnvironment' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/enable_status.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/enable_status.rb new file mode 100644 index 0000000000..a7183b4f44 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/enable_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for EnableStatus + # + module EnableStatus + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb new file mode 100644 index 0000000000..f386162897 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb @@ -0,0 +1,67 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an environment deployment. + # + class EnvironmentDeploymentProperties + + include MsRestAzure + + # @return [String] The Azure Resource Manager template's identifier. + attr_accessor :arm_template_id + + # @return [Array] The parameters of the + # Azure Resource Manager template. + attr_accessor :parameters + + + # + # Mapper for EnvironmentDeploymentProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentDeploymentProperties', + type: { + name: 'Composite', + class_name: 'EnvironmentDeploymentProperties', + model_properties: { + arm_template_id: { + client_side_validation: true, + required: false, + serialized_name: 'armTemplateId', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateParameterPropertiesElementType', + type: { + name: 'Composite', + class_name: 'ArmTemplateParameterProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties_fragment.rb new file mode 100644 index 0000000000..eac964b220 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties_fragment.rb @@ -0,0 +1,67 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an environment deployment. + # + class EnvironmentDeploymentPropertiesFragment + + include MsRestAzure + + # @return [String] The Azure Resource Manager template's identifier. + attr_accessor :arm_template_id + + # @return [Array] The parameters + # of the Azure Resource Manager template. + attr_accessor :parameters + + + # + # Mapper for EnvironmentDeploymentPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentDeploymentPropertiesFragment', + type: { + name: 'Composite', + class_name: 'EnvironmentDeploymentPropertiesFragment', + model_properties: { + arm_template_id: { + client_side_validation: true, + required: false, + serialized_name: 'armTemplateId', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArmTemplateParameterPropertiesFragmentElementType', + type: { + name: 'Composite', + class_name: 'ArmTemplateParameterPropertiesFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_permission.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_permission.rb new file mode 100644 index 0000000000..a34a2535c9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/environment_permission.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for EnvironmentPermission + # + module EnvironmentPermission + Reader = "Reader" + Contributor = "Contributor" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb new file mode 100644 index 0000000000..3d5fcf4eb5 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb @@ -0,0 +1,79 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for evaluating a policy set. + # + class EvaluatePoliciesProperties + + include MsRestAzure + + # @return [String] The fact name. + attr_accessor :fact_name + + # @return [String] The fact data. + attr_accessor :fact_data + + # @return [String] The value offset. + attr_accessor :value_offset + + # @return [String] The user for which policies will be evaluated + attr_accessor :user_object_id + + + # + # Mapper for EvaluatePoliciesProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EvaluatePoliciesProperties', + type: { + name: 'Composite', + class_name: 'EvaluatePoliciesProperties', + model_properties: { + fact_name: { + client_side_validation: true, + required: false, + serialized_name: 'factName', + type: { + name: 'String' + } + }, + fact_data: { + client_side_validation: true, + required: false, + serialized_name: 'factData', + type: { + name: 'String' + } + }, + value_offset: { + client_side_validation: true, + required: false, + serialized_name: 'valueOffset', + type: { + name: 'String' + } + }, + user_object_id: { + client_side_validation: true, + required: false, + serialized_name: 'userObjectId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb new file mode 100644 index 0000000000..e482dd5c62 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb @@ -0,0 +1,55 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Request body for evaluating a policy set. + # + class EvaluatePoliciesRequest + + include MsRestAzure + + # @return [Array] Policies to evaluate. + attr_accessor :policies + + + # + # Mapper for EvaluatePoliciesRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EvaluatePoliciesRequest', + type: { + name: 'Composite', + class_name: 'EvaluatePoliciesRequest', + model_properties: { + policies: { + client_side_validation: true, + required: false, + serialized_name: 'policies', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EvaluatePoliciesPropertiesElementType', + type: { + name: 'Composite', + class_name: 'EvaluatePoliciesProperties' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb new file mode 100644 index 0000000000..8ebfe16815 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb @@ -0,0 +1,55 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Response body for evaluating a policy set. + # + class EvaluatePoliciesResponse + + include MsRestAzure + + # @return [Array] Results of evaluating a policy set. + attr_accessor :results + + + # + # Mapper for EvaluatePoliciesResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EvaluatePoliciesResponse', + type: { + name: 'Composite', + class_name: 'EvaluatePoliciesResponse', + model_properties: { + results: { + client_side_validation: true, + required: false, + serialized_name: 'results', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PolicySetResultElementType', + type: { + name: 'Composite', + class_name: 'PolicySetResult' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event.rb new file mode 100644 index 0000000000..87c5ba7dc9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An event to be notified for. + # + class Event + + include MsRestAzure + + # @return [NotificationChannelEventType] The event type for which this + # notification is enabled (i.e. AutoShutdown, Cost). Possible values + # include: 'AutoShutdown', 'Cost' + attr_accessor :event_name + + + # + # Mapper for Event class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Event', + type: { + name: 'Composite', + class_name: 'Event', + model_properties: { + event_name: { + client_side_validation: true, + required: false, + serialized_name: 'eventName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event_fragment.rb new file mode 100644 index 0000000000..750b8d3d08 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/event_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An event to be notified for. + # + class EventFragment + + include MsRestAzure + + # @return [NotificationChannelEventType] The event type for which this + # notification is enabled (i.e. AutoShutdown, Cost). Possible values + # include: 'AutoShutdown', 'Cost' + attr_accessor :event_name + + + # + # Mapper for EventFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EventFragment', + type: { + name: 'Composite', + class_name: 'EventFragment', + model_properties: { + event_name: { + client_side_validation: true, + required: false, + serialized_name: 'eventName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb new file mode 100644 index 0000000000..353f1e2f05 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb @@ -0,0 +1,60 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The parameters of the export operation. + # + class ExportResourceUsageParameters + + include MsRestAzure + + # @return [String] The blob storage absolute sas uri with write + # permission to the container which the usage data needs to be uploaded + # to. + attr_accessor :blob_storage_absolute_sas_uri + + # @return [DateTime] The start time of the usage. If not provided, usage + # will be reported since the beginning of data collection. + attr_accessor :usage_start_date + + + # + # Mapper for ExportResourceUsageParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExportResourceUsageParameters', + type: { + name: 'Composite', + class_name: 'ExportResourceUsageParameters', + model_properties: { + blob_storage_absolute_sas_uri: { + client_side_validation: true, + required: false, + serialized_name: 'blobStorageAbsoluteSasUri', + type: { + name: 'String' + } + }, + usage_start_date: { + client_side_validation: true, + required: false, + serialized_name: 'usageStartDate', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet.rb new file mode 100644 index 0000000000..ff44d7c2db --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Subnet information as returned by the Microsoft.Network API. + # + class ExternalSubnet + + include MsRestAzure + + # @return [String] Gets or sets the identifier. + attr_accessor :id + + # @return [String] Gets or sets the name. + attr_accessor :name + + + # + # Mapper for ExternalSubnet class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSubnet', + type: { + name: 'Composite', + class_name: 'ExternalSubnet', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb new file mode 100644 index 0000000000..e81d10bb4e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Subnet information as returned by the Microsoft.Network API. + # + class ExternalSubnetFragment + + include MsRestAzure + + # @return [String] Gets or sets the identifier. + attr_accessor :id + + # @return [String] Gets or sets the name. + attr_accessor :name + + + # + # Mapper for ExternalSubnetFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSubnetFragment', + type: { + name: 'Composite', + class_name: 'ExternalSubnetFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb new file mode 100644 index 0000000000..e562945e30 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/file_upload_options.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for FileUploadOptions + # + module FileUploadOptions + UploadFilesAndGenerateSasTokens = "UploadFilesAndGenerateSasTokens" + None = "None" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula.rb new file mode 100644 index 0000000000..1208c35c8b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula.rb @@ -0,0 +1,182 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A formula for creating a VM, specifying an image base and other + # parameters + # + class Formula < Resource + + include MsRestAzure + + # @return [String] The description of the formula. + attr_accessor :description + + # @return [String] The author of the formula. + attr_accessor :author + + # @return [String] The OS type of the formula. + attr_accessor :os_type + + # @return [DateTime] The creation date of the formula. + attr_accessor :creation_date + + # @return [LabVirtualMachineCreationParameter] The content of the + # formula. + attr_accessor :formula_content + + # @return [FormulaPropertiesFromVm] Information about a VM from which a + # formula is to be created. + attr_accessor :vm + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for Formula class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Formula', + type: { + name: 'Composite', + class_name: 'Formula', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + author: { + client_side_validation: true, + required: false, + serialized_name: 'properties.author', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + creation_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + formula_content: { + client_side_validation: true, + required: false, + serialized_name: 'properties.formulaContent', + type: { + name: 'Composite', + class_name: 'LabVirtualMachineCreationParameter' + } + }, + vm: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vm', + type: { + name: 'Composite', + class_name: 'FormulaPropertiesFromVm' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_fragment.rb new file mode 100644 index 0000000000..1adf6d104f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_fragment.rb @@ -0,0 +1,111 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A formula for creating a VM, specifying an image base and other + # parameters + # + class FormulaFragment < UpdateResource + + include MsRestAzure + + # @return [String] The description of the formula. + attr_accessor :description + + # @return [String] The author of the formula. + attr_accessor :author + + # @return [String] The OS type of the formula. + attr_accessor :os_type + + # @return [LabVirtualMachineCreationParameterFragment] The content of the + # formula. + attr_accessor :formula_content + + # @return [FormulaPropertiesFromVmFragment] Information about a VM from + # which a formula is to be created. + attr_accessor :vm + + + # + # Mapper for FormulaFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FormulaFragment', + type: { + name: 'Composite', + class_name: 'FormulaFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + author: { + client_side_validation: true, + required: false, + serialized_name: 'properties.author', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + formula_content: { + client_side_validation: true, + required: false, + serialized_name: 'properties.formulaContent', + type: { + name: 'Composite', + class_name: 'LabVirtualMachineCreationParameterFragment' + } + }, + vm: { + client_side_validation: true, + required: false, + serialized_name: 'properties.vm', + type: { + name: 'Composite', + class_name: 'FormulaPropertiesFromVmFragment' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_list.rb new file mode 100644 index 0000000000..df8fbfa421 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class FormulaList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [FormulaList] 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 FormulaList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FormulaList', + type: { + name: 'Composite', + class_name: 'FormulaList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'FormulaElementType', + type: { + name: 'Composite', + class_name: 'Formula' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb new file mode 100644 index 0000000000..d68a2da07f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a VM from which a formula is to be created. + # + class FormulaPropertiesFromVm + + include MsRestAzure + + # @return [String] The identifier of the VM from which a formula is to be + # created. + attr_accessor :lab_vm_id + + + # + # Mapper for FormulaPropertiesFromVm class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FormulaPropertiesFromVm', + type: { + name: 'Composite', + class_name: 'FormulaPropertiesFromVm', + model_properties: { + lab_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'labVmId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm_fragment.rb new file mode 100644 index 0000000000..1e25137799 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a VM from which a formula is to be created. + # + class FormulaPropertiesFromVmFragment + + include MsRestAzure + + # @return [String] The identifier of the VM from which a formula is to be + # created. + attr_accessor :lab_vm_id + + + # + # Mapper for FormulaPropertiesFromVmFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'FormulaPropertiesFromVmFragment', + type: { + name: 'Composite', + class_name: 'FormulaPropertiesFromVmFragment', + model_properties: { + lab_vm_id: { + client_side_validation: true, + required: false, + serialized_name: 'labVmId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image.rb new file mode 100644 index 0000000000..76d4a3a89c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image.rb @@ -0,0 +1,178 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A gallery image. + # + class GalleryImage < Resource + + include MsRestAzure + + # @return [String] The author of the gallery image. + attr_accessor :author + + # @return [DateTime] The creation date of the gallery image. + attr_accessor :created_date + + # @return [String] The description of the gallery image. + attr_accessor :description + + # @return [GalleryImageReference] The image reference of the gallery + # image. + attr_accessor :image_reference + + # @return [String] The icon of the gallery image. + attr_accessor :icon + + # @return [Boolean] Indicates whether this gallery image is enabled. + attr_accessor :enabled + + # @return [String] The third party plan that applies to this image + attr_accessor :plan_id + + # @return [Boolean] Indicates if the plan has been authorized for + # programmatic deployment. + attr_accessor :is_plan_authorized + + + # + # Mapper for GalleryImage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImage', + type: { + name: 'Composite', + class_name: 'GalleryImage', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + author: { + client_side_validation: true, + required: false, + serialized_name: 'properties.author', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + image_reference: { + client_side_validation: true, + required: false, + serialized_name: 'properties.imageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReference' + } + }, + icon: { + client_side_validation: true, + required: false, + serialized_name: 'properties.icon', + type: { + name: 'String' + } + }, + enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + plan_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.planId', + type: { + name: 'String' + } + }, + is_plan_authorized: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isPlanAuthorized', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_list.rb new file mode 100644 index 0000000000..2619f73053 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class GalleryImageList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [GalleryImageList] 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 GalleryImageList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageList', + type: { + name: 'Composite', + class_name: 'GalleryImageList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageElementType', + type: { + name: 'Composite', + class_name: 'GalleryImage' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb new file mode 100644 index 0000000000..4318742b82 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb @@ -0,0 +1,90 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The reference information for an Azure Marketplace image. + # + class GalleryImageReference + + include MsRestAzure + + # @return [String] The offer of the gallery image. + attr_accessor :offer + + # @return [String] The publisher of the gallery image. + attr_accessor :publisher + + # @return [String] The SKU of the gallery image. + attr_accessor :sku + + # @return [String] The OS type of the gallery image. + attr_accessor :os_type + + # @return [String] The version of the gallery image. + attr_accessor :version + + + # + # Mapper for GalleryImageReference class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReference', + model_properties: { + offer: { + client_side_validation: true, + required: false, + serialized_name: 'offer', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + serialized_name: 'publisher', + type: { + name: 'String' + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb new file mode 100644 index 0000000000..80d3407ac9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb @@ -0,0 +1,90 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The reference information for an Azure Marketplace image. + # + class GalleryImageReferenceFragment + + include MsRestAzure + + # @return [String] The offer of the gallery image. + attr_accessor :offer + + # @return [String] The publisher of the gallery image. + attr_accessor :publisher + + # @return [String] The SKU of the gallery image. + attr_accessor :sku + + # @return [String] The OS type of the gallery image. + attr_accessor :os_type + + # @return [String] The version of the gallery image. + attr_accessor :version + + + # + # Mapper for GalleryImageReferenceFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageReferenceFragment', + type: { + name: 'Composite', + class_name: 'GalleryImageReferenceFragment', + model_properties: { + offer: { + client_side_validation: true, + required: false, + serialized_name: 'offer', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + serialized_name: 'publisher', + type: { + name: 'String' + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb new file mode 100644 index 0000000000..dc943a181b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb @@ -0,0 +1,90 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Parameters for generating an ARM template for deploying artifacts. + # + class GenerateArmTemplateRequest + + include MsRestAzure + + # @return [String] The resource name of the virtual machine. + attr_accessor :virtual_machine_name + + # @return [Array] The parameters of the ARM template. + attr_accessor :parameters + + # @return [String] The location of the virtual machine. + attr_accessor :location + + # @return [FileUploadOptions] Options for uploading the files for the + # artifact. UploadFilesAndGenerateSasTokens is the default value. + # Possible values include: 'UploadFilesAndGenerateSasTokens', 'None' + attr_accessor :file_upload_options + + + # + # Mapper for GenerateArmTemplateRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GenerateArmTemplateRequest', + type: { + name: 'Composite', + class_name: 'GenerateArmTemplateRequest', + model_properties: { + virtual_machine_name: { + client_side_validation: true, + required: false, + serialized_name: 'virtualMachineName', + type: { + name: 'String' + } + }, + parameters: { + client_side_validation: true, + required: false, + serialized_name: 'parameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ParameterInfoElementType', + type: { + name: 'Composite', + class_name: 'ParameterInfo' + } + } + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + file_upload_options: { + client_side_validation: true, + required: false, + serialized_name: 'fileUploadOptions', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb new file mode 100644 index 0000000000..0d859e33a9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for generating an upload URI. + # + class GenerateUploadUriParameter + + include MsRestAzure + + # @return [String] The blob name of the upload URI. + attr_accessor :blob_name + + + # + # Mapper for GenerateUploadUriParameter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GenerateUploadUriParameter', + type: { + name: 'Composite', + class_name: 'GenerateUploadUriParameter', + model_properties: { + blob_name: { + client_side_validation: true, + required: false, + serialized_name: 'blobName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb new file mode 100644 index 0000000000..4e1a7e6462 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Response body for generating an upload URI. + # + class GenerateUploadUriResponse + + include MsRestAzure + + # @return [String] The upload URI for the VHD. + attr_accessor :upload_uri + + + # + # Mapper for GenerateUploadUriResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GenerateUploadUriResponse', + type: { + name: 'Composite', + class_name: 'GenerateUploadUriResponse', + model_properties: { + upload_uri: { + client_side_validation: true, + required: false, + serialized_name: 'uploadUri', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb new file mode 100644 index 0000000000..0f0c101384 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb @@ -0,0 +1,17 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for HostCachingOptions + # + module HostCachingOptions + None = "None" + ReadOnly = "ReadOnly" + ReadWrite = "ReadWrite" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details.rb new file mode 100644 index 0000000000..daf924fb4a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an hourly schedule. + # + class HourDetails + + include MsRestAzure + + # @return [Integer] Minutes of the hour the schedule will run. + attr_accessor :minute + + + # + # Mapper for HourDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'HourDetails', + type: { + name: 'Composite', + class_name: 'HourDetails', + model_properties: { + minute: { + client_side_validation: true, + required: false, + serialized_name: 'minute', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb new file mode 100644 index 0000000000..b613695d56 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of an hourly schedule. + # + class HourDetailsFragment + + include MsRestAzure + + # @return [Integer] Minutes of the hour the schedule will run. + attr_accessor :minute + + + # + # Mapper for HourDetailsFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'HourDetailsFragment', + type: { + name: 'Composite', + class_name: 'HourDetailsFragment', + model_properties: { + minute: { + client_side_validation: true, + required: false, + serialized_name: 'minute', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/http_status_code.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/http_status_code.rb new file mode 100644 index 0000000000..624047fe14 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/http_status_code.rb @@ -0,0 +1,56 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for HttpStatusCode + # + module HttpStatusCode + Continue = "Continue" + SwitchingProtocols = "SwitchingProtocols" + OK = "OK" + Created = "Created" + Accepted = "Accepted" + NonAuthoritativeInformation = "NonAuthoritativeInformation" + NoContent = "NoContent" + ResetContent = "ResetContent" + PartialContent = "PartialContent" + MultipleChoices = "MultipleChoices" + MovedPermanently = "MovedPermanently" + Redirect = "Redirect" + SeeOther = "SeeOther" + NotModified = "NotModified" + UseProxy = "UseProxy" + Unused = "Unused" + TemporaryRedirect = "TemporaryRedirect" + BadRequest = "BadRequest" + Unauthorized = "Unauthorized" + PaymentRequired = "PaymentRequired" + Forbidden = "Forbidden" + NotFound = "NotFound" + MethodNotAllowed = "MethodNotAllowed" + NotAcceptable = "NotAcceptable" + ProxyAuthenticationRequired = "ProxyAuthenticationRequired" + RequestTimeout = "RequestTimeout" + Conflict = "Conflict" + Gone = "Gone" + LengthRequired = "LengthRequired" + PreconditionFailed = "PreconditionFailed" + RequestEntityTooLarge = "RequestEntityTooLarge" + RequestUriTooLong = "RequestUriTooLong" + UnsupportedMediaType = "UnsupportedMediaType" + RequestedRangeNotSatisfiable = "RequestedRangeNotSatisfiable" + ExpectationFailed = "ExpectationFailed" + UpgradeRequired = "UpgradeRequired" + InternalServerError = "InternalServerError" + NotImplemented = "NotImplemented" + BadGateway = "BadGateway" + ServiceUnavailable = "ServiceUnavailable" + GatewayTimeout = "GatewayTimeout" + HttpVersionNotSupported = "HttpVersionNotSupported" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb new file mode 100644 index 0000000000..39abd1ad40 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb @@ -0,0 +1,79 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a managed identity + # + class IdentityProperties + + include MsRestAzure + + # @return [String] Managed identity. + attr_accessor :type + + # @return [String] The principal id of resource identity. + attr_accessor :principal_id + + # @return [String] The tenant identifier of resource. + attr_accessor :tenant_id + + # @return [String] The client secret URL of the identity. + attr_accessor :client_secret_url + + + # + # Mapper for IdentityProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'IdentityProperties', + type: { + name: 'Composite', + class_name: 'IdentityProperties', + model_properties: { + type: { + client_side_validation: true, + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + }, + principal_id: { + client_side_validation: true, + required: false, + serialized_name: 'principalId', + type: { + name: 'String' + } + }, + tenant_id: { + client_side_validation: true, + required: false, + serialized_name: 'tenantId', + type: { + name: 'String' + } + }, + client_secret_url: { + client_side_validation: true, + required: false, + serialized_name: 'clientSecretUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/import_lab_virtual_machine_request.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/import_lab_virtual_machine_request.rb new file mode 100644 index 0000000000..3f1a879f3f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/import_lab_virtual_machine_request.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # This represents the payload required to import a virtual machine from a + # different lab into the current one + # + class ImportLabVirtualMachineRequest + + include MsRestAzure + + # @return [String] The full resource ID of the virtual machine to be + # imported. + attr_accessor :source_virtual_machine_resource_id + + # @return [String] The name of the virtual machine in the destination lab + attr_accessor :destination_virtual_machine_name + + + # + # Mapper for ImportLabVirtualMachineRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ImportLabVirtualMachineRequest', + type: { + name: 'Composite', + class_name: 'ImportLabVirtualMachineRequest', + model_properties: { + source_virtual_machine_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'sourceVirtualMachineResourceId', + type: { + name: 'String' + } + }, + destination_virtual_machine_name: { + client_side_validation: true, + required: false, + serialized_name: 'destinationVirtualMachineName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb new file mode 100644 index 0000000000..3e51a0c6c1 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb @@ -0,0 +1,73 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A rule for NAT - exposing a VM's port (backendPort) on the public IP + # address using a load balancer. + # + class InboundNatRule + + include MsRestAzure + + # @return [TransportProtocol] The transport protocol for the endpoint. + # Possible values include: 'Tcp', 'Udp' + attr_accessor :transport_protocol + + # @return [Integer] The external endpoint port of the inbound connection. + # Possible values range between 1 and 65535, inclusive. If unspecified, a + # value will be allocated automatically. + attr_accessor :frontend_port + + # @return [Integer] The port to which the external traffic will be + # redirected. + attr_accessor :backend_port + + + # + # Mapper for InboundNatRule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'InboundNatRule', + type: { + name: 'Composite', + class_name: 'InboundNatRule', + model_properties: { + transport_protocol: { + client_side_validation: true, + required: false, + serialized_name: 'transportProtocol', + type: { + name: 'String' + } + }, + frontend_port: { + client_side_validation: true, + required: false, + serialized_name: 'frontendPort', + type: { + name: 'Number' + } + }, + backend_port: { + client_side_validation: true, + required: false, + serialized_name: 'backendPort', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb new file mode 100644 index 0000000000..24ab6502af --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb @@ -0,0 +1,73 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A rule for NAT - exposing a VM's port (backendPort) on the public IP + # address using a load balancer. + # + class InboundNatRuleFragment + + include MsRestAzure + + # @return [TransportProtocol] The transport protocol for the endpoint. + # Possible values include: 'Tcp', 'Udp' + attr_accessor :transport_protocol + + # @return [Integer] The external endpoint port of the inbound connection. + # Possible values range between 1 and 65535, inclusive. If unspecified, a + # value will be allocated automatically. + attr_accessor :frontend_port + + # @return [Integer] The port to which the external traffic will be + # redirected. + attr_accessor :backend_port + + + # + # Mapper for InboundNatRuleFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'InboundNatRuleFragment', + type: { + name: 'Composite', + class_name: 'InboundNatRuleFragment', + model_properties: { + transport_protocol: { + client_side_validation: true, + required: false, + serialized_name: 'transportProtocol', + type: { + name: 'String' + } + }, + frontend_port: { + client_side_validation: true, + required: false, + serialized_name: 'frontendPort', + type: { + name: 'Number' + } + }, + backend_port: { + client_side_validation: true, + required: false, + serialized_name: 'backendPort', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab.rb new file mode 100644 index 0000000000..06aecf0a2e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab.rb @@ -0,0 +1,363 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A lab. + # + class Lab < Resource + + include MsRestAzure + + # @return [String] The lab's default storage account. + attr_accessor :default_storage_account + + # @return [String] The lab's default premium storage account. + attr_accessor :default_premium_storage_account + + # @return [String] The lab's artifact storage account. + attr_accessor :artifacts_storage_account + + # @return [String] The lab's premium data disk storage account. + attr_accessor :premium_data_disk_storage_account + + # @return [String] The lab's Key vault. + attr_accessor :vault_name + + # @return [StorageType] Type of storage used by the lab. It can be either + # Premium or Standard. Default is Premium. Possible values include: + # 'Standard', 'Premium' + attr_accessor :lab_storage_type + + # @return [Array] The ordered list of artifact resource IDs that + # should be applied on all Linux VM creations by default, prior to the + # artifacts specified by the user. + attr_accessor :mandatory_artifacts_resource_ids_linux + + # @return [Array] The ordered list of artifact resource IDs that + # should be applied on all Windows VM creations by default, prior to the + # artifacts specified by the user. + attr_accessor :mandatory_artifacts_resource_ids_windows + + # @return [DateTime] The creation date of the lab. + attr_accessor :created_date + + # @return [PremiumDataDisk] The setting to enable usage of premium data + # disks. + # When its value is 'Enabled', creation of standard or premium data disks + # is allowed. + # When its value is 'Disabled', only creation of standard data disks is + # allowed. Possible values include: 'Disabled', 'Enabled' + attr_accessor :premium_data_disks + + # @return [EnvironmentPermission] The access rights to be granted to the + # user when provisioning an environment. Possible values include: + # 'Reader', 'Contributor' + attr_accessor :environment_permission + + # @return [LabAnnouncementProperties] The properties of any lab + # announcement associated with this lab + attr_accessor :announcement + + # @return [LabSupportProperties] The properties of any lab support + # message associated with this lab + attr_accessor :support + + # @return [String] The resource group in which lab virtual machines will + # be created in. + attr_accessor :vm_creation_resource_group + + # @return [String] The public IP address for the lab's load balancer. + attr_accessor :public_ip_id + + # @return [String] The load balancer used to for lab VMs that use shared + # IP address. + attr_accessor :load_balancer_id + + # @return [String] The Network Security Group attached to the lab VMs + # Network interfaces to restrict open ports. + attr_accessor :network_security_group_id + + # @return [Hash{String => String}] Extended properties of the lab used + # for experimental features + attr_accessor :extended_properties + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for Lab class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Lab', + type: { + name: 'Composite', + class_name: 'Lab', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + default_storage_account: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.defaultStorageAccount', + type: { + name: 'String' + } + }, + default_premium_storage_account: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.defaultPremiumStorageAccount', + type: { + name: 'String' + } + }, + artifacts_storage_account: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.artifactsStorageAccount', + type: { + name: 'String' + } + }, + premium_data_disk_storage_account: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.premiumDataDiskStorageAccount', + type: { + name: 'String' + } + }, + vault_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.vaultName', + type: { + name: 'String' + } + }, + lab_storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labStorageType', + type: { + name: 'String' + } + }, + mandatory_artifacts_resource_ids_linux: { + client_side_validation: true, + required: false, + serialized_name: 'properties.mandatoryArtifactsResourceIdsLinux', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + mandatory_artifacts_resource_ids_windows: { + client_side_validation: true, + required: false, + serialized_name: 'properties.mandatoryArtifactsResourceIdsWindows', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + premium_data_disks: { + client_side_validation: true, + required: false, + serialized_name: 'properties.premiumDataDisks', + type: { + name: 'String' + } + }, + environment_permission: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentPermission', + type: { + name: 'String' + } + }, + announcement: { + client_side_validation: true, + required: false, + serialized_name: 'properties.announcement', + type: { + name: 'Composite', + class_name: 'LabAnnouncementProperties' + } + }, + support: { + client_side_validation: true, + required: false, + serialized_name: 'properties.support', + type: { + name: 'Composite', + class_name: 'LabSupportProperties' + } + }, + vm_creation_resource_group: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.vmCreationResourceGroup', + type: { + name: 'String' + } + }, + public_ip_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.publicIpId', + type: { + name: 'String' + } + }, + load_balancer_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.loadBalancerId', + type: { + name: 'String' + } + }, + network_security_group_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.networkSecurityGroupId', + type: { + name: 'String' + } + }, + extended_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.extendedProperties', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties.rb new file mode 100644 index 0000000000..59ba73f3c5 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties.rb @@ -0,0 +1,117 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a lab's announcement banner + # + class LabAnnouncementProperties + + include MsRestAzure + + # @return [String] The plain text title for the lab announcement + attr_accessor :title + + # @return [String] The markdown text (if any) that this lab displays in + # the UI. If left empty/null, nothing will be shown. + attr_accessor :markdown + + # @return [EnableStatus] Is the lab announcement active/enabled at this + # time?. Possible values include: 'Enabled', 'Disabled' + attr_accessor :enabled + + # @return [DateTime] The time at which the announcement expires (null for + # never) + attr_accessor :expiration_date + + # @return [Boolean] Has this announcement expired? + attr_accessor :expired + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for LabAnnouncementProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabAnnouncementProperties', + type: { + name: 'Composite', + class_name: 'LabAnnouncementProperties', + model_properties: { + title: { + client_side_validation: true, + required: false, + serialized_name: 'title', + type: { + name: 'String' + } + }, + markdown: { + client_side_validation: true, + required: false, + serialized_name: 'markdown', + type: { + name: 'String' + } + }, + enabled: { + client_side_validation: true, + required: false, + serialized_name: 'enabled', + type: { + name: 'String' + } + }, + expiration_date: { + client_side_validation: true, + required: false, + serialized_name: 'expirationDate', + type: { + name: 'DateTime' + } + }, + expired: { + client_side_validation: true, + required: false, + serialized_name: 'expired', + type: { + name: 'Boolean' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties_fragment.rb new file mode 100644 index 0000000000..01da94dc7c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_announcement_properties_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a lab's announcement banner + # + class LabAnnouncementPropertiesFragment + + include MsRestAzure + + # @return [String] The plain text title for the lab announcement + attr_accessor :title + + # @return [String] The markdown text (if any) that this lab displays in + # the UI. If left empty/null, nothing will be shown. + attr_accessor :markdown + + # @return [EnableStatus] Is the lab announcement active/enabled at this + # time?. Possible values include: 'Enabled', 'Disabled' + attr_accessor :enabled + + # @return [DateTime] The time at which the announcement expires (null for + # never) + attr_accessor :expiration_date + + # @return [Boolean] Has this announcement expired? + attr_accessor :expired + + + # + # Mapper for LabAnnouncementPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabAnnouncementPropertiesFragment', + type: { + name: 'Composite', + class_name: 'LabAnnouncementPropertiesFragment', + model_properties: { + title: { + client_side_validation: true, + required: false, + serialized_name: 'title', + type: { + name: 'String' + } + }, + markdown: { + client_side_validation: true, + required: false, + serialized_name: 'markdown', + type: { + name: 'String' + } + }, + enabled: { + client_side_validation: true, + required: false, + serialized_name: 'enabled', + type: { + name: 'String' + } + }, + expiration_date: { + client_side_validation: true, + required: false, + serialized_name: 'expirationDate', + type: { + name: 'DateTime' + } + }, + expired: { + client_side_validation: true, + required: false, + serialized_name: 'expired', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost.rb new file mode 100644 index 0000000000..6b00d3ba80 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost.rb @@ -0,0 +1,224 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A cost item. + # + class LabCost < Resource + + include MsRestAzure + + # @return [TargetCostProperties] The target cost properties + attr_accessor :target_cost + + # @return [LabCostSummaryProperties] The lab cost summary component of + # the cost data. + attr_accessor :lab_cost_summary + + # @return [Array] The lab cost details + # component of the cost data. + attr_accessor :lab_cost_details + + # @return [Array] The resource cost component + # of the cost data. + attr_accessor :resource_costs + + # @return [String] The currency code of the cost. + attr_accessor :currency_code + + # @return [DateTime] The start time of the cost data. + attr_accessor :start_date_time + + # @return [DateTime] The end time of the cost data. + attr_accessor :end_date_time + + # @return [DateTime] The creation date of the cost. + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for LabCost class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabCost', + type: { + name: 'Composite', + class_name: 'LabCost', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + target_cost: { + client_side_validation: true, + required: false, + serialized_name: 'properties.targetCost', + type: { + name: 'Composite', + class_name: 'TargetCostProperties' + } + }, + lab_cost_summary: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.labCostSummary', + type: { + name: 'Composite', + class_name: 'LabCostSummaryProperties' + } + }, + lab_cost_details: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.labCostDetails', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabCostDetailsPropertiesElementType', + type: { + name: 'Composite', + class_name: 'LabCostDetailsProperties' + } + } + } + }, + resource_costs: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.resourceCosts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabResourceCostPropertiesElementType', + type: { + name: 'Composite', + class_name: 'LabResourceCostProperties' + } + } + } + }, + currency_code: { + client_side_validation: true, + required: false, + serialized_name: 'properties.currencyCode', + type: { + name: 'String' + } + }, + start_date_time: { + client_side_validation: true, + required: false, + serialized_name: 'properties.startDateTime', + type: { + name: 'DateTime' + } + }, + end_date_time: { + client_side_validation: true, + required: false, + serialized_name: 'properties.endDateTime', + type: { + name: 'DateTime' + } + }, + created_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_details_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_details_properties.rb new file mode 100644 index 0000000000..fb1af93774 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_details_properties.rb @@ -0,0 +1,69 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The properties of a lab cost item. + # + class LabCostDetailsProperties + + include MsRestAzure + + # @return [DateTime] The date of the cost item. + attr_accessor :date + + # @return [Float] The cost component of the cost item. + attr_accessor :cost + + # @return [CostType] The type of the cost. Possible values include: + # 'Unavailable', 'Reported', 'Projected' + attr_accessor :cost_type + + + # + # Mapper for LabCostDetailsProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabCostDetailsProperties', + type: { + name: 'Composite', + class_name: 'LabCostDetailsProperties', + model_properties: { + date: { + client_side_validation: true, + required: false, + serialized_name: 'date', + type: { + name: 'DateTime' + } + }, + cost: { + client_side_validation: true, + required: false, + serialized_name: 'cost', + type: { + name: 'Double' + } + }, + cost_type: { + client_side_validation: true, + required: false, + serialized_name: 'costType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb new file mode 100644 index 0000000000..e90b516329 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The properties of the cost summary. + # + class LabCostSummaryProperties + + include MsRestAzure + + # @return [Float] The cost component of the cost item. + attr_accessor :estimated_lab_cost + + + # + # Mapper for LabCostSummaryProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabCostSummaryProperties', + type: { + name: 'Composite', + class_name: 'LabCostSummaryProperties', + model_properties: { + estimated_lab_cost: { + client_side_validation: true, + required: false, + serialized_name: 'estimatedLabCost', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb new file mode 100644 index 0000000000..9fb4cf5ed9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb @@ -0,0 +1,181 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A lab. + # + class LabFragment < UpdateResource + + include MsRestAzure + + # @return [StorageType] Type of storage used by the lab. It can be either + # Premium or Standard. Default is Premium. Possible values include: + # 'Standard', 'Premium' + attr_accessor :lab_storage_type + + # @return [Array] The ordered list of artifact resource IDs that + # should be applied on all Linux VM creations by default, prior to the + # artifacts specified by the user. + attr_accessor :mandatory_artifacts_resource_ids_linux + + # @return [Array] The ordered list of artifact resource IDs that + # should be applied on all Windows VM creations by default, prior to the + # artifacts specified by the user. + attr_accessor :mandatory_artifacts_resource_ids_windows + + # @return [PremiumDataDisk] The setting to enable usage of premium data + # disks. + # When its value is 'Enabled', creation of standard or premium data disks + # is allowed. + # When its value is 'Disabled', only creation of standard data disks is + # allowed. Possible values include: 'Disabled', 'Enabled' + attr_accessor :premium_data_disks + + # @return [EnvironmentPermission] The access rights to be granted to the + # user when provisioning an environment. Possible values include: + # 'Reader', 'Contributor' + attr_accessor :environment_permission + + # @return [LabAnnouncementPropertiesFragment] The properties of any lab + # announcement associated with this lab + attr_accessor :announcement + + # @return [LabSupportPropertiesFragment] The properties of any lab + # support message associated with this lab + attr_accessor :support + + # @return [Hash{String => String}] Extended properties of the lab used + # for experimental features + attr_accessor :extended_properties + + + # + # Mapper for LabFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabFragment', + type: { + name: 'Composite', + class_name: 'LabFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + lab_storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labStorageType', + type: { + name: 'String' + } + }, + mandatory_artifacts_resource_ids_linux: { + client_side_validation: true, + required: false, + serialized_name: 'properties.mandatoryArtifactsResourceIdsLinux', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + mandatory_artifacts_resource_ids_windows: { + client_side_validation: true, + required: false, + serialized_name: 'properties.mandatoryArtifactsResourceIdsWindows', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + premium_data_disks: { + client_side_validation: true, + required: false, + serialized_name: 'properties.premiumDataDisks', + type: { + name: 'String' + } + }, + environment_permission: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentPermission', + type: { + name: 'String' + } + }, + announcement: { + client_side_validation: true, + required: false, + serialized_name: 'properties.announcement', + type: { + name: 'Composite', + class_name: 'LabAnnouncementPropertiesFragment' + } + }, + support: { + client_side_validation: true, + required: false, + serialized_name: 'properties.support', + type: { + name: 'Composite', + class_name: 'LabSupportPropertiesFragment' + } + }, + extended_properties: { + client_side_validation: true, + required: false, + serialized_name: 'properties.extendedProperties', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_list.rb new file mode 100644 index 0000000000..db7205a7f7 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class LabList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [LabList] 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 LabList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabList', + type: { + name: 'Composite', + class_name: 'LabList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabElementType', + type: { + name: 'Composite', + class_name: 'Lab' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_resource_cost_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_resource_cost_properties.rb new file mode 100644 index 0000000000..2bbe358aea --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_resource_cost_properties.rb @@ -0,0 +1,136 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The properties of a resource cost item. + # + class LabResourceCostProperties + + include MsRestAzure + + # @return [String] The name of the resource. + attr_accessor :resourcename + + # @return [String] The unique identifier of the resource. + attr_accessor :resource_uid + + # @return [Float] The cost component of the resource cost item. + attr_accessor :resource_cost + + # @return [String] The logical resource type (ex. virtualmachine, + # storageaccount) + attr_accessor :resource_type + + # @return [String] The owner of the resource (ex. janedoe@microsoft.com) + attr_accessor :resource_owner + + # @return [String] The category of the resource (ex. Premium_LRS, + # Standard_DS1) + attr_accessor :resource_pricing_tier + + # @return [String] The status of the resource (ex. Active) + attr_accessor :resource_status + + # @return [String] The ID of the resource + attr_accessor :resource_id + + # @return [String] The ID of the external resource + attr_accessor :external_resource_id + + + # + # Mapper for LabResourceCostProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabResourceCostProperties', + type: { + name: 'Composite', + class_name: 'LabResourceCostProperties', + model_properties: { + resourcename: { + client_side_validation: true, + required: false, + serialized_name: 'resourcename', + type: { + name: 'String' + } + }, + resource_uid: { + client_side_validation: true, + required: false, + serialized_name: 'resourceUId', + type: { + name: 'String' + } + }, + resource_cost: { + client_side_validation: true, + required: false, + serialized_name: 'resourceCost', + type: { + name: 'Double' + } + }, + resource_type: { + client_side_validation: true, + required: false, + serialized_name: 'resourceType', + type: { + name: 'String' + } + }, + resource_owner: { + client_side_validation: true, + required: false, + serialized_name: 'resourceOwner', + type: { + name: 'String' + } + }, + resource_pricing_tier: { + client_side_validation: true, + required: false, + serialized_name: 'resourcePricingTier', + type: { + name: 'String' + } + }, + resource_status: { + client_side_validation: true, + required: false, + serialized_name: 'resourceStatus', + type: { + name: 'String' + } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + external_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'externalResourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties.rb new file mode 100644 index 0000000000..344cb2ceb3 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a lab's support banner + # + class LabSupportProperties + + include MsRestAzure + + # @return [EnableStatus] Is the lab support banner active/enabled at this + # time?. Possible values include: 'Enabled', 'Disabled' + attr_accessor :enabled + + # @return [String] The markdown text (if any) that this lab displays in + # the UI. If left empty/null, nothing will be shown. + attr_accessor :markdown + + + # + # Mapper for LabSupportProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabSupportProperties', + type: { + name: 'Composite', + class_name: 'LabSupportProperties', + model_properties: { + enabled: { + client_side_validation: true, + required: false, + serialized_name: 'enabled', + type: { + name: 'String' + } + }, + markdown: { + client_side_validation: true, + required: false, + serialized_name: 'markdown', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties_fragment.rb new file mode 100644 index 0000000000..cb00bd301a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_support_properties_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a lab's support banner + # + class LabSupportPropertiesFragment + + include MsRestAzure + + # @return [EnableStatus] Is the lab support banner active/enabled at this + # time?. Possible values include: 'Enabled', 'Disabled' + attr_accessor :enabled + + # @return [String] The markdown text (if any) that this lab displays in + # the UI. If left empty/null, nothing will be shown. + attr_accessor :markdown + + + # + # Mapper for LabSupportPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabSupportPropertiesFragment', + type: { + name: 'Composite', + class_name: 'LabSupportPropertiesFragment', + model_properties: { + enabled: { + client_side_validation: true, + required: false, + serialized_name: 'enabled', + type: { + name: 'String' + } + }, + markdown: { + client_side_validation: true, + required: false, + serialized_name: 'markdown', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb new file mode 100644 index 0000000000..52e7586295 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a VHD in the lab. + # + class LabVhd + + include MsRestAzure + + # @return [String] The URI to the VHD. + attr_accessor :id + + + # + # Mapper for LabVhd class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVhd', + type: { + name: 'Composite', + class_name: 'LabVhd', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd_list.rb new file mode 100644 index 0000000000..2f2b69ee0f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_vhd_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class LabVhdList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [LabVhdList] 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 LabVhdList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVhdList', + type: { + name: 'Composite', + class_name: 'LabVhdList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabVhdElementType', + type: { + name: 'Composite', + class_name: 'LabVhd' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb new file mode 100644 index 0000000000..cd07b33ff1 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb @@ -0,0 +1,526 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A virtual machine. + # + class LabVirtualMachine < Resource + + include MsRestAzure + + # @return [String] The notes of the virtual machine. + attr_accessor :notes + + # @return [String] The object identifier of the owner of the virtual + # machine. + attr_accessor :owner_object_id + + # @return [String] The user principal name of the virtual machine owner. + attr_accessor :owner_user_principal_name + + # @return [String] The object identifier of the creator of the virtual + # machine. + attr_accessor :created_by_user_id + + # @return [String] The email address of creator of the virtual machine. + attr_accessor :created_by_user + + # @return [DateTime] The creation date of the virtual machine. + attr_accessor :created_date + + # @return [String] The resource identifier (Microsoft.Compute) of the + # virtual machine. + attr_accessor :compute_id + + # @return [String] The custom image identifier of the virtual machine. + attr_accessor :custom_image_id + + # @return [String] The OS type of the virtual machine. + attr_accessor :os_type + + # @return [String] The size of the virtual machine. + attr_accessor :size + + # @return [String] The user name of the virtual machine. + attr_accessor :user_name + + # @return [String] The password of the virtual machine administrator. + attr_accessor :password + + # @return [String] The SSH key of the virtual machine administrator. + attr_accessor :ssh_key + + # @return [Boolean] Indicates whether this virtual machine uses an SSH + # key for authentication. + attr_accessor :is_authentication_with_ssh_key + + # @return [String] The fully-qualified domain name of the virtual + # machine. + attr_accessor :fqdn + + # @return [String] The lab subnet name of the virtual machine. + attr_accessor :lab_subnet_name + + # @return [String] The lab virtual network identifier of the virtual + # machine. + attr_accessor :lab_virtual_network_id + + # @return [Boolean] Indicates whether the virtual machine is to be + # created without a public IP address. + attr_accessor :disallow_public_ip_address + + # @return [Array] The artifacts to be + # installed on the virtual machine. + attr_accessor :artifacts + + # @return [ArtifactDeploymentStatusProperties] The artifact deployment + # status for the virtual machine. + attr_accessor :artifact_deployment_status + + # @return [GalleryImageReference] The Microsoft Azure Marketplace image + # reference of the virtual machine. + attr_accessor :gallery_image_reference + + # @return [String] The id of the plan associated with the virtual machine + # image + attr_accessor :plan_id + + # @return [ComputeVmProperties] The compute virtual machine properties. + attr_accessor :compute_vm + + # @return [NetworkInterfaceProperties] The network interface properties. + attr_accessor :network_interface + + # @return [ApplicableSchedule] The applicable schedule for the virtual + # machine. + attr_accessor :applicable_schedule + + # @return [DateTime] The expiration date for VM. + attr_accessor :expiration_date + + # @return [Boolean] Indicates whether another user can take ownership of + # the virtual machine + attr_accessor :allow_claim + + # @return [String] Storage type to use for virtual machine (i.e. + # Standard, Premium). + attr_accessor :storage_type + + # @return [VirtualMachineCreationSource] Tells source of creation of lab + # virtual machine. Output property only. Possible values include: + # 'FromCustomImage', 'FromGalleryImage' + attr_accessor :virtual_machine_creation_source + + # @return [String] The resource ID of the environment that contains this + # virtual machine, if any. + attr_accessor :environment_id + + # @return [Array] New or existing data disks to + # attach to the virtual machine after creation + attr_accessor :data_disk_parameters + + # @return [Array] Virtual Machine schedules to + # be created + attr_accessor :schedule_parameters + + # @return [String] Last known compute power state captured in DTL + attr_accessor :last_known_power_state + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for LabVirtualMachine class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVirtualMachine', + type: { + name: 'Composite', + class_name: 'LabVirtualMachine', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notes', + type: { + name: 'String' + } + }, + owner_object_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerObjectId', + type: { + name: 'String' + } + }, + owner_user_principal_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerUserPrincipalName', + type: { + name: 'String' + } + }, + created_by_user_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUserId', + type: { + name: 'String' + } + }, + created_by_user: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUser', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + compute_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.computeId', + type: { + name: 'String' + } + }, + custom_image_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customImageId', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'properties.size', + type: { + name: 'String' + } + }, + user_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'properties.password', + type: { + name: 'String' + } + }, + ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sshKey', + type: { + name: 'String' + } + }, + is_authentication_with_ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isAuthenticationWithSshKey', + type: { + name: 'Boolean' + } + }, + fqdn: { + client_side_validation: true, + required: false, + serialized_name: 'properties.fqdn', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labSubnetName', + type: { + name: 'String' + } + }, + lab_virtual_network_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVirtualNetworkId', + type: { + name: 'String' + } + }, + disallow_public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disallowPublicIpAddress', + type: { + name: 'Boolean' + } + }, + artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifacts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallPropertiesElementType', + type: { + name: 'Composite', + class_name: 'ArtifactInstallProperties' + } + } + } + }, + artifact_deployment_status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifactDeploymentStatus', + type: { + name: 'Composite', + class_name: 'ArtifactDeploymentStatusProperties' + } + }, + gallery_image_reference: { + client_side_validation: true, + required: false, + serialized_name: 'properties.galleryImageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReference' + } + }, + plan_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.planId', + type: { + name: 'String' + } + }, + compute_vm: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.computeVm', + type: { + name: 'Composite', + class_name: 'ComputeVmProperties' + } + }, + network_interface: { + client_side_validation: true, + required: false, + serialized_name: 'properties.networkInterface', + type: { + name: 'Composite', + class_name: 'NetworkInterfaceProperties' + } + }, + applicable_schedule: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.applicableSchedule', + type: { + name: 'Composite', + class_name: 'ApplicableSchedule' + } + }, + expiration_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + allow_claim: { + client_side_validation: true, + required: false, + serialized_name: 'properties.allowClaim', + type: { + name: 'Boolean' + } + }, + storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.storageType', + type: { + name: 'String' + } + }, + virtual_machine_creation_source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualMachineCreationSource', + type: { + name: 'String' + } + }, + environment_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentId', + type: { + name: 'String' + } + }, + data_disk_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataDiskParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskPropertiesElementType', + type: { + name: 'Composite', + class_name: 'DataDiskProperties' + } + } + } + }, + schedule_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.scheduleParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleCreationParameterElementType', + type: { + name: 'Composite', + class_name: 'ScheduleCreationParameter' + } + } + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.lastKnownPowerState', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb new file mode 100644 index 0000000000..ddf5b9acd7 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb @@ -0,0 +1,478 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a virtual machine. + # + class LabVirtualMachineCreationParameter + + include MsRestAzure + + # @return [BulkCreationParameters] The number of virtual machine + # instances to create. + attr_accessor :bulk_creation_parameters + + # @return [String] The notes of the virtual machine. + attr_accessor :notes + + # @return [String] The object identifier of the owner of the virtual + # machine. + attr_accessor :owner_object_id + + # @return [String] The user principal name of the virtual machine owner. + attr_accessor :owner_user_principal_name + + # @return [String] The object identifier of the creator of the virtual + # machine. + attr_accessor :created_by_user_id + + # @return [String] The email address of creator of the virtual machine. + attr_accessor :created_by_user + + # @return [DateTime] The creation date of the virtual machine. + attr_accessor :created_date + + # @return [String] The resource identifier (Microsoft.Compute) of the + # virtual machine. + attr_accessor :compute_id + + # @return [String] The custom image identifier of the virtual machine. + attr_accessor :custom_image_id + + # @return [String] The OS type of the virtual machine. + attr_accessor :os_type + + # @return [String] The size of the virtual machine. + attr_accessor :size + + # @return [String] The user name of the virtual machine. + attr_accessor :user_name + + # @return [String] The password of the virtual machine administrator. + attr_accessor :password + + # @return [String] The SSH key of the virtual machine administrator. + attr_accessor :ssh_key + + # @return [Boolean] Indicates whether this virtual machine uses an SSH + # key for authentication. + attr_accessor :is_authentication_with_ssh_key + + # @return [String] The fully-qualified domain name of the virtual + # machine. + attr_accessor :fqdn + + # @return [String] The lab subnet name of the virtual machine. + attr_accessor :lab_subnet_name + + # @return [String] The lab virtual network identifier of the virtual + # machine. + attr_accessor :lab_virtual_network_id + + # @return [Boolean] Indicates whether the virtual machine is to be + # created without a public IP address. + attr_accessor :disallow_public_ip_address + + # @return [Array] The artifacts to be + # installed on the virtual machine. + attr_accessor :artifacts + + # @return [ArtifactDeploymentStatusProperties] The artifact deployment + # status for the virtual machine. + attr_accessor :artifact_deployment_status + + # @return [GalleryImageReference] The Microsoft Azure Marketplace image + # reference of the virtual machine. + attr_accessor :gallery_image_reference + + # @return [String] The id of the plan associated with the virtual machine + # image + attr_accessor :plan_id + + # @return [NetworkInterfaceProperties] The network interface properties. + attr_accessor :network_interface + + # @return [DateTime] The expiration date for VM. + attr_accessor :expiration_date + + # @return [Boolean] Indicates whether another user can take ownership of + # the virtual machine + attr_accessor :allow_claim + + # @return [String] Storage type to use for virtual machine (i.e. + # Standard, Premium). + attr_accessor :storage_type + + # @return [VirtualMachineCreationSource] Tells source of creation of lab + # virtual machine. Output property only. Possible values include: + # 'FromCustomImage', 'FromGalleryImage' + attr_accessor :virtual_machine_creation_source + + # @return [String] The resource ID of the environment that contains this + # virtual machine, if any. + attr_accessor :environment_id + + # @return [Array] New or existing data disks to + # attach to the virtual machine after creation + attr_accessor :data_disk_parameters + + # @return [Array] Virtual Machine schedules to + # be created + attr_accessor :schedule_parameters + + # @return [String] Last known compute power state captured in DTL + attr_accessor :last_known_power_state + + # @return [String] The name of the virtual machine or environment + attr_accessor :name + + # @return [String] The location of the new virtual machine or environment + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # + # Mapper for LabVirtualMachineCreationParameter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVirtualMachineCreationParameter', + type: { + name: 'Composite', + class_name: 'LabVirtualMachineCreationParameter', + model_properties: { + bulk_creation_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.bulkCreationParameters', + type: { + name: 'Composite', + class_name: 'BulkCreationParameters' + } + }, + notes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notes', + type: { + name: 'String' + } + }, + owner_object_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerObjectId', + type: { + name: 'String' + } + }, + owner_user_principal_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerUserPrincipalName', + type: { + name: 'String' + } + }, + created_by_user_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUserId', + type: { + name: 'String' + } + }, + created_by_user: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUser', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + compute_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.computeId', + type: { + name: 'String' + } + }, + custom_image_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customImageId', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'properties.size', + type: { + name: 'String' + } + }, + user_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'properties.password', + type: { + name: 'String' + } + }, + ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sshKey', + type: { + name: 'String' + } + }, + is_authentication_with_ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isAuthenticationWithSshKey', + type: { + name: 'Boolean' + } + }, + fqdn: { + client_side_validation: true, + required: false, + serialized_name: 'properties.fqdn', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labSubnetName', + type: { + name: 'String' + } + }, + lab_virtual_network_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVirtualNetworkId', + type: { + name: 'String' + } + }, + disallow_public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disallowPublicIpAddress', + type: { + name: 'Boolean' + } + }, + artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifacts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallPropertiesElementType', + type: { + name: 'Composite', + class_name: 'ArtifactInstallProperties' + } + } + } + }, + artifact_deployment_status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifactDeploymentStatus', + type: { + name: 'Composite', + class_name: 'ArtifactDeploymentStatusProperties' + } + }, + gallery_image_reference: { + client_side_validation: true, + required: false, + serialized_name: 'properties.galleryImageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReference' + } + }, + plan_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.planId', + type: { + name: 'String' + } + }, + network_interface: { + client_side_validation: true, + required: false, + serialized_name: 'properties.networkInterface', + type: { + name: 'Composite', + class_name: 'NetworkInterfaceProperties' + } + }, + expiration_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + allow_claim: { + client_side_validation: true, + required: false, + serialized_name: 'properties.allowClaim', + type: { + name: 'Boolean' + } + }, + storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.storageType', + type: { + name: 'String' + } + }, + virtual_machine_creation_source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualMachineCreationSource', + type: { + name: 'String' + } + }, + environment_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentId', + type: { + name: 'String' + } + }, + data_disk_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataDiskParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskPropertiesElementType', + type: { + name: 'Composite', + class_name: 'DataDiskProperties' + } + } + } + }, + schedule_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.scheduleParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleCreationParameterElementType', + type: { + name: 'Composite', + class_name: 'ScheduleCreationParameter' + } + } + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.lastKnownPowerState', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter_fragment.rb new file mode 100644 index 0000000000..4b3f4f6179 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter_fragment.rb @@ -0,0 +1,480 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a virtual machine. + # + class LabVirtualMachineCreationParameterFragment + + include MsRestAzure + + # @return [BulkCreationParametersFragment] The number of virtual machine + # instances to create. + attr_accessor :bulk_creation_parameters + + # @return [String] The notes of the virtual machine. + attr_accessor :notes + + # @return [String] The object identifier of the owner of the virtual + # machine. + attr_accessor :owner_object_id + + # @return [String] The user principal name of the virtual machine owner. + attr_accessor :owner_user_principal_name + + # @return [String] The object identifier of the creator of the virtual + # machine. + attr_accessor :created_by_user_id + + # @return [String] The email address of creator of the virtual machine. + attr_accessor :created_by_user + + # @return [DateTime] The creation date of the virtual machine. + attr_accessor :created_date + + # @return [String] The resource identifier (Microsoft.Compute) of the + # virtual machine. + attr_accessor :compute_id + + # @return [String] The custom image identifier of the virtual machine. + attr_accessor :custom_image_id + + # @return [String] The OS type of the virtual machine. + attr_accessor :os_type + + # @return [String] The size of the virtual machine. + attr_accessor :size + + # @return [String] The user name of the virtual machine. + attr_accessor :user_name + + # @return [String] The password of the virtual machine administrator. + attr_accessor :password + + # @return [String] The SSH key of the virtual machine administrator. + attr_accessor :ssh_key + + # @return [Boolean] Indicates whether this virtual machine uses an SSH + # key for authentication. + attr_accessor :is_authentication_with_ssh_key + + # @return [String] The fully-qualified domain name of the virtual + # machine. + attr_accessor :fqdn + + # @return [String] The lab subnet name of the virtual machine. + attr_accessor :lab_subnet_name + + # @return [String] The lab virtual network identifier of the virtual + # machine. + attr_accessor :lab_virtual_network_id + + # @return [Boolean] Indicates whether the virtual machine is to be + # created without a public IP address. + attr_accessor :disallow_public_ip_address + + # @return [Array] The artifacts to be + # installed on the virtual machine. + attr_accessor :artifacts + + # @return [ArtifactDeploymentStatusPropertiesFragment] The artifact + # deployment status for the virtual machine. + attr_accessor :artifact_deployment_status + + # @return [GalleryImageReferenceFragment] The Microsoft Azure Marketplace + # image reference of the virtual machine. + attr_accessor :gallery_image_reference + + # @return [String] The id of the plan associated with the virtual machine + # image + attr_accessor :plan_id + + # @return [NetworkInterfacePropertiesFragment] The network interface + # properties. + attr_accessor :network_interface + + # @return [DateTime] The expiration date for VM. + attr_accessor :expiration_date + + # @return [Boolean] Indicates whether another user can take ownership of + # the virtual machine + attr_accessor :allow_claim + + # @return [String] Storage type to use for virtual machine (i.e. + # Standard, Premium). + attr_accessor :storage_type + + # @return [VirtualMachineCreationSource] Tells source of creation of lab + # virtual machine. Output property only. Possible values include: + # 'FromCustomImage', 'FromGalleryImage' + attr_accessor :virtual_machine_creation_source + + # @return [String] The resource ID of the environment that contains this + # virtual machine, if any. + attr_accessor :environment_id + + # @return [Array] New or existing data disks + # to attach to the virtual machine after creation + attr_accessor :data_disk_parameters + + # @return [Array] Virtual Machine + # schedules to be created + attr_accessor :schedule_parameters + + # @return [String] Last known compute power state captured in DTL + attr_accessor :last_known_power_state + + # @return [String] The name of the virtual machine or environment + attr_accessor :name + + # @return [String] The location of the new virtual machine or environment + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # + # Mapper for LabVirtualMachineCreationParameterFragment class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVirtualMachineCreationParameterFragment', + type: { + name: 'Composite', + class_name: 'LabVirtualMachineCreationParameterFragment', + model_properties: { + bulk_creation_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.bulkCreationParameters', + type: { + name: 'Composite', + class_name: 'BulkCreationParametersFragment' + } + }, + notes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notes', + type: { + name: 'String' + } + }, + owner_object_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerObjectId', + type: { + name: 'String' + } + }, + owner_user_principal_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerUserPrincipalName', + type: { + name: 'String' + } + }, + created_by_user_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUserId', + type: { + name: 'String' + } + }, + created_by_user: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUser', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + compute_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.computeId', + type: { + name: 'String' + } + }, + custom_image_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customImageId', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'properties.size', + type: { + name: 'String' + } + }, + user_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'properties.password', + type: { + name: 'String' + } + }, + ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sshKey', + type: { + name: 'String' + } + }, + is_authentication_with_ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isAuthenticationWithSshKey', + type: { + name: 'Boolean' + } + }, + fqdn: { + client_side_validation: true, + required: false, + serialized_name: 'properties.fqdn', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labSubnetName', + type: { + name: 'String' + } + }, + lab_virtual_network_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVirtualNetworkId', + type: { + name: 'String' + } + }, + disallow_public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disallowPublicIpAddress', + type: { + name: 'Boolean' + } + }, + artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifacts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallPropertiesFragmentElementType', + type: { + name: 'Composite', + class_name: 'ArtifactInstallPropertiesFragment' + } + } + } + }, + artifact_deployment_status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifactDeploymentStatus', + type: { + name: 'Composite', + class_name: 'ArtifactDeploymentStatusPropertiesFragment' + } + }, + gallery_image_reference: { + client_side_validation: true, + required: false, + serialized_name: 'properties.galleryImageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReferenceFragment' + } + }, + plan_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.planId', + type: { + name: 'String' + } + }, + network_interface: { + client_side_validation: true, + required: false, + serialized_name: 'properties.networkInterface', + type: { + name: 'Composite', + class_name: 'NetworkInterfacePropertiesFragment' + } + }, + expiration_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + allow_claim: { + client_side_validation: true, + required: false, + serialized_name: 'properties.allowClaim', + type: { + name: 'Boolean' + } + }, + storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.storageType', + type: { + name: 'String' + } + }, + virtual_machine_creation_source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualMachineCreationSource', + type: { + name: 'String' + } + }, + environment_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentId', + type: { + name: 'String' + } + }, + data_disk_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataDiskParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskPropertiesFragmentElementType', + type: { + name: 'Composite', + class_name: 'DataDiskPropertiesFragment' + } + } + } + }, + schedule_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.scheduleParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleCreationParameterFragmentElementType', + type: { + name: 'Composite', + class_name: 'ScheduleCreationParameterFragment' + } + } + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.lastKnownPowerState', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb new file mode 100644 index 0000000000..4a574839b0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb @@ -0,0 +1,441 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A virtual machine. + # + class LabVirtualMachineFragment < UpdateResource + + include MsRestAzure + + # @return [String] The notes of the virtual machine. + attr_accessor :notes + + # @return [String] The object identifier of the owner of the virtual + # machine. + attr_accessor :owner_object_id + + # @return [String] The user principal name of the virtual machine owner. + attr_accessor :owner_user_principal_name + + # @return [String] The object identifier of the creator of the virtual + # machine. + attr_accessor :created_by_user_id + + # @return [String] The email address of creator of the virtual machine. + attr_accessor :created_by_user + + # @return [DateTime] The creation date of the virtual machine. + attr_accessor :created_date + + # @return [String] The resource identifier (Microsoft.Compute) of the + # virtual machine. + attr_accessor :compute_id + + # @return [String] The custom image identifier of the virtual machine. + attr_accessor :custom_image_id + + # @return [String] The OS type of the virtual machine. + attr_accessor :os_type + + # @return [String] The size of the virtual machine. + attr_accessor :size + + # @return [String] The user name of the virtual machine. + attr_accessor :user_name + + # @return [String] The password of the virtual machine administrator. + attr_accessor :password + + # @return [String] The SSH key of the virtual machine administrator. + attr_accessor :ssh_key + + # @return [Boolean] Indicates whether this virtual machine uses an SSH + # key for authentication. + attr_accessor :is_authentication_with_ssh_key + + # @return [String] The fully-qualified domain name of the virtual + # machine. + attr_accessor :fqdn + + # @return [String] The lab subnet name of the virtual machine. + attr_accessor :lab_subnet_name + + # @return [String] The lab virtual network identifier of the virtual + # machine. + attr_accessor :lab_virtual_network_id + + # @return [Boolean] Indicates whether the virtual machine is to be + # created without a public IP address. + attr_accessor :disallow_public_ip_address + + # @return [Array] The artifacts to be + # installed on the virtual machine. + attr_accessor :artifacts + + # @return [ArtifactDeploymentStatusPropertiesFragment] The artifact + # deployment status for the virtual machine. + attr_accessor :artifact_deployment_status + + # @return [GalleryImageReferenceFragment] The Microsoft Azure Marketplace + # image reference of the virtual machine. + attr_accessor :gallery_image_reference + + # @return [String] The id of the plan associated with the virtual machine + # image + attr_accessor :plan_id + + # @return [NetworkInterfacePropertiesFragment] The network interface + # properties. + attr_accessor :network_interface + + # @return [DateTime] The expiration date for VM. + attr_accessor :expiration_date + + # @return [Boolean] Indicates whether another user can take ownership of + # the virtual machine + attr_accessor :allow_claim + + # @return [String] Storage type to use for virtual machine (i.e. + # Standard, Premium). + attr_accessor :storage_type + + # @return [VirtualMachineCreationSource] Tells source of creation of lab + # virtual machine. Output property only. Possible values include: + # 'FromCustomImage', 'FromGalleryImage' + attr_accessor :virtual_machine_creation_source + + # @return [String] The resource ID of the environment that contains this + # virtual machine, if any. + attr_accessor :environment_id + + # @return [Array] New or existing data disks + # to attach to the virtual machine after creation + attr_accessor :data_disk_parameters + + # @return [Array] Virtual Machine + # schedules to be created + attr_accessor :schedule_parameters + + # @return [String] Last known compute power state captured in DTL + attr_accessor :last_known_power_state + + + # + # Mapper for LabVirtualMachineFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVirtualMachineFragment', + type: { + name: 'Composite', + class_name: 'LabVirtualMachineFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notes: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notes', + type: { + name: 'String' + } + }, + owner_object_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerObjectId', + type: { + name: 'String' + } + }, + owner_user_principal_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.ownerUserPrincipalName', + type: { + name: 'String' + } + }, + created_by_user_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUserId', + type: { + name: 'String' + } + }, + created_by_user: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdByUser', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + compute_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.computeId', + type: { + name: 'String' + } + }, + custom_image_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.customImageId', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'properties.size', + type: { + name: 'String' + } + }, + user_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'properties.password', + type: { + name: 'String' + } + }, + ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.sshKey', + type: { + name: 'String' + } + }, + is_authentication_with_ssh_key: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isAuthenticationWithSshKey', + type: { + name: 'Boolean' + } + }, + fqdn: { + client_side_validation: true, + required: false, + serialized_name: 'properties.fqdn', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labSubnetName', + type: { + name: 'String' + } + }, + lab_virtual_network_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.labVirtualNetworkId', + type: { + name: 'String' + } + }, + disallow_public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'properties.disallowPublicIpAddress', + type: { + name: 'Boolean' + } + }, + artifacts: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifacts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ArtifactInstallPropertiesFragmentElementType', + type: { + name: 'Composite', + class_name: 'ArtifactInstallPropertiesFragment' + } + } + } + }, + artifact_deployment_status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.artifactDeploymentStatus', + type: { + name: 'Composite', + class_name: 'ArtifactDeploymentStatusPropertiesFragment' + } + }, + gallery_image_reference: { + client_side_validation: true, + required: false, + serialized_name: 'properties.galleryImageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReferenceFragment' + } + }, + plan_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.planId', + type: { + name: 'String' + } + }, + network_interface: { + client_side_validation: true, + required: false, + serialized_name: 'properties.networkInterface', + type: { + name: 'Composite', + class_name: 'NetworkInterfacePropertiesFragment' + } + }, + expiration_date: { + client_side_validation: true, + required: false, + serialized_name: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + allow_claim: { + client_side_validation: true, + required: false, + serialized_name: 'properties.allowClaim', + type: { + name: 'Boolean' + } + }, + storage_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.storageType', + type: { + name: 'String' + } + }, + virtual_machine_creation_source: { + client_side_validation: true, + required: false, + serialized_name: 'properties.virtualMachineCreationSource', + type: { + name: 'String' + } + }, + environment_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentId', + type: { + name: 'String' + } + }, + data_disk_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dataDiskParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'DataDiskPropertiesFragmentElementType', + type: { + name: 'Composite', + class_name: 'DataDiskPropertiesFragment' + } + } + } + }, + schedule_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'properties.scheduleParameters', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleCreationParameterFragmentElementType', + type: { + name: 'Composite', + class_name: 'ScheduleCreationParameterFragment' + } + } + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.lastKnownPowerState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_list.rb new file mode 100644 index 0000000000..77e92a5860 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class LabVirtualMachineList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [LabVirtualMachineList] 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 LabVirtualMachineList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabVirtualMachineList', + type: { + name: 'Composite', + class_name: 'LabVirtualMachineList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabVirtualMachineElementType', + type: { + name: 'Composite', + class_name: 'LabVirtualMachine' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb new file mode 100644 index 0000000000..e43ed8db3c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb @@ -0,0 +1,49 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a Linux OS. + # + class LinuxOsInfo + + include MsRestAzure + + # @return [LinuxOsState] The state of the Linux OS (i.e. + # NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). Possible + # values include: 'NonDeprovisioned', 'DeprovisionRequested', + # 'DeprovisionApplied' + attr_accessor :linux_os_state + + + # + # Mapper for LinuxOsInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LinuxOsInfo', + type: { + name: 'Composite', + class_name: 'LinuxOsInfo', + model_properties: { + linux_os_state: { + client_side_validation: true, + required: false, + serialized_name: 'linuxOsState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info_fragment.rb new file mode 100644 index 0000000000..ae00d2f60f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_info_fragment.rb @@ -0,0 +1,49 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a Linux OS. + # + class LinuxOsInfoFragment + + include MsRestAzure + + # @return [LinuxOsState] The state of the Linux OS (i.e. + # NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). Possible + # values include: 'NonDeprovisioned', 'DeprovisionRequested', + # 'DeprovisionApplied' + attr_accessor :linux_os_state + + + # + # Mapper for LinuxOsInfoFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LinuxOsInfoFragment', + type: { + name: 'Composite', + class_name: 'LinuxOsInfoFragment', + model_properties: { + linux_os_state: { + client_side_validation: true, + required: false, + serialized_name: 'linuxOsState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb new file mode 100644 index 0000000000..57cf82cc31 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb @@ -0,0 +1,17 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for LinuxOsState + # + module LinuxOsState + NonDeprovisioned = "NonDeprovisioned" + DeprovisionRequested = "DeprovisionRequested" + DeprovisionApplied = "DeprovisionApplied" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb new file mode 100644 index 0000000000..1fbeee5d0a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb @@ -0,0 +1,139 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a network interface. + # + class NetworkInterfaceProperties + + include MsRestAzure + + # @return [String] The resource ID of the virtual network. + attr_accessor :virtual_network_id + + # @return [String] The resource ID of the sub net. + attr_accessor :subnet_id + + # @return [String] The resource ID of the public IP address. + attr_accessor :public_ip_address_id + + # @return [String] The public IP address. + attr_accessor :public_ip_address + + # @return [String] The private IP address. + attr_accessor :private_ip_address + + # @return [String] The DNS name. + attr_accessor :dns_name + + # @return [String] The RdpAuthority property is a server DNS host name or + # IP address followed by the service port number for RDP (Remote Desktop + # Protocol). + attr_accessor :rdp_authority + + # @return [String] The SshAuthority property is a server DNS host name or + # IP address followed by the service port number for SSH. + attr_accessor :ssh_authority + + # @return [SharedPublicIpAddressConfiguration] The configuration for + # sharing a public IP address across multiple virtual machines. + attr_accessor :shared_public_ip_address_configuration + + + # + # Mapper for NetworkInterfaceProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NetworkInterfaceProperties', + type: { + name: 'Composite', + class_name: 'NetworkInterfaceProperties', + model_properties: { + virtual_network_id: { + client_side_validation: true, + required: false, + serialized_name: 'virtualNetworkId', + type: { + name: 'String' + } + }, + subnet_id: { + client_side_validation: true, + required: false, + serialized_name: 'subnetId', + type: { + name: 'String' + } + }, + public_ip_address_id: { + client_side_validation: true, + required: false, + serialized_name: 'publicIpAddressId', + type: { + name: 'String' + } + }, + public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'publicIpAddress', + type: { + name: 'String' + } + }, + private_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'privateIpAddress', + type: { + name: 'String' + } + }, + dns_name: { + client_side_validation: true, + required: false, + serialized_name: 'dnsName', + type: { + name: 'String' + } + }, + rdp_authority: { + client_side_validation: true, + required: false, + serialized_name: 'rdpAuthority', + type: { + name: 'String' + } + }, + ssh_authority: { + client_side_validation: true, + required: false, + serialized_name: 'sshAuthority', + type: { + name: 'String' + } + }, + shared_public_ip_address_configuration: { + client_side_validation: true, + required: false, + serialized_name: 'sharedPublicIpAddressConfiguration', + type: { + name: 'Composite', + class_name: 'SharedPublicIpAddressConfiguration' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb new file mode 100644 index 0000000000..bc8a226e52 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb @@ -0,0 +1,139 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a network interface. + # + class NetworkInterfacePropertiesFragment + + include MsRestAzure + + # @return [String] The resource ID of the virtual network. + attr_accessor :virtual_network_id + + # @return [String] The resource ID of the sub net. + attr_accessor :subnet_id + + # @return [String] The resource ID of the public IP address. + attr_accessor :public_ip_address_id + + # @return [String] The public IP address. + attr_accessor :public_ip_address + + # @return [String] The private IP address. + attr_accessor :private_ip_address + + # @return [String] The DNS name. + attr_accessor :dns_name + + # @return [String] The RdpAuthority property is a server DNS host name or + # IP address followed by the service port number for RDP (Remote Desktop + # Protocol). + attr_accessor :rdp_authority + + # @return [String] The SshAuthority property is a server DNS host name or + # IP address followed by the service port number for SSH. + attr_accessor :ssh_authority + + # @return [SharedPublicIpAddressConfigurationFragment] The configuration + # for sharing a public IP address across multiple virtual machines. + attr_accessor :shared_public_ip_address_configuration + + + # + # Mapper for NetworkInterfacePropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NetworkInterfacePropertiesFragment', + type: { + name: 'Composite', + class_name: 'NetworkInterfacePropertiesFragment', + model_properties: { + virtual_network_id: { + client_side_validation: true, + required: false, + serialized_name: 'virtualNetworkId', + type: { + name: 'String' + } + }, + subnet_id: { + client_side_validation: true, + required: false, + serialized_name: 'subnetId', + type: { + name: 'String' + } + }, + public_ip_address_id: { + client_side_validation: true, + required: false, + serialized_name: 'publicIpAddressId', + type: { + name: 'String' + } + }, + public_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'publicIpAddress', + type: { + name: 'String' + } + }, + private_ip_address: { + client_side_validation: true, + required: false, + serialized_name: 'privateIpAddress', + type: { + name: 'String' + } + }, + dns_name: { + client_side_validation: true, + required: false, + serialized_name: 'dnsName', + type: { + name: 'String' + } + }, + rdp_authority: { + client_side_validation: true, + required: false, + serialized_name: 'rdpAuthority', + type: { + name: 'String' + } + }, + ssh_authority: { + client_side_validation: true, + required: false, + serialized_name: 'sshAuthority', + type: { + name: 'String' + } + }, + shared_public_ip_address_configuration: { + client_side_validation: true, + required: false, + serialized_name: 'sharedPublicIpAddressConfiguration', + type: { + name: 'Composite', + class_name: 'SharedPublicIpAddressConfigurationFragment' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel.rb new file mode 100644 index 0000000000..3b52239717 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel.rb @@ -0,0 +1,189 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A notification. + # + class NotificationChannel < Resource + + include MsRestAzure + + # @return [String] The webhook URL to send notifications to. + attr_accessor :web_hook_url + + # @return [String] The email recipient to send notifications to (can be a + # list of semi-colon separated email addresses). + attr_accessor :email_recipient + + # @return [String] The locale to use when sending a notification + # (fallback for unsupported languages is EN). + attr_accessor :notification_locale + + # @return [String] Description of notification. + attr_accessor :description + + # @return [Array] The list of event for which this notification is + # enabled. + attr_accessor :events + + # @return [DateTime] The creation date of the notification channel. + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for NotificationChannel class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotificationChannel', + type: { + name: 'Composite', + class_name: 'NotificationChannel', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + web_hook_url: { + client_side_validation: true, + required: false, + serialized_name: 'properties.webHookUrl', + type: { + name: 'String' + } + }, + email_recipient: { + client_side_validation: true, + required: false, + serialized_name: 'properties.emailRecipient', + type: { + name: 'String' + } + }, + notification_locale: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notificationLocale', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + events: { + client_side_validation: true, + required: false, + serialized_name: 'properties.events', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb new file mode 100644 index 0000000000..6f0e1d1949 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for NotificationChannelEventType + # + module NotificationChannelEventType + AutoShutdown = "AutoShutdown" + Cost = "Cost" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_fragment.rb new file mode 100644 index 0000000000..602f07bfb2 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_fragment.rb @@ -0,0 +1,118 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A notification. + # + class NotificationChannelFragment < UpdateResource + + include MsRestAzure + + # @return [String] The webhook URL to send notifications to. + attr_accessor :web_hook_url + + # @return [String] The email recipient to send notifications to (can be a + # list of semi-colon separated email addresses). + attr_accessor :email_recipient + + # @return [String] The locale to use when sending a notification + # (fallback for unsupported languages is EN). + attr_accessor :notification_locale + + # @return [String] Description of notification. + attr_accessor :description + + # @return [Array] The list of event for which this + # notification is enabled. + attr_accessor :events + + + # + # Mapper for NotificationChannelFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotificationChannelFragment', + type: { + name: 'Composite', + class_name: 'NotificationChannelFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + web_hook_url: { + client_side_validation: true, + required: false, + serialized_name: 'properties.webHookUrl', + type: { + name: 'String' + } + }, + email_recipient: { + client_side_validation: true, + required: false, + serialized_name: 'properties.emailRecipient', + type: { + name: 'String' + } + }, + notification_locale: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notificationLocale', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + events: { + client_side_validation: true, + required: false, + serialized_name: 'properties.events', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EventFragmentElementType', + type: { + name: 'Composite', + class_name: 'EventFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_list.rb new file mode 100644 index 0000000000..5f6d892592 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_channel_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class NotificationChannelList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [NotificationChannelList] 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 NotificationChannelList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotificationChannelList', + type: { + name: 'Composite', + class_name: 'NotificationChannelList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'NotificationChannelElementType', + type: { + name: 'Composite', + class_name: 'NotificationChannel' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings.rb new file mode 100644 index 0000000000..4be7b41eb4 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings.rb @@ -0,0 +1,96 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Notification settings for a schedule. + # + class NotificationSettings + + include MsRestAzure + + # @return [EnableStatus] If notifications are enabled for this schedule + # (i.e. Enabled, Disabled). Possible values include: 'Enabled', + # 'Disabled' + attr_accessor :status + + # @return [Integer] Time in minutes before event at which notification + # will be sent. + attr_accessor :time_in_minutes + + # @return [String] The webhook URL to which the notification will be + # sent. + attr_accessor :webhook_url + + # @return [String] The email recipient to send notifications to (can be a + # list of semi-colon separated email addresses). + attr_accessor :email_recipient + + # @return [String] The locale to use when sending a notification + # (fallback for unsupported languages is EN). + attr_accessor :notification_locale + + + # + # Mapper for NotificationSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotificationSettings', + type: { + name: 'Composite', + class_name: 'NotificationSettings', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + time_in_minutes: { + client_side_validation: true, + required: false, + serialized_name: 'timeInMinutes', + type: { + name: 'Number' + } + }, + webhook_url: { + client_side_validation: true, + required: false, + serialized_name: 'webhookUrl', + type: { + name: 'String' + } + }, + email_recipient: { + client_side_validation: true, + required: false, + serialized_name: 'emailRecipient', + type: { + name: 'String' + } + }, + notification_locale: { + client_side_validation: true, + required: false, + serialized_name: 'notificationLocale', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb new file mode 100644 index 0000000000..4e5eb1700e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb @@ -0,0 +1,96 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Notification settings for a schedule. + # + class NotificationSettingsFragment + + include MsRestAzure + + # @return [EnableStatus] If notifications are enabled for this schedule + # (i.e. Enabled, Disabled). Possible values include: 'Enabled', + # 'Disabled' + attr_accessor :status + + # @return [Integer] Time in minutes before event at which notification + # will be sent. + attr_accessor :time_in_minutes + + # @return [String] The webhook URL to which the notification will be + # sent. + attr_accessor :webhook_url + + # @return [String] The email recipient to send notifications to (can be a + # list of semi-colon separated email addresses). + attr_accessor :email_recipient + + # @return [String] The locale to use when sending a notification + # (fallback for unsupported languages is EN). + attr_accessor :notification_locale + + + # + # Mapper for NotificationSettingsFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotificationSettingsFragment', + type: { + name: 'Composite', + class_name: 'NotificationSettingsFragment', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + time_in_minutes: { + client_side_validation: true, + required: false, + serialized_name: 'timeInMinutes', + type: { + name: 'Number' + } + }, + webhook_url: { + client_side_validation: true, + required: false, + serialized_name: 'webhookUrl', + type: { + name: 'String' + } + }, + email_recipient: { + client_side_validation: true, + required: false, + serialized_name: 'emailRecipient', + type: { + name: 'String' + } + }, + notification_locale: { + client_side_validation: true, + required: false, + serialized_name: 'notificationLocale', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb new file mode 100644 index 0000000000..17681690ab --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb @@ -0,0 +1,58 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for generating a Notification. + # + class NotifyParameters + + include MsRestAzure + + # @return [NotificationChannelEventType] The type of event (i.e. + # AutoShutdown, Cost). Possible values include: 'AutoShutdown', 'Cost' + attr_accessor :event_name + + # @return [String] Properties for the notification in json format. + attr_accessor :json_payload + + + # + # Mapper for NotifyParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NotifyParameters', + type: { + name: 'Composite', + class_name: 'NotifyParameters', + model_properties: { + event_name: { + client_side_validation: true, + required: false, + serialized_name: 'eventName', + type: { + name: 'String' + } + }, + json_payload: { + client_side_validation: true, + required: false, + serialized_name: 'jsonPayload', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_error.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_error.rb new file mode 100644 index 0000000000..f0f5449b79 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_error.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Error details for the operation in case of a failure. + # + class OperationError + + include MsRestAzure + + # @return [String] The error code of the operation error. + attr_accessor :code + + # @return [String] The error message of the operation error. + attr_accessor :message + + + # + # Mapper for OperationError class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationError', + type: { + name: 'Composite', + class_name: 'OperationError', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata.rb new file mode 100644 index 0000000000..a3ead23d31 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The REST API operation supported by DevTestLab ResourceProvider. + # + class OperationMetadata + + include MsRestAzure + + # @return [String] Operation name: {provider}/{resource}/{operation} + attr_accessor :name + + # @return [OperationMetadataDisplay] The object that describes the + # operations + attr_accessor :display + + + # + # Mapper for OperationMetadata class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationMetadata', + type: { + name: 'Composite', + class_name: 'OperationMetadata', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationMetadataDisplay' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata_display.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata_display.rb new file mode 100644 index 0000000000..40fe6dcb8e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_metadata_display.rb @@ -0,0 +1,80 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The object that describes the operations + # + class OperationMetadataDisplay + + include MsRestAzure + + # @return [String] Friendly name of the resource provider + attr_accessor :provider + + # @return [String] Resource type on which the operation is performed. + attr_accessor :resource + + # @return [String] Operation type: read, write, delete, listKeys/action, + # etc. + attr_accessor :operation + + # @return [String] Friendly name of the operation + attr_accessor :description + + + # + # Mapper for OperationMetadataDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationMetadataDisplay', + type: { + name: 'Composite', + class_name: 'OperationMetadataDisplay', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_result.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_result.rb new file mode 100644 index 0000000000..a013868474 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/operation_result.rb @@ -0,0 +1,82 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An Operation Result + # + class OperationResult + + include MsRestAzure + + # @return [String] The operation status. + attr_accessor :status + + # @return [HttpStatusCode] The status code for the operation. Possible + # values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', + # 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + # 'PartialContent', 'MultipleChoices', 'MovedPermanently', 'Redirect', + # 'SeeOther', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', + # 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', + # 'NotFound', 'MethodNotAllowed', 'NotAcceptable', + # 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', + # 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', + # 'RequestUriTooLong', 'UnsupportedMediaType', + # 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', + # 'InternalServerError', 'NotImplemented', 'BadGateway', + # 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported' + attr_accessor :status_code + + # @return [OperationError] Error details for the operation in case of a + # failure. + attr_accessor :error + + + # + # Mapper for OperationResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationResult', + type: { + name: 'Composite', + class_name: 'OperationResult', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + status_code: { + client_side_validation: true, + required: false, + serialized_name: 'statusCode', + type: { + name: 'String' + } + }, + error: { + client_side_validation: true, + required: false, + serialized_name: 'error', + type: { + name: 'Composite', + class_name: 'OperationError' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameter_info.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameter_info.rb new file mode 100644 index 0000000000..2e4dc10401 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameter_info.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about an artifact's parameter. + # + class ParameterInfo + + include MsRestAzure + + # @return [String] The name of the artifact parameter. + attr_accessor :name + + # @return [String] The value of the artifact parameter. + attr_accessor :value + + + # + # Mapper for ParameterInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ParameterInfo', + type: { + name: 'Composite', + class_name: 'ParameterInfo', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb new file mode 100644 index 0000000000..f40fb622d2 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A file containing a set of parameter values for an ARM template. + # + class ParametersValueFileInfo + + include MsRestAzure + + # @return [String] File name. + attr_accessor :file_name + + # @return Contents of the file. + attr_accessor :parameters_value_info + + + # + # Mapper for ParametersValueFileInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ParametersValueFileInfo', + type: { + name: 'Composite', + class_name: 'ParametersValueFileInfo', + model_properties: { + file_name: { + client_side_validation: true, + required: false, + serialized_name: 'fileName', + type: { + name: 'String' + } + }, + parameters_value_info: { + client_side_validation: true, + required: false, + serialized_name: 'parametersValueInfo', + type: { + name: 'Object' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb new file mode 100644 index 0000000000..a8bdbef4c0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a percentage cost threshold. + # + class PercentageCostThresholdProperties + + include MsRestAzure + + # @return [Float] The cost threshold value. + attr_accessor :threshold_value + + + # + # Mapper for PercentageCostThresholdProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PercentageCostThresholdProperties', + type: { + name: 'Composite', + class_name: 'PercentageCostThresholdProperties', + model_properties: { + threshold_value: { + client_side_validation: true, + required: false, + serialized_name: 'thresholdValue', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy.rb new file mode 100644 index 0000000000..e273d96b56 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy.rb @@ -0,0 +1,197 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A Policy. + # + class Policy < Resource + + include MsRestAzure + + # @return [String] The description of the policy. + attr_accessor :description + + # @return [PolicyStatus] The status of the policy. Possible values + # include: 'Enabled', 'Disabled' + attr_accessor :status + + # @return [PolicyFactName] The fact name of the policy (e.g. LabVmCount, + # LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: + # 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', + # 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', + # 'UserOwnedLabVmCountInSubnet', 'LabTargetCost', 'EnvironmentTemplate', + # 'ScheduleEditPermission' + attr_accessor :fact_name + + # @return [String] The fact data of the policy. + attr_accessor :fact_data + + # @return [String] The threshold of the policy (i.e. a number for + # MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy). + attr_accessor :threshold + + # @return [PolicyEvaluatorType] The evaluator type of the policy (i.e. + # AllowedValuesPolicy, MaxValuePolicy). Possible values include: + # 'AllowedValuesPolicy', 'MaxValuePolicy' + attr_accessor :evaluator_type + + # @return [DateTime] The creation date of the policy. + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for Policy class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Policy', + type: { + name: 'Composite', + class_name: 'Policy', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + fact_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.factName', + type: { + name: 'String' + } + }, + fact_data: { + client_side_validation: true, + required: false, + serialized_name: 'properties.factData', + type: { + name: 'String' + } + }, + threshold: { + client_side_validation: true, + required: false, + serialized_name: 'properties.threshold', + type: { + name: 'String' + } + }, + evaluator_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.evaluatorType', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb new file mode 100644 index 0000000000..4a0e262aa0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for PolicyEvaluatorType + # + module PolicyEvaluatorType + AllowedValuesPolicy = "AllowedValuesPolicy" + MaxValuePolicy = "MaxValuePolicy" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb new file mode 100644 index 0000000000..b5259071d6 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb @@ -0,0 +1,24 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for PolicyFactName + # + module PolicyFactName + UserOwnedLabVmCount = "UserOwnedLabVmCount" + UserOwnedLabPremiumVmCount = "UserOwnedLabPremiumVmCount" + LabVmCount = "LabVmCount" + LabPremiumVmCount = "LabPremiumVmCount" + LabVmSize = "LabVmSize" + GalleryImage = "GalleryImage" + UserOwnedLabVmCountInSubnet = "UserOwnedLabVmCountInSubnet" + LabTargetCost = "LabTargetCost" + EnvironmentTemplate = "EnvironmentTemplate" + ScheduleEditPermission = "ScheduleEditPermission" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb new file mode 100644 index 0000000000..2f738c7281 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb @@ -0,0 +1,126 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A Policy. + # + class PolicyFragment < UpdateResource + + include MsRestAzure + + # @return [String] The description of the policy. + attr_accessor :description + + # @return [PolicyStatus] The status of the policy. Possible values + # include: 'Enabled', 'Disabled' + attr_accessor :status + + # @return [PolicyFactName] The fact name of the policy (e.g. LabVmCount, + # LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: + # 'UserOwnedLabVmCount', 'UserOwnedLabPremiumVmCount', 'LabVmCount', + # 'LabPremiumVmCount', 'LabVmSize', 'GalleryImage', + # 'UserOwnedLabVmCountInSubnet', 'LabTargetCost', 'EnvironmentTemplate', + # 'ScheduleEditPermission' + attr_accessor :fact_name + + # @return [String] The fact data of the policy. + attr_accessor :fact_data + + # @return [String] The threshold of the policy (i.e. a number for + # MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy). + attr_accessor :threshold + + # @return [PolicyEvaluatorType] The evaluator type of the policy (i.e. + # AllowedValuesPolicy, MaxValuePolicy). Possible values include: + # 'AllowedValuesPolicy', 'MaxValuePolicy' + attr_accessor :evaluator_type + + + # + # Mapper for PolicyFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PolicyFragment', + type: { + name: 'Composite', + class_name: 'PolicyFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + fact_name: { + client_side_validation: true, + required: false, + serialized_name: 'properties.factName', + type: { + name: 'String' + } + }, + fact_data: { + client_side_validation: true, + required: false, + serialized_name: 'properties.factData', + type: { + name: 'String' + } + }, + threshold: { + client_side_validation: true, + required: false, + serialized_name: 'properties.threshold', + type: { + name: 'String' + } + }, + evaluator_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.evaluatorType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_list.rb new file mode 100644 index 0000000000..563b0454e0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class PolicyList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [PolicyList] 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 PolicyList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PolicyList', + type: { + name: 'Composite', + class_name: 'PolicyList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PolicyElementType', + type: { + name: 'Composite', + class_name: 'Policy' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb new file mode 100644 index 0000000000..080e4a7d1f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb @@ -0,0 +1,67 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Result of a policy set evaluation. + # + class PolicySetResult + + include MsRestAzure + + # @return [Boolean] A value indicating whether this policy set evaluation + # has discovered violations. + attr_accessor :has_error + + # @return [Array] The list of policy violations. + attr_accessor :policy_violations + + + # + # Mapper for PolicySetResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PolicySetResult', + type: { + name: 'Composite', + class_name: 'PolicySetResult', + model_properties: { + has_error: { + client_side_validation: true, + required: false, + serialized_name: 'hasError', + type: { + name: 'Boolean' + } + }, + policy_violations: { + client_side_validation: true, + required: false, + serialized_name: 'policyViolations', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PolicyViolationElementType', + type: { + name: 'Composite', + class_name: 'PolicyViolation' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_status.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_status.rb new file mode 100644 index 0000000000..0d48726687 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for PolicyStatus + # + module PolicyStatus + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_violation.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_violation.rb new file mode 100644 index 0000000000..d03c2c07f5 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/policy_violation.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Policy violation. + # + class PolicyViolation + + include MsRestAzure + + # @return [String] The code of the policy violation. + attr_accessor :code + + # @return [String] The message of the policy violation. + attr_accessor :message + + + # + # Mapper for PolicyViolation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PolicyViolation', + type: { + name: 'Composite', + class_name: 'PolicyViolation', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port.rb new file mode 100644 index 0000000000..347988339b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port.rb @@ -0,0 +1,58 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a network port. + # + class Port + + include MsRestAzure + + # @return [TransportProtocol] Protocol type of the port. Possible values + # include: 'Tcp', 'Udp' + attr_accessor :transport_protocol + + # @return [Integer] Backend port of the target virtual machine. + attr_accessor :backend_port + + + # + # Mapper for Port class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Port', + type: { + name: 'Composite', + class_name: 'Port', + model_properties: { + transport_protocol: { + client_side_validation: true, + required: false, + serialized_name: 'transportProtocol', + type: { + name: 'String' + } + }, + backend_port: { + client_side_validation: true, + required: false, + serialized_name: 'backendPort', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port_fragment.rb new file mode 100644 index 0000000000..c2d80a0e51 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/port_fragment.rb @@ -0,0 +1,58 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a network port. + # + class PortFragment + + include MsRestAzure + + # @return [TransportProtocol] Protocol type of the port. Possible values + # include: 'Tcp', 'Udp' + attr_accessor :transport_protocol + + # @return [Integer] Backend port of the target virtual machine. + attr_accessor :backend_port + + + # + # Mapper for PortFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PortFragment', + type: { + name: 'Composite', + class_name: 'PortFragment', + model_properties: { + transport_protocol: { + client_side_validation: true, + required: false, + serialized_name: 'transportProtocol', + type: { + name: 'String' + } + }, + backend_port: { + client_side_validation: true, + required: false, + serialized_name: 'backendPort', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb new file mode 100644 index 0000000000..eb3c645a06 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/premium_data_disk.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for PremiumDataDisk + # + module PremiumDataDisk + Disabled = "Disabled" + Enabled = "Enabled" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/provider_operation_result.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/provider_operation_result.rb new file mode 100644 index 0000000000..dc0c252953 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/provider_operation_result.rb @@ -0,0 +1,101 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Result of the request to list REST API operations + # + class ProviderOperationResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] List of operations supported by the + # resource provider. + attr_accessor :value + + # @return [String] URL to get the next set of operation list results if + # there are any. + 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 [ProviderOperationResult] 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 ProviderOperationResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProviderOperationResult', + type: { + name: 'Composite', + class_name: 'ProviderOperationResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationMetadataElementType', + type: { + name: 'Composite', + class_name: 'OperationMetadata' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/rdp_connection.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/rdp_connection.rb new file mode 100644 index 0000000000..82aa324c4f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/rdp_connection.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Represents a .rdp file + # + class RdpConnection + + include MsRestAzure + + # @return [String] The contents of the .rdp file + attr_accessor :contents + + + # + # Mapper for RdpConnection class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RdpConnection', + type: { + name: 'Composite', + class_name: 'RdpConnection', + model_properties: { + contents: { + client_side_validation: true, + required: false, + serialized_name: 'contents', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb new file mode 100644 index 0000000000..418cae186b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for ReportingCycleType + # + module ReportingCycleType + CalendarMonth = "CalendarMonth" + Custom = "Custom" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resize_lab_virtual_machine_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resize_lab_virtual_machine_properties.rb new file mode 100644 index 0000000000..028e008b30 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resize_lab_virtual_machine_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Request body for resizing a virtual machine. + # + class ResizeLabVirtualMachineProperties + + include MsRestAzure + + # @return [String] Specifies the size of the virtual machine. + attr_accessor :size + + + # + # Mapper for ResizeLabVirtualMachineProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResizeLabVirtualMachineProperties', + type: { + name: 'Composite', + class_name: 'ResizeLabVirtualMachineProperties', + model_properties: { + size: { + client_side_validation: true, + required: false, + serialized_name: 'size', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resource.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resource.rb new file mode 100644 index 0000000000..ea4471674b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/resource.rb @@ -0,0 +1,110 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # An Azure resource. + # + class Resource + + include MsRestAzure + + # @return [String] The identifier of the resource. + attr_accessor :id + + # @return [String] The name of the resource. + attr_accessor :name + + # @return [String] The type of the resource. + attr_accessor :type + + # @return [String] The location of the resource. + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb new file mode 100644 index 0000000000..e064c74aa3 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for retargeting a virtual machine schedule. + # + class RetargetScheduleProperties + + include MsRestAzure + + # @return [String] The resource Id of the virtual machine on which the + # schedule operates + attr_accessor :current_resource_id + + # @return [String] The resource Id of the virtual machine that the + # schedule should be retargeted to + attr_accessor :target_resource_id + + + # + # Mapper for RetargetScheduleProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RetargetScheduleProperties', + type: { + name: 'Composite', + class_name: 'RetargetScheduleProperties', + model_properties: { + current_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'currentResourceId', + type: { + name: 'String' + } + }, + target_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'targetResourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule.rb new file mode 100644 index 0000000000..836b29900d --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule.rb @@ -0,0 +1,219 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A schedule. + # + class Schedule < Resource + + include MsRestAzure + + # @return [EnableStatus] The status of the schedule (i.e. Enabled, + # Disabled). Possible values include: 'Enabled', 'Disabled' + attr_accessor :status + + # @return [String] The task type of the schedule (e.g. + # LabVmsShutdownTask, LabVmAutoStart). + attr_accessor :task_type + + # @return [WeekDetails] If the schedule will occur only some days of the + # week, specify the weekly recurrence. + attr_accessor :weekly_recurrence + + # @return [DayDetails] If the schedule will occur once each day of the + # week, specify the daily recurrence. + attr_accessor :daily_recurrence + + # @return [HourDetails] If the schedule will occur multiple times a day, + # specify the hourly recurrence. + attr_accessor :hourly_recurrence + + # @return [String] The time zone ID (e.g. Pacific Standard time). + attr_accessor :time_zone_id + + # @return [NotificationSettings] Notification settings. + attr_accessor :notification_settings + + # @return [DateTime] The creation date of the schedule. + attr_accessor :created_date + + # @return [String] The resource ID to which the schedule belongs + attr_accessor :target_resource_id + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for Schedule class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Schedule', + type: { + name: 'Composite', + class_name: 'Schedule', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + task_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.taskType', + type: { + name: 'String' + } + }, + weekly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.weeklyRecurrence', + type: { + name: 'Composite', + class_name: 'WeekDetails' + } + }, + daily_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dailyRecurrence', + type: { + name: 'Composite', + class_name: 'DayDetails' + } + }, + hourly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.hourlyRecurrence', + type: { + name: 'Composite', + class_name: 'HourDetails' + } + }, + time_zone_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.timeZoneId', + type: { + name: 'String' + } + }, + notification_settings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notificationSettings', + type: { + name: 'Composite', + class_name: 'NotificationSettings' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + target_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.targetResourceId', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter.rb new file mode 100644 index 0000000000..fbbde4b7b0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter.rb @@ -0,0 +1,173 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a schedule. + # + class ScheduleCreationParameter + + include MsRestAzure + + # @return [EnableStatus] The status of the schedule (i.e. Enabled, + # Disabled). Possible values include: 'Enabled', 'Disabled' + attr_accessor :status + + # @return [String] The task type of the schedule (e.g. + # LabVmsShutdownTask, LabVmAutoStart). + attr_accessor :task_type + + # @return [WeekDetails] If the schedule will occur only some days of the + # week, specify the weekly recurrence. + attr_accessor :weekly_recurrence + + # @return [DayDetails] If the schedule will occur once each day of the + # week, specify the daily recurrence. + attr_accessor :daily_recurrence + + # @return [HourDetails] If the schedule will occur multiple times a day, + # specify the hourly recurrence. + attr_accessor :hourly_recurrence + + # @return [String] The time zone ID (e.g. Pacific Standard time). + attr_accessor :time_zone_id + + # @return [NotificationSettings] Notification settings. + attr_accessor :notification_settings + + # @return [String] The resource ID to which the schedule belongs + attr_accessor :target_resource_id + + # @return [String] The name of the virtual machine or environment + attr_accessor :name + + # @return [String] The location of the new virtual machine or environment + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # + # Mapper for ScheduleCreationParameter class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleCreationParameter', + type: { + name: 'Composite', + class_name: 'ScheduleCreationParameter', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + task_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.taskType', + type: { + name: 'String' + } + }, + weekly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.weeklyRecurrence', + type: { + name: 'Composite', + class_name: 'WeekDetails' + } + }, + daily_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dailyRecurrence', + type: { + name: 'Composite', + class_name: 'DayDetails' + } + }, + hourly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.hourlyRecurrence', + type: { + name: 'Composite', + class_name: 'HourDetails' + } + }, + time_zone_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.timeZoneId', + type: { + name: 'String' + } + }, + notification_settings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notificationSettings', + type: { + name: 'Composite', + class_name: 'NotificationSettings' + } + }, + target_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.targetResourceId', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter_fragment.rb new file mode 100644 index 0000000000..981bb1963f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_creation_parameter_fragment.rb @@ -0,0 +1,173 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties for creating a schedule. + # + class ScheduleCreationParameterFragment + + include MsRestAzure + + # @return [EnableStatus] The status of the schedule (i.e. Enabled, + # Disabled). Possible values include: 'Enabled', 'Disabled' + attr_accessor :status + + # @return [String] The task type of the schedule (e.g. + # LabVmsShutdownTask, LabVmAutoStart). + attr_accessor :task_type + + # @return [WeekDetailsFragment] If the schedule will occur only some days + # of the week, specify the weekly recurrence. + attr_accessor :weekly_recurrence + + # @return [DayDetailsFragment] If the schedule will occur once each day + # of the week, specify the daily recurrence. + attr_accessor :daily_recurrence + + # @return [HourDetailsFragment] If the schedule will occur multiple times + # a day, specify the hourly recurrence. + attr_accessor :hourly_recurrence + + # @return [String] The time zone ID (e.g. Pacific Standard time). + attr_accessor :time_zone_id + + # @return [NotificationSettingsFragment] Notification settings. + attr_accessor :notification_settings + + # @return [String] The resource ID to which the schedule belongs + attr_accessor :target_resource_id + + # @return [String] The name of the virtual machine or environment + attr_accessor :name + + # @return [String] The location of the new virtual machine or environment + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # + # Mapper for ScheduleCreationParameterFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleCreationParameterFragment', + type: { + name: 'Composite', + class_name: 'ScheduleCreationParameterFragment', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + task_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.taskType', + type: { + name: 'String' + } + }, + weekly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.weeklyRecurrence', + type: { + name: 'Composite', + class_name: 'WeekDetailsFragment' + } + }, + daily_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dailyRecurrence', + type: { + name: 'Composite', + class_name: 'DayDetailsFragment' + } + }, + hourly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.hourlyRecurrence', + type: { + name: 'Composite', + class_name: 'HourDetailsFragment' + } + }, + time_zone_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.timeZoneId', + type: { + name: 'String' + } + }, + notification_settings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notificationSettings', + type: { + name: 'Composite', + class_name: 'NotificationSettingsFragment' + } + }, + target_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.targetResourceId', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb new file mode 100644 index 0000000000..a7991a3cc9 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb @@ -0,0 +1,148 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A schedule. + # + class ScheduleFragment < UpdateResource + + include MsRestAzure + + # @return [EnableStatus] The status of the schedule (i.e. Enabled, + # Disabled). Possible values include: 'Enabled', 'Disabled' + attr_accessor :status + + # @return [String] The task type of the schedule (e.g. + # LabVmsShutdownTask, LabVmAutoStart). + attr_accessor :task_type + + # @return [WeekDetailsFragment] If the schedule will occur only some days + # of the week, specify the weekly recurrence. + attr_accessor :weekly_recurrence + + # @return [DayDetailsFragment] If the schedule will occur once each day + # of the week, specify the daily recurrence. + attr_accessor :daily_recurrence + + # @return [HourDetailsFragment] If the schedule will occur multiple times + # a day, specify the hourly recurrence. + attr_accessor :hourly_recurrence + + # @return [String] The time zone ID (e.g. Pacific Standard time). + attr_accessor :time_zone_id + + # @return [NotificationSettingsFragment] Notification settings. + attr_accessor :notification_settings + + # @return [String] The resource ID to which the schedule belongs + attr_accessor :target_resource_id + + + # + # Mapper for ScheduleFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleFragment', + type: { + name: 'Composite', + class_name: 'ScheduleFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + status: { + client_side_validation: true, + required: false, + serialized_name: 'properties.status', + type: { + name: 'String' + } + }, + task_type: { + client_side_validation: true, + required: false, + serialized_name: 'properties.taskType', + type: { + name: 'String' + } + }, + weekly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.weeklyRecurrence', + type: { + name: 'Composite', + class_name: 'WeekDetailsFragment' + } + }, + daily_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.dailyRecurrence', + type: { + name: 'Composite', + class_name: 'DayDetailsFragment' + } + }, + hourly_recurrence: { + client_side_validation: true, + required: false, + serialized_name: 'properties.hourlyRecurrence', + type: { + name: 'Composite', + class_name: 'HourDetailsFragment' + } + }, + time_zone_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.timeZoneId', + type: { + name: 'String' + } + }, + notification_settings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.notificationSettings', + type: { + name: 'Composite', + class_name: 'NotificationSettingsFragment' + } + }, + target_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.targetResourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_list.rb new file mode 100644 index 0000000000..1af8a0d437 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/schedule_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class ScheduleList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ScheduleList] 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 ScheduleList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleList', + type: { + name: 'Composite', + class_name: 'ScheduleList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ScheduleElementType', + type: { + name: 'Composite', + class_name: 'Schedule' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret.rb new file mode 100644 index 0000000000..f459dab507 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret.rb @@ -0,0 +1,121 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A secret. + # + class Secret < Resource + + include MsRestAzure + + # @return [String] The value of the secret for secret creation. + attr_accessor :value + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for Secret class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Secret', + type: { + name: 'Composite', + class_name: 'Secret', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'properties.value', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_fragment.rb new file mode 100644 index 0000000000..e5be1add19 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_fragment.rb @@ -0,0 +1,62 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A secret. + # + class SecretFragment < UpdateResource + + include MsRestAzure + + # @return [String] The value of the secret for secret creation. + attr_accessor :value + + + # + # Mapper for SecretFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecretFragment', + type: { + name: 'Composite', + class_name: 'SecretFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + value: { + client_side_validation: true, + required: false, + serialized_name: 'properties.value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_list.rb new file mode 100644 index 0000000000..61b590bc88 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/secret_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class SecretList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [SecretList] 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 SecretList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SecretList', + type: { + name: 'Composite', + class_name: 'SecretList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SecretElementType', + type: { + name: 'Composite', + class_name: 'Secret' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric.rb new file mode 100644 index 0000000000..254d7f40be --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric.rb @@ -0,0 +1,147 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A Service Fabric. + # + class ServiceFabric < Resource + + include MsRestAzure + + # @return [String] The backing service fabric resource's id + attr_accessor :external_service_fabric_id + + # @return [String] The resource id of the environment under which the + # service fabric resource is present + attr_accessor :environment_id + + # @return [ApplicableSchedule] The applicable schedule for the virtual + # machine. + attr_accessor :applicable_schedule + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for ServiceFabric class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceFabric', + type: { + name: 'Composite', + class_name: 'ServiceFabric', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + external_service_fabric_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.externalServiceFabricId', + type: { + name: 'String' + } + }, + environment_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentId', + type: { + name: 'String' + } + }, + applicable_schedule: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.applicableSchedule', + type: { + name: 'Composite', + class_name: 'ApplicableSchedule' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_fragment.rb new file mode 100644 index 0000000000..f6e9139b57 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_fragment.rb @@ -0,0 +1,74 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A Service Fabric. + # + class ServiceFabricFragment < UpdateResource + + include MsRestAzure + + # @return [String] The backing service fabric resource's id + attr_accessor :external_service_fabric_id + + # @return [String] The resource id of the environment under which the + # service fabric resource is present + attr_accessor :environment_id + + + # + # Mapper for ServiceFabricFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceFabricFragment', + type: { + name: 'Composite', + class_name: 'ServiceFabricFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + external_service_fabric_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.externalServiceFabricId', + type: { + name: 'String' + } + }, + environment_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.environmentId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_list.rb new file mode 100644 index 0000000000..375a434050 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_fabric_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class ServiceFabricList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ServiceFabricList] 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 ServiceFabricList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceFabricList', + type: { + name: 'Composite', + class_name: 'ServiceFabricList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ServiceFabricElementType', + type: { + name: 'Composite', + class_name: 'ServiceFabric' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner.rb new file mode 100644 index 0000000000..890a6466a2 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A container for a managed identity to execute DevTest lab services. + # + class ServiceRunner < Resource + + include MsRestAzure + + # @return [IdentityProperties] The identity of the resource. + attr_accessor :identity + + + # + # Mapper for ServiceRunner class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceRunner', + type: { + name: 'Composite', + class_name: 'ServiceRunner', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'identity', + type: { + name: 'Composite', + class_name: 'IdentityProperties' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner_list.rb new file mode 100644 index 0000000000..0234d9ac5b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/service_runner_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class ServiceRunnerList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ServiceRunnerList] 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 ServiceRunnerList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ServiceRunnerList', + type: { + name: 'Composite', + class_name: 'ServiceRunnerList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ServiceRunnerElementType', + type: { + name: 'Composite', + class_name: 'ServiceRunner' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb new file mode 100644 index 0000000000..cfb35ef980 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb @@ -0,0 +1,56 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a virtual machine that determine how it is connected to a + # load balancer. + # + class SharedPublicIpAddressConfiguration + + include MsRestAzure + + # @return [Array] The incoming NAT rules + attr_accessor :inbound_nat_rules + + + # + # Mapper for SharedPublicIpAddressConfiguration class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SharedPublicIpAddressConfiguration', + type: { + name: 'Composite', + class_name: 'SharedPublicIpAddressConfiguration', + model_properties: { + inbound_nat_rules: { + client_side_validation: true, + required: false, + serialized_name: 'inboundNatRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundNatRuleElementType', + type: { + name: 'Composite', + class_name: 'InboundNatRule' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb new file mode 100644 index 0000000000..445d377b99 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a virtual machine that determine how it is connected to a + # load balancer. + # + class SharedPublicIpAddressConfigurationFragment + + include MsRestAzure + + # @return [Array] The incoming NAT rules + attr_accessor :inbound_nat_rules + + + # + # Mapper for SharedPublicIpAddressConfigurationFragment class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SharedPublicIpAddressConfigurationFragment', + type: { + name: 'Composite', + class_name: 'SharedPublicIpAddressConfigurationFragment', + model_properties: { + inbound_nat_rules: { + client_side_validation: true, + required: false, + serialized_name: 'inboundNatRules', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'InboundNatRuleFragmentElementType', + type: { + name: 'Composite', + class_name: 'InboundNatRuleFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb new file mode 100644 index 0000000000..5c969d065b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb @@ -0,0 +1,180 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The contents of a shutdown notification. Webhooks can use this type to + # deserialize the request body when they get notified of an imminent + # shutdown. + # + class ShutdownNotificationContent + + include MsRestAzure + + # @return [String] The URL to skip auto-shutdown. + attr_accessor :skip_url + + # @return [String] The URL to delay shutdown by 60 minutes. + attr_accessor :delay_url60 + + # @return [String] The URL to delay shutdown by 2 hours. + attr_accessor :delay_url120 + + # @return [String] The virtual machine to be shut down. + attr_accessor :vm_name + + # @return [String] The GUID for the virtual machine to be shut down. + attr_accessor :guid + + # @return [String] The owner of the virtual machine. + attr_accessor :owner + + # @return [String] The URL of the virtual machine. + attr_accessor :vm_url + + # @return [String] Minutes remaining until shutdown + attr_accessor :minutes_until_shutdown + + # @return [String] The event for which a notification will be sent. + attr_accessor :event_type + + # @return [String] The text for the notification. + attr_accessor :text + + # @return [String] The subscription ID for the schedule. + attr_accessor :subscription_id + + # @return [String] The resource group name for the schedule. + attr_accessor :resource_group_name + + # @return [String] The lab for the schedule. + attr_accessor :lab_name + + + # + # Mapper for ShutdownNotificationContent class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ShutdownNotificationContent', + type: { + name: 'Composite', + class_name: 'ShutdownNotificationContent', + model_properties: { + skip_url: { + client_side_validation: true, + required: false, + serialized_name: 'skipUrl', + type: { + name: 'String' + } + }, + delay_url60: { + client_side_validation: true, + required: false, + serialized_name: 'delayUrl60', + type: { + name: 'String' + } + }, + delay_url120: { + client_side_validation: true, + required: false, + serialized_name: 'delayUrl120', + type: { + name: 'String' + } + }, + vm_name: { + client_side_validation: true, + required: false, + serialized_name: 'vmName', + type: { + name: 'String' + } + }, + guid: { + client_side_validation: true, + required: false, + serialized_name: 'guid', + type: { + name: 'String' + } + }, + owner: { + client_side_validation: true, + required: false, + serialized_name: 'owner', + type: { + name: 'String' + } + }, + vm_url: { + client_side_validation: true, + required: false, + serialized_name: 'vmUrl', + type: { + name: 'String' + } + }, + minutes_until_shutdown: { + client_side_validation: true, + required: false, + serialized_name: 'minutesUntilShutdown', + type: { + name: 'String' + } + }, + event_type: { + client_side_validation: true, + required: false, + serialized_name: 'eventType', + type: { + name: 'String' + } + }, + text: { + client_side_validation: true, + required: false, + serialized_name: 'text', + type: { + name: 'String' + } + }, + subscription_id: { + client_side_validation: true, + required: false, + serialized_name: 'subscriptionId', + type: { + name: 'String' + } + }, + resource_group_name: { + client_side_validation: true, + required: false, + serialized_name: 'resourceGroupName', + type: { + name: 'String' + } + }, + lab_name: { + client_side_validation: true, + required: false, + serialized_name: 'labName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/source_control_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/source_control_type.rb new file mode 100644 index 0000000000..30f7dc4479 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/source_control_type.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for SourceControlType + # + module SourceControlType + VsoGit = "VsoGit" + GitHub = "GitHub" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/storage_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/storage_type.rb new file mode 100644 index 0000000000..150f5ab32f --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/storage_type.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for StorageType + # + module StorageType + Standard = "Standard" + Premium = "Premium" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet.rb new file mode 100644 index 0000000000..b4e3a10249 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Subnet information. + # + class Subnet + + include MsRestAzure + + # @return [String] The resource ID of the subnet. + attr_accessor :resource_id + + # @return [String] The name of the subnet as seen in the lab. + attr_accessor :lab_subnet_name + + # @return [UsagePermissionType] The permission policy of the subnet for + # allowing public IP addresses (i.e. Allow, Deny)). Possible values + # include: 'Default', 'Deny', 'Allow' + attr_accessor :allow_public_ip + + + # + # Mapper for Subnet class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Subnet', + type: { + name: 'Composite', + class_name: 'Subnet', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'labSubnetName', + type: { + name: 'String' + } + }, + allow_public_ip: { + client_side_validation: true, + required: false, + serialized_name: 'allowPublicIp', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb new file mode 100644 index 0000000000..19d3ba65b2 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Subnet information. + # + class SubnetFragment + + include MsRestAzure + + # @return [String] The resource ID of the subnet. + attr_accessor :resource_id + + # @return [String] The name of the subnet as seen in the lab. + attr_accessor :lab_subnet_name + + # @return [UsagePermissionType] The permission policy of the subnet for + # allowing public IP addresses (i.e. Allow, Deny)). Possible values + # include: 'Default', 'Deny', 'Allow' + attr_accessor :allow_public_ip + + + # + # Mapper for SubnetFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SubnetFragment', + type: { + name: 'Composite', + class_name: 'SubnetFragment', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'labSubnetName', + type: { + name: 'String' + } + }, + allow_public_ip: { + client_side_validation: true, + required: false, + serialized_name: 'allowPublicIp', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override.rb new file mode 100644 index 0000000000..28f3eadb8a --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override.rb @@ -0,0 +1,107 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Property overrides on a subnet of a virtual network. + # + class SubnetOverride + + include MsRestAzure + + # @return [String] The resource ID of the subnet. + attr_accessor :resource_id + + # @return [String] The name given to the subnet within the lab. + attr_accessor :lab_subnet_name + + # @return [UsagePermissionType] Indicates whether this subnet can be used + # during virtual machine creation (i.e. Allow, Deny). Possible values + # include: 'Default', 'Deny', 'Allow' + attr_accessor :use_in_vm_creation_permission + + # @return [UsagePermissionType] Indicates whether public IP addresses can + # be assigned to virtual machines on this subnet (i.e. Allow, Deny). + # Possible values include: 'Default', 'Deny', 'Allow' + attr_accessor :use_public_ip_address_permission + + # @return [SubnetSharedPublicIpAddressConfiguration] Properties that + # virtual machines on this subnet will share. + attr_accessor :shared_public_ip_address_configuration + + # @return [String] The virtual network pool associated with this subnet. + attr_accessor :virtual_network_pool_name + + + # + # Mapper for SubnetOverride class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SubnetOverride', + type: { + name: 'Composite', + class_name: 'SubnetOverride', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'labSubnetName', + type: { + name: 'String' + } + }, + use_in_vm_creation_permission: { + client_side_validation: true, + required: false, + serialized_name: 'useInVmCreationPermission', + type: { + name: 'String' + } + }, + use_public_ip_address_permission: { + client_side_validation: true, + required: false, + serialized_name: 'usePublicIpAddressPermission', + type: { + name: 'String' + } + }, + shared_public_ip_address_configuration: { + client_side_validation: true, + required: false, + serialized_name: 'sharedPublicIpAddressConfiguration', + type: { + name: 'Composite', + class_name: 'SubnetSharedPublicIpAddressConfiguration' + } + }, + virtual_network_pool_name: { + client_side_validation: true, + required: false, + serialized_name: 'virtualNetworkPoolName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb new file mode 100644 index 0000000000..87788e14a8 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb @@ -0,0 +1,107 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Property overrides on a subnet of a virtual network. + # + class SubnetOverrideFragment + + include MsRestAzure + + # @return [String] The resource ID of the subnet. + attr_accessor :resource_id + + # @return [String] The name given to the subnet within the lab. + attr_accessor :lab_subnet_name + + # @return [UsagePermissionType] Indicates whether this subnet can be used + # during virtual machine creation (i.e. Allow, Deny). Possible values + # include: 'Default', 'Deny', 'Allow' + attr_accessor :use_in_vm_creation_permission + + # @return [UsagePermissionType] Indicates whether public IP addresses can + # be assigned to virtual machines on this subnet (i.e. Allow, Deny). + # Possible values include: 'Default', 'Deny', 'Allow' + attr_accessor :use_public_ip_address_permission + + # @return [SubnetSharedPublicIpAddressConfigurationFragment] Properties + # that virtual machines on this subnet will share. + attr_accessor :shared_public_ip_address_configuration + + # @return [String] The virtual network pool associated with this subnet. + attr_accessor :virtual_network_pool_name + + + # + # Mapper for SubnetOverrideFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SubnetOverrideFragment', + type: { + name: 'Composite', + class_name: 'SubnetOverrideFragment', + model_properties: { + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + lab_subnet_name: { + client_side_validation: true, + required: false, + serialized_name: 'labSubnetName', + type: { + name: 'String' + } + }, + use_in_vm_creation_permission: { + client_side_validation: true, + required: false, + serialized_name: 'useInVmCreationPermission', + type: { + name: 'String' + } + }, + use_public_ip_address_permission: { + client_side_validation: true, + required: false, + serialized_name: 'usePublicIpAddressPermission', + type: { + name: 'String' + } + }, + shared_public_ip_address_configuration: { + client_side_validation: true, + required: false, + serialized_name: 'sharedPublicIpAddressConfiguration', + type: { + name: 'Composite', + class_name: 'SubnetSharedPublicIpAddressConfigurationFragment' + } + }, + virtual_network_pool_name: { + client_side_validation: true, + required: false, + serialized_name: 'virtualNetworkPoolName', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb new file mode 100644 index 0000000000..acee2df462 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb @@ -0,0 +1,56 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Configuration for public IP address sharing. + # + class SubnetSharedPublicIpAddressConfiguration + + include MsRestAzure + + # @return [Array] Backend ports that virtual machines on this + # subnet are allowed to expose + attr_accessor :allowed_ports + + + # + # Mapper for SubnetSharedPublicIpAddressConfiguration class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SubnetSharedPublicIpAddressConfiguration', + type: { + name: 'Composite', + class_name: 'SubnetSharedPublicIpAddressConfiguration', + model_properties: { + allowed_ports: { + client_side_validation: true, + required: false, + serialized_name: 'allowedPorts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PortElementType', + type: { + name: 'Composite', + class_name: 'Port' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb new file mode 100644 index 0000000000..e5c3d68269 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Configuration for public IP address sharing. + # + class SubnetSharedPublicIpAddressConfigurationFragment + + include MsRestAzure + + # @return [Array] Backend ports that virtual machines on + # this subnet are allowed to expose + attr_accessor :allowed_ports + + + # + # Mapper for SubnetSharedPublicIpAddressConfigurationFragment class as + # Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SubnetSharedPublicIpAddressConfigurationFragment', + type: { + name: 'Composite', + class_name: 'SubnetSharedPublicIpAddressConfigurationFragment', + model_properties: { + allowed_ports: { + client_side_validation: true, + required: false, + serialized_name: 'allowedPorts', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'PortFragmentElementType', + type: { + name: 'Composite', + class_name: 'PortFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb new file mode 100644 index 0000000000..858625a0d8 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb @@ -0,0 +1,112 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a cost target. + # + class TargetCostProperties + + include MsRestAzure + + # @return [TargetCostStatus] Target cost status. Possible values include: + # 'Enabled', 'Disabled' + attr_accessor :status + + # @return [Integer] Lab target cost + attr_accessor :target + + # @return [Array] Cost thresholds. + attr_accessor :cost_thresholds + + # @return [DateTime] Reporting cycle start date. + attr_accessor :cycle_start_date_time + + # @return [DateTime] Reporting cycle end date. + attr_accessor :cycle_end_date_time + + # @return [ReportingCycleType] Reporting cycle type. Possible values + # include: 'CalendarMonth', 'Custom' + attr_accessor :cycle_type + + + # + # Mapper for TargetCostProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'TargetCostProperties', + type: { + name: 'Composite', + class_name: 'TargetCostProperties', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + target: { + client_side_validation: true, + required: false, + serialized_name: 'target', + type: { + name: 'Number' + } + }, + cost_thresholds: { + client_side_validation: true, + required: false, + serialized_name: 'costThresholds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'CostThresholdPropertiesElementType', + type: { + name: 'Composite', + class_name: 'CostThresholdProperties' + } + } + } + }, + cycle_start_date_time: { + client_side_validation: true, + required: false, + serialized_name: 'cycleStartDateTime', + type: { + name: 'DateTime' + } + }, + cycle_end_date_time: { + client_side_validation: true, + required: false, + serialized_name: 'cycleEndDateTime', + type: { + name: 'DateTime' + } + }, + cycle_type: { + client_side_validation: true, + required: false, + serialized_name: 'cycleType', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb new file mode 100644 index 0000000000..04e96e3e6d --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/target_cost_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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for TargetCostStatus + # + module TargetCostStatus + Enabled = "Enabled" + Disabled = "Disabled" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb new file mode 100644 index 0000000000..e1dccaebcd --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/transport_protocol.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for TransportProtocol + # + module TransportProtocol + Tcp = "Tcp" + Udp = "Udp" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/update_resource.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/update_resource.rb new file mode 100644 index 0000000000..af6a57b3c8 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/update_resource.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Represents an update resource + # + class UpdateResource + + include MsRestAzure + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # + # Mapper for UpdateResource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UpdateResource', + type: { + name: 'Composite', + class_name: 'UpdateResource', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb new file mode 100644 index 0000000000..61ba57223c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb @@ -0,0 +1,17 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for UsagePermissionType + # + module UsagePermissionType + Default = "Default" + Deny = "Deny" + Allow = "Allow" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user.rb new file mode 100644 index 0000000000..26ca72ae56 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user.rb @@ -0,0 +1,146 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Profile of a lab user. + # + class User < Resource + + include MsRestAzure + + # @return [UserIdentity] The identity of the user. + attr_accessor :identity + + # @return [UserSecretStore] The secret store of the user. + attr_accessor :secret_store + + # @return [DateTime] The creation date of the user profile. + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for User class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'User', + type: { + name: 'Composite', + class_name: 'User', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'properties.identity', + type: { + name: 'Composite', + class_name: 'UserIdentity' + } + }, + secret_store: { + client_side_validation: true, + required: false, + serialized_name: 'properties.secretStore', + type: { + name: 'Composite', + class_name: 'UserSecretStore' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_fragment.rb new file mode 100644 index 0000000000..d645334db0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_fragment.rb @@ -0,0 +1,75 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Profile of a lab user. + # + class UserFragment < UpdateResource + + include MsRestAzure + + # @return [UserIdentityFragment] The identity of the user. + attr_accessor :identity + + # @return [UserSecretStoreFragment] The secret store of the user. + attr_accessor :secret_store + + + # + # Mapper for UserFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserFragment', + type: { + name: 'Composite', + class_name: 'UserFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + identity: { + client_side_validation: true, + required: false, + serialized_name: 'properties.identity', + type: { + name: 'Composite', + class_name: 'UserIdentityFragment' + } + }, + secret_store: { + client_side_validation: true, + required: false, + serialized_name: 'properties.secretStore', + type: { + name: 'Composite', + class_name: 'UserSecretStoreFragment' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity.rb new file mode 100644 index 0000000000..1bef202d7e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity.rb @@ -0,0 +1,96 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Identity attributes of a lab user. + # + class UserIdentity + + include MsRestAzure + + # @return [String] Set to the principal name / UPN of the client JWT + # making the request. + attr_accessor :principal_name + + # @return [String] Set to the principal Id of the client JWT making the + # request. Service principal will not have the principal Id. + attr_accessor :principal_id + + # @return [String] Set to the tenant ID of the client JWT making the + # request. + attr_accessor :tenant_id + + # @return [String] Set to the object Id of the client JWT making the + # request. Not all users have object Id. For CSP (reseller) scenarios for + # example, object Id is not available. + attr_accessor :object_id + + # @return [String] Set to the app Id of the client JWT making the + # request. + attr_accessor :app_id + + + # + # Mapper for UserIdentity class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserIdentity', + type: { + name: 'Composite', + class_name: 'UserIdentity', + model_properties: { + principal_name: { + client_side_validation: true, + required: false, + serialized_name: 'principalName', + type: { + name: 'String' + } + }, + principal_id: { + client_side_validation: true, + required: false, + serialized_name: 'principalId', + type: { + name: 'String' + } + }, + tenant_id: { + client_side_validation: true, + required: false, + serialized_name: 'tenantId', + type: { + name: 'String' + } + }, + object_id: { + client_side_validation: true, + required: false, + serialized_name: 'objectId', + type: { + name: 'String' + } + }, + app_id: { + client_side_validation: true, + required: false, + serialized_name: 'appId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb new file mode 100644 index 0000000000..890ffc114b --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb @@ -0,0 +1,96 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Identity attributes of a lab user. + # + class UserIdentityFragment + + include MsRestAzure + + # @return [String] Set to the principal name / UPN of the client JWT + # making the request. + attr_accessor :principal_name + + # @return [String] Set to the principal Id of the client JWT making the + # request. Service principal will not have the principal Id. + attr_accessor :principal_id + + # @return [String] Set to the tenant ID of the client JWT making the + # request. + attr_accessor :tenant_id + + # @return [String] Set to the object Id of the client JWT making the + # request. Not all users have object Id. For CSP (reseller) scenarios for + # example, object Id is not available. + attr_accessor :object_id + + # @return [String] Set to the app Id of the client JWT making the + # request. + attr_accessor :app_id + + + # + # Mapper for UserIdentityFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserIdentityFragment', + type: { + name: 'Composite', + class_name: 'UserIdentityFragment', + model_properties: { + principal_name: { + client_side_validation: true, + required: false, + serialized_name: 'principalName', + type: { + name: 'String' + } + }, + principal_id: { + client_side_validation: true, + required: false, + serialized_name: 'principalId', + type: { + name: 'String' + } + }, + tenant_id: { + client_side_validation: true, + required: false, + serialized_name: 'tenantId', + type: { + name: 'String' + } + }, + object_id: { + client_side_validation: true, + required: false, + serialized_name: 'objectId', + type: { + name: 'String' + } + }, + app_id: { + client_side_validation: true, + required: false, + serialized_name: 'appId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_list.rb new file mode 100644 index 0000000000..6d31ad5a1e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class UserList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [UserList] 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 UserList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserList', + type: { + name: 'Composite', + class_name: 'UserList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UserElementType', + type: { + name: 'Composite', + class_name: 'User' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb new file mode 100644 index 0000000000..100e0650cc --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a user's secret store. + # + class UserSecretStore + + include MsRestAzure + + # @return [String] The URI of the user's Key vault. + attr_accessor :key_vault_uri + + # @return [String] The ID of the user's Key vault. + attr_accessor :key_vault_id + + + # + # Mapper for UserSecretStore class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserSecretStore', + type: { + name: 'Composite', + class_name: 'UserSecretStore', + model_properties: { + key_vault_uri: { + client_side_validation: true, + required: false, + serialized_name: 'keyVaultUri', + type: { + name: 'String' + } + }, + key_vault_id: { + client_side_validation: true, + required: false, + serialized_name: 'keyVaultId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb new file mode 100644 index 0000000000..26fd6b9efe --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a user's secret store. + # + class UserSecretStoreFragment + + include MsRestAzure + + # @return [String] The URI of the user's Key vault. + attr_accessor :key_vault_uri + + # @return [String] The ID of the user's Key vault. + attr_accessor :key_vault_id + + + # + # Mapper for UserSecretStoreFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserSecretStoreFragment', + type: { + name: 'Composite', + class_name: 'UserSecretStoreFragment', + model_properties: { + key_vault_uri: { + client_side_validation: true, + required: false, + serialized_name: 'keyVaultUri', + type: { + name: 'String' + } + }, + key_vault_id: { + client_side_validation: true, + required: false, + serialized_name: 'keyVaultId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb new file mode 100644 index 0000000000..5416633ccd --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for VirtualMachineCreationSource + # + module VirtualMachineCreationSource + FromCustomImage = "FromCustomImage" + FromGalleryImage = "FromGalleryImage" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network.rb new file mode 100644 index 0000000000..8110362739 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network.rb @@ -0,0 +1,207 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A virtual network. + # + class VirtualNetwork < Resource + + include MsRestAzure + + # @return [Array] The allowed subnets of the virtual network. + attr_accessor :allowed_subnets + + # @return [String] The description of the virtual network. + attr_accessor :description + + # @return [String] The Microsoft.Network resource identifier of the + # virtual network. + attr_accessor :external_provider_resource_id + + # @return [Array] The external subnet properties. + attr_accessor :external_subnets + + # @return [Array] The subnet overrides of the virtual + # network. + attr_accessor :subnet_overrides + + # @return [DateTime] The creation date of the virtual network. + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for VirtualNetwork class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetwork', + type: { + name: 'Composite', + class_name: 'VirtualNetwork', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + allowed_subnets: { + client_side_validation: true, + required: false, + serialized_name: 'properties.allowedSubnets', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SubnetElementType', + type: { + name: 'Composite', + class_name: 'Subnet' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + external_provider_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.externalProviderResourceId', + type: { + name: 'String' + } + }, + external_subnets: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.externalSubnets', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'ExternalSubnetElementType', + type: { + name: 'Composite', + class_name: 'ExternalSubnet' + } + } + } + }, + subnet_overrides: { + client_side_validation: true, + required: false, + serialized_name: 'properties.subnetOverrides', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SubnetOverrideElementType', + type: { + name: 'Composite', + class_name: 'SubnetOverride' + } + } + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb new file mode 100644 index 0000000000..c6267b5df0 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb @@ -0,0 +1,116 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # A virtual network. + # + class VirtualNetworkFragment < UpdateResource + + include MsRestAzure + + # @return [Array] The allowed subnets of the virtual + # network. + attr_accessor :allowed_subnets + + # @return [String] The description of the virtual network. + attr_accessor :description + + # @return [String] The Microsoft.Network resource identifier of the + # virtual network. + attr_accessor :external_provider_resource_id + + # @return [Array] The subnet overrides of the + # virtual network. + attr_accessor :subnet_overrides + + + # + # Mapper for VirtualNetworkFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkFragment', + type: { + name: 'Composite', + class_name: 'VirtualNetworkFragment', + model_properties: { + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + allowed_subnets: { + client_side_validation: true, + required: false, + serialized_name: 'properties.allowedSubnets', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SubnetFragmentElementType', + type: { + name: 'Composite', + class_name: 'SubnetFragment' + } + } + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + external_provider_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'properties.externalProviderResourceId', + type: { + name: 'String' + } + }, + subnet_overrides: { + client_side_validation: true, + required: false, + serialized_name: 'properties.subnetOverrides', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SubnetOverrideFragmentElementType', + type: { + name: 'Composite', + class_name: 'SubnetOverrideFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_list.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_list.rb new file mode 100644 index 0000000000..9e4c126cbc --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/virtual_network_list.rb @@ -0,0 +1,98 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # The response of a list operation. + # + class VirtualNetworkList + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [VirtualNetworkList] 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 VirtualNetworkList class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkList', + type: { + name: 'Composite', + class_name: 'VirtualNetworkList', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'VirtualNetworkElementType', + type: { + name: 'Composite', + class_name: 'VirtualNetwork' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details.rb new file mode 100644 index 0000000000..9ec94ea0bf --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a weekly schedule. + # + class WeekDetails + + include MsRestAzure + + # @return [Array] The days of the week for which the schedule is + # set (e.g. Sunday, Monday, Tuesday, etc.). + attr_accessor :weekdays + + # @return [String] The time of the day the schedule will occur. + attr_accessor :time + + + # + # Mapper for WeekDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'WeekDetails', + type: { + name: 'Composite', + class_name: 'WeekDetails', + model_properties: { + weekdays: { + client_side_validation: true, + required: false, + serialized_name: 'weekdays', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + time: { + client_side_validation: true, + required: false, + serialized_name: 'time', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb new file mode 100644 index 0000000000..5093df6878 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/week_details_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Properties of a weekly schedule. + # + class WeekDetailsFragment + + include MsRestAzure + + # @return [Array] The days of the week for which the schedule is + # set (e.g. Sunday, Monday, Tuesday, etc.). + attr_accessor :weekdays + + # @return [String] The time of the day the schedule will occur. + attr_accessor :time + + + # + # Mapper for WeekDetailsFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'WeekDetailsFragment', + type: { + name: 'Composite', + class_name: 'WeekDetailsFragment', + model_properties: { + weekdays: { + client_side_validation: true, + required: false, + serialized_name: 'weekdays', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + time: { + client_side_validation: true, + required: false, + serialized_name: 'time', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb new file mode 100644 index 0000000000..1492826877 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a Windows OS. + # + class WindowsOsInfo + + include MsRestAzure + + # @return [WindowsOsState] The state of the Windows OS (i.e. + # NonSysprepped, SysprepRequested, SysprepApplied). Possible values + # include: 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' + attr_accessor :windows_os_state + + + # + # Mapper for WindowsOsInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'WindowsOsInfo', + type: { + name: 'Composite', + class_name: 'WindowsOsInfo', + model_properties: { + windows_os_state: { + client_side_validation: true, + required: false, + serialized_name: 'windowsOsState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info_fragment.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info_fragment.rb new file mode 100644 index 0000000000..562853ec21 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_info_fragment.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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Information about a Windows OS. + # + class WindowsOsInfoFragment + + include MsRestAzure + + # @return [WindowsOsState] The state of the Windows OS (i.e. + # NonSysprepped, SysprepRequested, SysprepApplied). Possible values + # include: 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' + attr_accessor :windows_os_state + + + # + # Mapper for WindowsOsInfoFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'WindowsOsInfoFragment', + type: { + name: 'Composite', + class_name: 'WindowsOsInfoFragment', + model_properties: { + windows_os_state: { + client_side_validation: true, + required: false, + serialized_name: 'windowsOsState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb new file mode 100644 index 0000000000..30efe651c1 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb @@ -0,0 +1,17 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + module Models + # + # Defines values for WindowsOsState + # + module WindowsOsState + NonSysprepped = "NonSysprepped" + SysprepRequested = "SysprepRequested" + SysprepApplied = "SysprepApplied" + end + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/module_definition.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/module_definition.rb new file mode 100644 index 0000000000..870485f7a4 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/module_definition.rb @@ -0,0 +1,9 @@ +# 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::DevTestLabs end +module Azure::DevTestLabs::Mgmt end +module Azure::DevTestLabs::Mgmt::V2018_09_15 end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/notification_channels.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/notification_channels.rb new file mode 100644 index 0000000000..636686f254 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/notification_channels.rb @@ -0,0 +1,769 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class NotificationChannels + include MsRestAzure + + # + # Creates and initializes a new instance of the NotificationChannels class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List notification channels in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List notification channels in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List notification channels in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/notificationchannels' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelList.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 + + # + # Get notification channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationChannel] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get notification channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get notification channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/notificationchannels/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel.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 + + # + # Create or replace an existing notificationChannel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notification_channel [NotificationChannel] A notification. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationChannel] operation results. + # + def create_or_update(resource_group_name, lab_name, name, notification_channel, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing notificationChannel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notification_channel [NotificationChannel] A notification. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing notificationChannel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notification_channel [NotificationChannel] A notification. + # @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 create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'notification_channel is nil' if notification_channel.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel.mapper() + request_content = @client.serialize(request_mapper, notification_channel) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel.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::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel.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 + + # + # Delete notification channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete notification channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @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 delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete notification channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @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 delete_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/notificationchannels/{name}' + + 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,'labName' => lab_name,'name' => 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 == 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 + + # + # Modify properties of notification channels. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notification_channel [NotificationChannelFragment] A notification. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationChannel] operation results. + # + def update(resource_group_name, lab_name, name, notification_channel, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of notification channels. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notification_channel [NotificationChannelFragment] A notification. + # @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 update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers:nil) + update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value! + end + + # + # Modify properties of notification channels. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notification_channel [NotificationChannelFragment] A notification. + # @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 update_async(resource_group_name, lab_name, name, notification_channel, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'notification_channel is nil' if notification_channel.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelFragment.mapper() + request_content = @client.serialize(request_mapper, notification_channel) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel.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 + + # + # Send notification to provided channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notify_parameters [NotifyParameters] Properties for generating a + # Notification. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def notify(resource_group_name, lab_name, name, notify_parameters, custom_headers:nil) + response = notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers:custom_headers).value! + nil + end + + # + # Send notification to provided channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notify_parameters [NotifyParameters] Properties for generating a + # Notification. + # @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 notify_with_http_info(resource_group_name, lab_name, name, notify_parameters, custom_headers:nil) + notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers:custom_headers).value! + end + + # + # Send notification to provided channel. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the notificationChannel. + # @param notify_parameters [NotifyParameters] Properties for generating a + # Notification. + # @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 notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'notify_parameters is nil' if notify_parameters.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotifyParameters.mapper() + request_content = @client.serialize(request_mapper, notify_parameters) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}/notify' + + 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,'labName' => lab_name,'name' => 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? + + result + end + + promise.execute + end + + # + # List notification channels in a given lab. + # + # @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 [NotificationChannelList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List notification channels in a given lab. + # + # @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:custom_headers).value! + end + + # + # List notification channels in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelList.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 + + # + # List notification channels in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=webHookUrl)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [NotificationChannelList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/operations.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/operations.rb new file mode 100644 index 0000000000..7f1fdb348c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/operations.rb @@ -0,0 +1,117 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + 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 [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # Get operation. + # + # @param location_name [String] The name of the location. + # @param name [String] The name of the operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResult] operation results. + # + def get(location_name, name, custom_headers:nil) + response = get_async(location_name, name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get operation. + # + # @param location_name [String] The name of the location. + # @param name [String] The name of the 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 get_with_http_info(location_name, name, custom_headers:nil) + get_async(location_name, name, custom_headers:custom_headers).value! + end + + # + # Get operation. + # + # @param location_name [String] The name of the location. + # @param name [String] The name of the 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 get_async(location_name, name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location_name is nil' if location_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/locations/{locationName}/operations/{name}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'locationName' => location_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::OperationResult.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 + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policies.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policies.rb new file mode 100644 index 0000000000..30593ef2a8 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policies.rb @@ -0,0 +1,690 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Policies + include MsRestAzure + + # + # Creates and initializes a new instance of the Policies class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List policies in a given policy set. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, policy_set_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List policies in a given policy set. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, policy_set_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List policies in a given policy set. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'policy_set_name is nil' if policy_set_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies' + + 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,'labName' => lab_name,'policySetName' => policy_set_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyList.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 + + # + # Get policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Policy] operation results. + # + def get(resource_group_name, lab_name, policy_set_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, policy_set_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @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, lab_name, policy_set_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, policy_set_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @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, lab_name, policy_set_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'policy_set_name is nil' if policy_set_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}' + + 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,'labName' => lab_name,'policySetName' => policy_set_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Policy.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 + + # + # Create or replace an existing policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param policy [Policy] A Policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Policy] operation results. + # + def create_or_update(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param policy [Policy] A Policy. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param policy [Policy] A Policy. + # @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 create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'policy_set_name is nil' if policy_set_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'policy is nil' if policy.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Policy.mapper() + request_content = @client.serialize(request_mapper, policy) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}' + + 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,'labName' => lab_name,'policySetName' => policy_set_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Policy.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::DevTestLabs::Mgmt::V2018_09_15::Models::Policy.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 + + # + # Delete policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, policy_set_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @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 delete_with_http_info(resource_group_name, lab_name, policy_set_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers:custom_headers).value! + end + + # + # Delete policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @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 delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'policy_set_name is nil' if policy_set_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}' + + 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,'labName' => lab_name,'policySetName' => policy_set_name,'name' => 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 == 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 + + # + # Modify properties of policies. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param policy [PolicyFragment] A Policy. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Policy] operation results. + # + def update(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil) + response = update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of policies. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param policy [PolicyFragment] A Policy. + # @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 update_with_http_info(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil) + update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value! + end + + # + # Modify properties of policies. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param name [String] The name of the policy. + # @param policy [PolicyFragment] A Policy. + # @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 update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'policy_set_name is nil' if policy_set_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'policy is nil' if policy.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFragment.mapper() + request_content = @client.serialize(request_mapper, policy) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}' + + 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,'labName' => lab_name,'policySetName' => policy_set_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Policy.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 + + # + # List policies in a given policy set. + # + # @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 [PolicyList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List policies in a given policy set. + # + # @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:custom_headers).value! + end + + # + # List policies in a given policy set. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyList.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 + + # + # List policies in a given policy set. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param policy_set_name [String] The name of the policy set. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=description)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [PolicyList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, policy_set_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policy_sets.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policy_sets.rb new file mode 100644 index 0000000000..5f7525a5e7 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/policy_sets.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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class PolicySets + include MsRestAzure + + # + # Creates and initializes a new instance of the PolicySets class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # Evaluates lab policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the policy set. + # @param evaluate_policies_request [EvaluatePoliciesRequest] Request body for + # evaluating a policy set. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EvaluatePoliciesResponse] operation results. + # + def evaluate_policies(resource_group_name, lab_name, name, evaluate_policies_request, custom_headers:nil) + response = evaluate_policies_async(resource_group_name, lab_name, name, evaluate_policies_request, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Evaluates lab policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the policy set. + # @param evaluate_policies_request [EvaluatePoliciesRequest] Request body for + # evaluating a policy set. + # @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 evaluate_policies_with_http_info(resource_group_name, lab_name, name, evaluate_policies_request, custom_headers:nil) + evaluate_policies_async(resource_group_name, lab_name, name, evaluate_policies_request, custom_headers:custom_headers).value! + end + + # + # Evaluates lab policy. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the policy set. + # @param evaluate_policies_request [EvaluatePoliciesRequest] Request body for + # evaluating a policy set. + # @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 evaluate_policies_async(resource_group_name, lab_name, name, evaluate_policies_request, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'evaluate_policies_request is nil' if evaluate_policies_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesRequest.mapper() + request_content = @client.serialize(request_mapper, evaluate_policies_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{name}/evaluatePolicies' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesResponse.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 + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/provider_operations.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/provider_operations.rb new file mode 100644 index 0000000000..8a0714b25c --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/provider_operations.rb @@ -0,0 +1,215 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class ProviderOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ProviderOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # Result of the request to list 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:custom_headers) + first_page.get_all_items + end + + # + # Result of the request to list 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:custom_headers).value! + end + + # + # Result of the request to list 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/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::DevTestLabs::Mgmt::V2018_09_15::Models::ProviderOperationResult.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 + + # + # Result of the request to list 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 [ProviderOperationResult] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Result of the request to list 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:custom_headers).value! + end + + # + # Result of the request to list 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ProviderOperationResult.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 + + # + # Result of the request to list REST API operations + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ProviderOperationResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/schedules.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/schedules.rb new file mode 100644 index 0000000000..f94f683086 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/schedules.rb @@ -0,0 +1,1000 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Schedules + include MsRestAzure + + # + # Creates and initializes a new instance of the Schedules class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List schedules in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List schedules in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List schedules in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/schedules' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/schedules/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def create_or_update(resource_group_name, lab_name, name, schedule, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, name, schedule, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_async(resource_group_name, lab_name, name, schedule, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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 delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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 delete_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/schedules/{name}' + + 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,'labName' => lab_name,'name' => 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 == 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 + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def update(resource_group_name, lab_name, name, schedule, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_with_http_info(resource_group_name, lab_name, name, schedule, custom_headers:nil) + update_async(resource_group_name, lab_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_async(resource_group_name, lab_name, name, schedule, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def execute(resource_group_name, lab_name, name, custom_headers:nil) + response = execute_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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 execute_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_execute_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Lists all applicable schedules + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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_applicable(resource_group_name, lab_name, name, custom_headers:nil) + first_page = list_applicable_as_lazy(resource_group_name, lab_name, name, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # Lists all applicable schedules + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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_applicable_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + list_applicable_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Lists all applicable schedules + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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_applicable_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/schedules/{name}/listApplicable' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_execute(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_execute_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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_execute_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_execute_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @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_execute_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/schedules/{name}/execute' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # List schedules in a given lab. + # + # @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 [ScheduleList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List schedules in a given lab. + # + # @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:custom_headers).value! + end + + # + # List schedules in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 applicable schedules + # + # @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 [ScheduleList] operation results. + # + def list_applicable_next(next_page_link, custom_headers:nil) + response = list_applicable_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists all applicable schedules + # + # @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_applicable_next_with_http_info(next_page_link, custom_headers:nil) + list_applicable_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # Lists all applicable schedules + # + # @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_applicable_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # List schedules in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ScheduleList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + # + # Lists all applicable schedules + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ScheduleList] which provide lazy access to pages of the response. + # + def list_applicable_as_lazy(resource_group_name, lab_name, name, custom_headers:nil) + response = list_applicable_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_applicable_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/secrets.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/secrets.rb new file mode 100644 index 0000000000..94d74a841d --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/secrets.rb @@ -0,0 +1,742 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Secrets + include MsRestAzure + + # + # Creates and initializes a new instance of the Secrets class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List secrets in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List secrets in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List secrets in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/secrets' + + 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,'labName' => lab_name,'userName' => user_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::SecretList.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 + + # + # Get secret. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Secret] operation results. + # + def get(resource_group_name, lab_name, user_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get secret. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @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, lab_name, user_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get secret. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @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, lab_name, user_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Secret.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 + + # + # Create or replace an existing secret. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [Secret] A secret. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Secret] operation results. + # + def create_or_update(resource_group_name, lab_name, user_name, name, secret, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [Secret] A secret. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Secret.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 + + # + # Delete secret. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete secret. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @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 delete_with_http_info(resource_group_name, lab_name, user_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Delete secret. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @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 delete_async(resource_group_name, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 == 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 + + # + # Modify properties of secrets. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [SecretFragment] A secret. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Secret] operation results. + # + def update(resource_group_name, lab_name, user_name, name, secret, custom_headers:nil) + response = update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of secrets. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [SecretFragment] A secret. + # @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 update_with_http_info(resource_group_name, lab_name, user_name, name, secret, custom_headers:nil) + update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:custom_headers).value! + end + + # + # Modify properties of secrets. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [SecretFragment] A secret. + # @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 update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'secret is nil' if secret.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretFragment.mapper() + request_content = @client.serialize(request_mapper, secret) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Secret.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 + + # + # Create or replace an existing secret. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [Secret] A secret. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Secret] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, user_name, name, secret, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing secret. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [Secret] A secret. + # @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_or_update_with_http_info(resource_group_name, lab_name, user_name, name, secret, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing secret. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the secret. + # @param secret [Secret] A secret. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'secret is nil' if secret.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Secret.mapper() + request_content = @client.serialize(request_mapper, secret) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Secret.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::DevTestLabs::Mgmt::V2018_09_15::Models::Secret.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 + + # + # List secrets in a given user profile. + # + # @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 [SecretList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List secrets in a given user profile. + # + # @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:custom_headers).value! + end + + # + # List secrets in a given user profile. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::SecretList.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 + + # + # List secrets in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=value)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [SecretList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabric_schedules.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabric_schedules.rb new file mode 100644 index 0000000000..1cdc429025 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabric_schedules.rb @@ -0,0 +1,848 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class ServiceFabricSchedules + include MsRestAzure + + # + # Creates and initializes a new instance of the ServiceFabricSchedules class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List schedules in a given service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, service_fabric_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, user_name, service_fabric_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List schedules in a given service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, service_fabric_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, user_name, service_fabric_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List schedules in a given service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, service_fabric_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'service_fabric_name is nil' if service_fabric_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules' + + 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,'labName' => lab_name,'userName' => user_name,'serviceFabricName' => service_fabric_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def get(resource_group_name, lab_name, user_name, service_fabric_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, user_name, service_fabric_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, lab_name, user_name, service_fabric_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, user_name, service_fabric_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, lab_name, user_name, service_fabric_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'service_fabric_name is nil' if service_fabric_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'serviceFabricName' => service_fabric_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def create_or_update(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_async(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'service_fabric_name is nil' if service_fabric_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'serviceFabricName' => service_fabric_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @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 delete_with_http_info(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:custom_headers).value! + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @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 delete_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'service_fabric_name is nil' if service_fabric_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'serviceFabricName' => service_fabric_name,'name' => 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 == 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 + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def update(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:nil) + response = update_async(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_with_http_info(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:nil) + update_async(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_async(resource_group_name, lab_name, user_name, service_fabric_name, name, schedule, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'service_fabric_name is nil' if service_fabric_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'serviceFabricName' => service_fabric_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def execute(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:nil) + response = execute_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @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 execute_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:nil) + # Send request + promise = begin_execute_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers: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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_execute(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:nil) + response = begin_execute_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @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_execute_with_http_info(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:nil) + begin_execute_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers:custom_headers).value! + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param name [String] The name of the schedule. + # @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_execute_async(resource_group_name, lab_name, user_name, service_fabric_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'service_fabric_name is nil' if service_fabric_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}/execute' + + 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,'labName' => lab_name,'userName' => user_name,'serviceFabricName' => service_fabric_name,'name' => 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 || status_code == 202 + 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 + + # + # List schedules in a given service fabric. + # + # @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 [ScheduleList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List schedules in a given service fabric. + # + # @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:custom_headers).value! + end + + # + # List schedules in a given service fabric. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # List schedules in a given service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param service_fabric_name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ScheduleList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, user_name, service_fabric_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, user_name, service_fabric_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabrics.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabrics.rb new file mode 100644 index 0000000000..949aff2a18 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_fabrics.rb @@ -0,0 +1,1147 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class ServiceFabrics + include MsRestAzure + + # + # Creates and initializes a new instance of the ServiceFabrics class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List service fabrics in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List service fabrics in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List service fabrics in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics' + + 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,'labName' => lab_name,'userName' => user_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricList.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 + + # + # Get service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceFabric] operation results. + # + def get(resource_group_name, lab_name, user_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @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, lab_name, user_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, user_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get service fabric. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @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, lab_name, user_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric.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 + + # + # Create or replace an existing Service Fabric. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabric] A Service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceFabric] operation results. + # + def create_or_update(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabric] A Service Fabric. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric.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 + + # + # Delete service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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, lab_name, user_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers: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 + + # + # Modify properties of service fabrics. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabricFragment] A Service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceFabric] operation results. + # + def update(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:nil) + response = update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of service fabrics. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabricFragment] A Service Fabric. + # @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 update_with_http_info(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:nil) + update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:custom_headers).value! + end + + # + # Modify properties of service fabrics. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabricFragment] A Service Fabric. + # @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 update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'service_fabric is nil' if service_fabric.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricFragment.mapper() + request_content = @client.serialize(request_mapper, service_fabric) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric.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 applicable start/stop schedules, if any. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApplicableSchedule] operation results. + # + def list_applicable_schedules(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = list_applicable_schedules_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the applicable start/stop schedules, if any. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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_applicable_schedules_with_http_info(resource_group_name, lab_name, user_name, name, custom_headers:nil) + list_applicable_schedules_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Lists the applicable start/stop schedules, if any. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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_applicable_schedules_async(resource_group_name, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/listApplicableSchedules' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule.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 + + # + # Start a service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = start_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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 start_async(resource_group_name, lab_name, user_name, name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, lab_name, user_name, name, custom_headers: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 + + # + # Stop a service fabric This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def stop(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = stop_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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 stop_async(resource_group_name, lab_name, user_name, name, custom_headers:nil) + # Send request + promise = begin_stop_async(resource_group_name, lab_name, user_name, name, custom_headers: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 + + # + # Create or replace an existing Service Fabric. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabric] A Service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceFabric] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Service Fabric. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabric] A Service Fabric. + # @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_or_update_with_http_info(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Service Fabric. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param service_fabric [ServiceFabric] A Service Fabric. + # @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_or_update_async(resource_group_name, lab_name, user_name, name, service_fabric, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'service_fabric is nil' if service_fabric.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric.mapper() + request_content = @client.serialize(request_mapper, service_fabric) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric.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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric.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 + + # + # Delete service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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, lab_name, user_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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, lab_name, user_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Delete service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 + + # + # Start a service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = begin_start_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Start a service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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_start_with_http_info(resource_group_name, lab_name, user_name, name, custom_headers:nil) + begin_start_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Start a service fabric. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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_start_async(resource_group_name, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/start' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 || status_code == 202 + 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 + + # + # Stop a service fabric This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_stop(resource_group_name, lab_name, user_name, name, custom_headers:nil) + response = begin_stop_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Stop a service fabric This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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_stop_with_http_info(resource_group_name, lab_name, user_name, name, custom_headers:nil) + begin_stop_async(resource_group_name, lab_name, user_name, name, custom_headers:custom_headers).value! + end + + # + # Stop a service fabric This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param name [String] The name of the service Fabric. + # @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_stop_async(resource_group_name, lab_name, user_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/stop' + + 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,'labName' => lab_name,'userName' => user_name,'name' => 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 || status_code == 202 + 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 + + # + # List service fabrics in a given user profile. + # + # @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 [ServiceFabricList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List service fabrics in a given user profile. + # + # @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:custom_headers).value! + end + + # + # List service fabrics in a given user profile. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricList.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 + + # + # List service fabrics in a given user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceFabricList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, user_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, user_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_runners.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_runners.rb new file mode 100644 index 0000000000..6ba3fd8414 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/service_runners.rb @@ -0,0 +1,552 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class ServiceRunners + include MsRestAzure + + # + # Creates and initializes a new instance of the ServiceRunners class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List service runners in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List service runners in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List service runners in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/servicerunners' + + 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,'labName' => lab_name}, + query_params: {'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunnerList.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 + + # + # Get service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceRunner] operation results. + # + def get(resource_group_name, lab_name, name, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @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, lab_name, name, custom_headers:nil) + get_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Get service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @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, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/servicerunners/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner.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 + + # + # Create or replace an existing Service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @param service_runner [ServiceRunner] A container for a managed identity to + # execute DevTest lab services. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceRunner] operation results. + # + def create_or_update(resource_group_name, lab_name, name, service_runner, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, service_runner, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @param service_runner [ServiceRunner] A container for a managed identity to + # execute DevTest lab services. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, name, service_runner, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, name, service_runner, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @param service_runner [ServiceRunner] A container for a managed identity to + # execute DevTest lab services. + # @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 create_or_update_async(resource_group_name, lab_name, name, service_runner, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'service_runner is nil' if service_runner.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner.mapper() + request_content = @client.serialize(request_mapper, service_runner) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner.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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner.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 + + # + # Delete service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @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 delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete service runner. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the service runner. + # @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 delete_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/servicerunners/{name}' + + 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,'labName' => lab_name,'name' => 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 == 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 + + # + # List service runners in a given lab. + # + # @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 [ServiceRunnerList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List service runners in a given lab. + # + # @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:custom_headers).value! + end + + # + # List service runners in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunnerList.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 + + # + # List service runners in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ServiceRunnerList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/users.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/users.rb new file mode 100644 index 0000000000..46bf26ac5e --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/users.rb @@ -0,0 +1,759 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class Users + include MsRestAzure + + # + # Creates and initializes a new instance of the Users class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List user profiles in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List user profiles in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List user profiles in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::UserList.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 + + # + # Get user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get user profile. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::User.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 + + # + # Create or replace an existing user profile. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [User] Profile of a lab user. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def create_or_update(resource_group_name, lab_name, name, user, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, user, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [User] Profile of a lab user. + # @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_or_update_async(resource_group_name, lab_name, name, user, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, name, user, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::User.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 + + # + # Delete user profile. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @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, lab_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Modify properties of user profiles. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [UserFragment] Profile of a lab user. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def update(resource_group_name, lab_name, name, user, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, user, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of user profiles. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [UserFragment] Profile of a lab user. + # @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 update_with_http_info(resource_group_name, lab_name, name, user, custom_headers:nil) + update_async(resource_group_name, lab_name, name, user, custom_headers:custom_headers).value! + end + + # + # Modify properties of user profiles. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [UserFragment] Profile of a lab user. + # @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 update_async(resource_group_name, lab_name, name, user, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'user is nil' if user.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserFragment.mapper() + request_content = @client.serialize(request_mapper, user) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::User.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 + + # + # Create or replace an existing user profile. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [User] Profile of a lab user. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, name, user, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, name, user, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing user profile. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [User] Profile of a lab user. + # @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_or_update_with_http_info(resource_group_name, lab_name, name, user, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, name, user, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing user profile. This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @param user [User] Profile of a lab user. + # @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_or_update_async(resource_group_name, lab_name, name, user, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'user is nil' if user.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::User.mapper() + request_content = @client.serialize(request_mapper, user) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::User.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::DevTestLabs::Mgmt::V2018_09_15::Models::User.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 + + # + # Delete user profile. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @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, lab_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete user profile. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @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, lab_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete user profile. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the user profile. + # @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, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/users/{name}' + + 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,'labName' => lab_name,'name' => 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 + + # + # List user profiles in a given lab. + # + # @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 [UserList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List user profiles in a given lab. + # + # @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:custom_headers).value! + end + + # + # List user profiles in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::UserList.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 + + # + # List user profiles in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=identity)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UserList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb new file mode 100644 index 0000000000..6397f12082 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb @@ -0,0 +1,821 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class VirtualMachineSchedules + include MsRestAzure + + # + # Creates and initializes a new instance of the VirtualMachineSchedules class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List schedules in a given virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, virtual_machine_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, virtual_machine_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List schedules in a given virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, virtual_machine_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, virtual_machine_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List schedules in a given virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, virtual_machine_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules' + + 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,'labName' => lab_name,'virtualMachineName' => virtual_machine_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def get(resource_group_name, lab_name, virtual_machine_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, virtual_machine_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, lab_name, virtual_machine_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, virtual_machine_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @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, lab_name, virtual_machine_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}' + + 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,'labName' => lab_name,'virtualMachineName' => virtual_machine_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def create_or_update(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_with_http_info(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:nil) + create_or_update_async(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param schedule [Schedule] A schedule. + # @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 create_or_update_async(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}' + + 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,'labName' => lab_name,'virtualMachineName' => virtual_machine_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @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 delete_with_http_info(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:nil) + delete_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:custom_headers).value! + end + + # + # Delete schedule. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @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 delete_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}' + + 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,'labName' => lab_name,'virtualMachineName' => virtual_machine_name,'name' => 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 == 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 + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Schedule] operation results. + # + def update(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:nil) + response = update_async(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_with_http_info(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:nil) + update_async(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers:custom_headers).value! + end + + # + # Modify properties of schedules. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param schedule [ScheduleFragment] A schedule. + # @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 update_async(resource_group_name, lab_name, virtual_machine_name, name, schedule, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'schedule is nil' if schedule.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment.mapper() + request_content = @client.serialize(request_mapper, schedule) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}' + + 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,'labName' => lab_name,'virtualMachineName' => virtual_machine_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule.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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def execute(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:nil) + response = execute_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @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 execute_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:nil) + # Send request + promise = begin_execute_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers: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 + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_execute(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:nil) + response = begin_execute_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @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_execute_with_http_info(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:nil) + begin_execute_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers:custom_headers).value! + end + + # + # Execute a schedule. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param name [String] The name of the schedule. + # @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_execute_async(resource_group_name, lab_name, virtual_machine_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'virtual_machine_name is nil' if virtual_machine_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{virtualMachineName}/schedules/{name}/execute' + + 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,'labName' => lab_name,'virtualMachineName' => virtual_machine_name,'name' => 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 || status_code == 202 + 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 + + # + # List schedules in a given virtual machine. + # + # @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 [ScheduleList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List schedules in a given virtual machine. + # + # @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:custom_headers).value! + end + + # + # List schedules in a given virtual machine. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList.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 + + # + # List schedules in a given virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param virtual_machine_name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=status)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ScheduleList] which provide lazy access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_name, virtual_machine_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, virtual_machine_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb new file mode 100644 index 0000000000..eced2b5596 --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb @@ -0,0 +1,2431 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class VirtualMachines + include MsRestAzure + + # + # Creates and initializes a new instance of the VirtualMachines class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List virtual machines in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List virtual machines in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List virtual machines in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList.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 + + # + # Get virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabVirtualMachine] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get virtual machine. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.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 + + # + # Create or replace an existing Virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachine] A virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabVirtualMachine] operation results. + # + def create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachine] A virtual machine. + # @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_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.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 + + # + # Delete virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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, lab_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Modify properties of virtual machines. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachineFragment] A virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabVirtualMachine] operation results. + # + def update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of virtual machines. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachineFragment] A virtual machine. + # @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 update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) + update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! + end + + # + # Modify properties of virtual machines. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachineFragment] A virtual machine. + # @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 update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineFragment.mapper() + request_content = @client.serialize(request_mapper, lab_virtual_machine) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.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 + + # + # Attach a new or existing data disk to virtual machine. This operation can + # take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param data_disk_properties [DataDiskProperties] Request body for adding a + # new or existing data disk to a virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) + response = add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param data_disk_properties [DataDiskProperties] Request body for adding a + # new or existing data disk to a virtual machine. + # @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 add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) + # Send request + promise = begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers: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 + + # + # Apply artifacts to virtual machine. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for + # applying artifacts to a virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) + response = apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for + # applying artifacts to a virtual machine. + # @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 apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) + # Send request + promise = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: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 + + # + # Take ownership of an existing virtual machine This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def claim(resource_group_name, lab_name, name, custom_headers:nil) + response = claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 claim_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_claim_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Detach the specified disk from the virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param detach_data_disk_properties [DetachDataDiskProperties] Request body + # for detaching data disk from a virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) + response = detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param detach_data_disk_properties [DetachDataDiskProperties] Request body + # for detaching data disk from a virtual machine. + # @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 detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) + # Send request + promise = begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: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 + + # + # Gets a string that represents the contents of the RDP file for the virtual + # machine + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [RdpConnection] operation results. + # + def get_rdp_file_contents(resource_group_name, lab_name, name, custom_headers:nil) + response = get_rdp_file_contents_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets a string that represents the contents of the RDP file for the virtual + # machine + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_rdp_file_contents_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + get_rdp_file_contents_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Gets a string that represents the contents of the RDP file for the virtual + # machine + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_rdp_file_contents_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/getRdpFileContents' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::RdpConnection.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 applicable start/stop schedules, if any. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ApplicableSchedule] operation results. + # + def list_applicable_schedules(resource_group_name, lab_name, name, custom_headers:nil) + response = list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Lists the applicable start/stop schedules, if any. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_applicable_schedules_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Lists the applicable start/stop schedules, if any. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule.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 + + # + # Redeploy a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def redeploy(resource_group_name, lab_name, name, custom_headers:nil) + response = redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 redeploy_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_redeploy_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Resize Virtual Machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param resize_lab_virtual_machine_properties + # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual + # machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def resize(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil) + response = resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param resize_lab_virtual_machine_properties + # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual + # machine. + # @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 resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil) + # Send request + promise = begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers: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 + + # + # Restart a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def restart(resource_group_name, lab_name, name, custom_headers:nil) + response = restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 restart_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_restart_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Start a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, lab_name, name, custom_headers:nil) + response = start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 start_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Stop a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def stop(resource_group_name, lab_name, name, custom_headers:nil) + response = stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 stop_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_stop_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Transfers all data disks attached to the virtual machine to be owned by the + # current user. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def transfer_disks(resource_group_name, lab_name, name, custom_headers:nil) + response = transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 transfer_disks_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Release ownership of an existing virtual machine This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def un_claim(resource_group_name, lab_name, name, custom_headers:nil) + response = un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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 un_claim_async(resource_group_name, lab_name, name, custom_headers:nil) + # Send request + promise = begin_un_claim_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Create or replace an existing Virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachine] A virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabVirtualMachine] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachine] A virtual machine. + # @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_or_update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param lab_virtual_machine [LabVirtualMachine] A virtual machine. + # @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_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.mapper() + request_content = @client.serialize(request_mapper, lab_virtual_machine) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine.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 + + # + # Delete virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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, lab_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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, lab_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}' + + 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,'labName' => lab_name,'name' => 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 + + # + # Attach a new or existing data disk to virtual machine. This operation can + # take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param data_disk_properties [DataDiskProperties] Request body for adding a + # new or existing data disk to a virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) + response = begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # Attach a new or existing data disk to virtual machine. This operation can + # take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param data_disk_properties [DataDiskProperties] Request body for adding a + # new or existing data disk to a virtual machine. + # @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_add_data_disk_with_http_info(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) + begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value! + end + + # + # Attach a new or existing data disk to virtual machine. This operation can + # take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param data_disk_properties [DataDiskProperties] Request body for adding a + # new or existing data disk to a virtual machine. + # @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_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'data_disk_properties is nil' if data_disk_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskProperties.mapper() + request_content = @client.serialize(request_mapper, data_disk_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/addDataDisk' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Apply artifacts to virtual machine. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for + # applying artifacts to a virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) + response = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value! + nil + end + + # + # Apply artifacts to virtual machine. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for + # applying artifacts to a virtual machine. + # @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_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) + begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value! + end + + # + # Apply artifacts to virtual machine. This operation can take a while to + # complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param apply_artifacts_request [ApplyArtifactsRequest] Request body for + # applying artifacts to a virtual machine. + # @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_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'apply_artifacts_request is nil' if apply_artifacts_request.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplyArtifactsRequest.mapper() + request_content = @client.serialize(request_mapper, apply_artifacts_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Take ownership of an existing virtual machine This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_claim(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Take ownership of an existing virtual machine This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_claim_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Take ownership of an existing virtual machine This operation can take a while + # to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_claim_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/claim' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Detach the specified disk from the virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param detach_data_disk_properties [DetachDataDiskProperties] Request body + # for detaching data disk from a virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) + response = begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value! + nil + end + + # + # Detach the specified disk from the virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param detach_data_disk_properties [DetachDataDiskProperties] Request body + # for detaching data disk from a virtual machine. + # @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_detach_data_disk_with_http_info(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) + begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value! + end + + # + # Detach the specified disk from the virtual machine. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param detach_data_disk_properties [DetachDataDiskProperties] Request body + # for detaching data disk from a virtual machine. + # @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_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'detach_data_disk_properties is nil' if detach_data_disk_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDataDiskProperties.mapper() + request_content = @client.serialize(request_mapper, detach_data_disk_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/detachDataDisk' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Redeploy a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_redeploy(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Redeploy a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_redeploy_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_redeploy_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Redeploy a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_redeploy_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/redeploy' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Resize Virtual Machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param resize_lab_virtual_machine_properties + # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual + # machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_resize(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil) + response = begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers).value! + nil + end + + # + # Resize Virtual Machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param resize_lab_virtual_machine_properties + # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual + # machine. + # @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_resize_with_http_info(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:nil) + begin_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers:custom_headers).value! + end + + # + # Resize Virtual Machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param resize_lab_virtual_machine_properties + # [ResizeLabVirtualMachineProperties] Request body for resizing a virtual + # machine. + # @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_resize_async(resource_group_name, lab_name, name, resize_lab_virtual_machine_properties, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'resize_lab_virtual_machine_properties is nil' if resize_lab_virtual_machine_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ResizeLabVirtualMachineProperties.mapper() + request_content = @client.serialize(request_mapper, resize_lab_virtual_machine_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/resize' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Restart a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_restart(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Restart a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_restart_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_restart_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Restart a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_restart_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/restart' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Start a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Start a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_start_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Start a virtual machine. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_start_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/start' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Stop a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_stop(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Stop a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_stop_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Stop a virtual machine This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_stop_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/stop' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Transfers all data disks attached to the virtual machine to be owned by the + # current user. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_transfer_disks(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Transfers all data disks attached to the virtual machine to be owned by the + # current user. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_transfer_disks_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_transfer_disks_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Transfers all data disks attached to the virtual machine to be owned by the + # current user. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_transfer_disks_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/transferDisks' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # Release ownership of an existing virtual machine This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_un_claim(resource_group_name, lab_name, name, custom_headers:nil) + response = begin_un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Release ownership of an existing virtual machine This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_un_claim_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) + begin_un_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Release ownership of an existing virtual machine This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual machine. + # @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_un_claim_async(resource_group_name, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualmachines/{name}/unClaim' + + 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,'labName' => lab_name,'name' => 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 || status_code == 202 + 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 + + # + # List virtual machines in a given lab. + # + # @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 [LabVirtualMachineList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List virtual machines in a given lab. + # + # @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:custom_headers).value! + end + + # + # List virtual machines in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList.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 + + # + # List virtual machines in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabVirtualMachineList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb new file mode 100644 index 0000000000..84754993ba --- /dev/null +++ b/management/azure_mgmt_devtestlabs/lib/2018-09-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb @@ -0,0 +1,760 @@ +# 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::DevTestLabs::Mgmt::V2018_09_15 + # + # The DevTest Labs Client. + # + class VirtualNetworks + include MsRestAzure + + # + # Creates and initializes a new instance of the VirtualNetworks class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [DevTestLabsClient] reference to the DevTestLabsClient + attr_reader :client + + # + # List virtual networks in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List virtual networks in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List virtual networks in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @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, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualnetworks' + + 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,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkList.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 + + # + # Get virtual network. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [VirtualNetwork] operation results. + # + def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get virtual network. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @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, lab_name, name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get virtual network. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @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, lab_name, name, expand:nil, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualnetworks/{name}' + + 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,'labName' => lab_name,'name' => name}, + query_params: {'$expand' => expand,'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::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork.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 + + # + # Create or replace an existing virtual network. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetwork] A virtual network. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [VirtualNetwork] operation results. + # + def create_or_update(resource_group_name, lab_name, name, virtual_network, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetwork] A virtual network. + # @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_or_update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork.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 + + # + # Delete virtual network. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_name, name, custom_headers:nil) + response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @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, lab_name, name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_name, name, custom_headers: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 + + # + # Modify properties of virtual networks. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetworkFragment] A virtual network. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [VirtualNetwork] operation results. + # + def update(resource_group_name, lab_name, name, virtual_network, custom_headers:nil) + response = update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of virtual networks. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetworkFragment] A virtual network. + # @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 update_with_http_info(resource_group_name, lab_name, name, virtual_network, custom_headers:nil) + update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:custom_headers).value! + end + + # + # Modify properties of virtual networks. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetworkFragment] A virtual network. + # @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 update_async(resource_group_name, lab_name, name, virtual_network, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'virtual_network is nil' if virtual_network.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkFragment.mapper() + request_content = @client.serialize(request_mapper, virtual_network) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}' + + 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,'labName' => lab_name,'name' => 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 + 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::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork.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 + + # + # Create or replace an existing virtual network. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetwork] A virtual network. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [VirtualNetwork] operation results. + # + def begin_create_or_update(resource_group_name, lab_name, name, virtual_network, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing virtual network. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetwork] A virtual network. + # @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_or_update_with_http_info(resource_group_name, lab_name, name, virtual_network, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_name, name, virtual_network, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing virtual network. This operation can take a + # while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @param virtual_network [VirtualNetwork] A virtual network. + # @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_or_update_async(resource_group_name, lab_name, name, virtual_network, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, 'virtual_network is nil' if virtual_network.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork.mapper() + request_content = @client.serialize(request_mapper, virtual_network) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}' + + 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,'labName' => lab_name,'name' => 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::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork.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::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork.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 + + # + # Delete virtual network. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @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, lab_name, name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + nil + end + + # + # Delete virtual network. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @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, lab_name, name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! + end + + # + # Delete virtual network. This operation can take a while to complete. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param name [String] The name of the virtual network. + # @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, lab_name, name, custom_headers: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, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'name is nil' if name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.DevTestLab/labs/{labName}/virtualnetworks/{name}' + + 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,'labName' => lab_name,'name' => 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 + + # + # List virtual networks in a given lab. + # + # @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 [VirtualNetworkList] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List virtual networks in a given lab. + # + # @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:custom_headers).value! + end + + # + # List virtual networks in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkList.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 + + # + # List virtual networks in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=externalSubnets)' + # @param filter [String] The filter to apply to the operation. Example: + # '$filter=contains(name,'myName') + # @param top [Integer] The maximum number of resources to return from the + # operation. Example: '$top=10' + # @param orderby [String] The ordering expression for the results, using OData + # notation. Example: '$orderby=name desc' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [VirtualNetworkList] which provide lazy access to pages of the + # response. + # + def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_devtestlabs/lib/azure_mgmt_devtestlabs.rb b/management/azure_mgmt_devtestlabs/lib/azure_mgmt_devtestlabs.rb index fbc4ce88e3..66bbbabfdb 100644 --- a/management/azure_mgmt_devtestlabs/lib/azure_mgmt_devtestlabs.rb +++ b/management/azure_mgmt_devtestlabs/lib/azure_mgmt_devtestlabs.rb @@ -3,4 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. require '2016-05-15/generated/azure_mgmt_devtestlabs' +require '2018-09-15/generated/azure_mgmt_devtestlabs' require 'profiles/latest/devtestlabs_latest_profile_client' diff --git a/management/azure_mgmt_devtestlabs/lib/profiles/latest/modules/devtestlabs_profile_module.rb b/management/azure_mgmt_devtestlabs/lib/profiles/latest/modules/devtestlabs_profile_module.rb index 0d4d4083c4..cbc5e56874 100644 --- a/management/azure_mgmt_devtestlabs/lib/profiles/latest/modules/devtestlabs_profile_module.rb +++ b/management/azure_mgmt_devtestlabs/lib/profiles/latest/modules/devtestlabs_profile_module.rb @@ -6,194 +6,229 @@ module Azure::DevTestLabs::Profiles::Latest module Mgmt - ProviderOperations = Azure::DevTestLabs::Mgmt::V2016_05_15::ProviderOperations - Labs = Azure::DevTestLabs::Mgmt::V2016_05_15::Labs - Operations = Azure::DevTestLabs::Mgmt::V2016_05_15::Operations - GlobalSchedules = Azure::DevTestLabs::Mgmt::V2016_05_15::GlobalSchedules - ArtifactSources = Azure::DevTestLabs::Mgmt::V2016_05_15::ArtifactSources - ArmTemplates = Azure::DevTestLabs::Mgmt::V2016_05_15::ArmTemplates - Artifacts = Azure::DevTestLabs::Mgmt::V2016_05_15::Artifacts - Costs = Azure::DevTestLabs::Mgmt::V2016_05_15::Costs - CustomImages = Azure::DevTestLabs::Mgmt::V2016_05_15::CustomImages - Formulas = Azure::DevTestLabs::Mgmt::V2016_05_15::Formulas - GalleryImages = Azure::DevTestLabs::Mgmt::V2016_05_15::GalleryImages - NotificationChannels = Azure::DevTestLabs::Mgmt::V2016_05_15::NotificationChannels - PolicySets = Azure::DevTestLabs::Mgmt::V2016_05_15::PolicySets - Policies = Azure::DevTestLabs::Mgmt::V2016_05_15::Policies - Schedules = Azure::DevTestLabs::Mgmt::V2016_05_15::Schedules - ServiceRunners = Azure::DevTestLabs::Mgmt::V2016_05_15::ServiceRunners - Users = Azure::DevTestLabs::Mgmt::V2016_05_15::Users - Disks = Azure::DevTestLabs::Mgmt::V2016_05_15::Disks - Environments = Azure::DevTestLabs::Mgmt::V2016_05_15::Environments - Secrets = Azure::DevTestLabs::Mgmt::V2016_05_15::Secrets - VirtualMachines = Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualMachines - VirtualMachineSchedules = Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualMachineSchedules - VirtualNetworks = Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualNetworks + ProviderOperations = Azure::DevTestLabs::Mgmt::V2018_09_15::ProviderOperations + Labs = Azure::DevTestLabs::Mgmt::V2018_09_15::Labs + Operations = Azure::DevTestLabs::Mgmt::V2018_09_15::Operations + GlobalSchedules = Azure::DevTestLabs::Mgmt::V2018_09_15::GlobalSchedules + ArtifactSources = Azure::DevTestLabs::Mgmt::V2018_09_15::ArtifactSources + ArmTemplates = Azure::DevTestLabs::Mgmt::V2018_09_15::ArmTemplates + Artifacts = Azure::DevTestLabs::Mgmt::V2018_09_15::Artifacts + Costs = Azure::DevTestLabs::Mgmt::V2018_09_15::Costs + CustomImages = Azure::DevTestLabs::Mgmt::V2018_09_15::CustomImages + Formulas = Azure::DevTestLabs::Mgmt::V2018_09_15::Formulas + GalleryImages = Azure::DevTestLabs::Mgmt::V2018_09_15::GalleryImages + NotificationChannels = Azure::DevTestLabs::Mgmt::V2018_09_15::NotificationChannels + PolicySets = Azure::DevTestLabs::Mgmt::V2018_09_15::PolicySets + Policies = Azure::DevTestLabs::Mgmt::V2018_09_15::Policies + Schedules = Azure::DevTestLabs::Mgmt::V2018_09_15::Schedules + ServiceRunners = Azure::DevTestLabs::Mgmt::V2018_09_15::ServiceRunners + Users = Azure::DevTestLabs::Mgmt::V2018_09_15::Users + Disks = Azure::DevTestLabs::Mgmt::V2018_09_15::Disks + Environments = Azure::DevTestLabs::Mgmt::V2018_09_15::Environments + Secrets = Azure::DevTestLabs::Mgmt::V2018_09_15::Secrets + ServiceFabrics = Azure::DevTestLabs::Mgmt::V2018_09_15::ServiceFabrics + ServiceFabricSchedules = Azure::DevTestLabs::Mgmt::V2018_09_15::ServiceFabricSchedules + VirtualMachines = Azure::DevTestLabs::Mgmt::V2018_09_15::VirtualMachines + VirtualMachineSchedules = Azure::DevTestLabs::Mgmt::V2018_09_15::VirtualMachineSchedules + VirtualNetworks = Azure::DevTestLabs::Mgmt::V2018_09_15::VirtualNetworks module Models - ExternalSubnetFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnetFragment - GalleryImageReference = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReference - DayDetails = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetails - InboundNatRule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRule - NotificationSettings = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettings - SharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfiguration - ExportResourceUsageParameters = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExportResourceUsageParameters - WeekDetailsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetailsFragment - ExternalSubnet = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnet - HourDetailsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetailsFragment - WeekDetails = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetails - UserSecretStore = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStore - HourDetails = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetails - ArtifactParameterProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterProperties - ArtifactInstallProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallProperties - ResponseWithContinuationLab = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab - ParametersValueFileInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParametersValueFileInfo - ResponseWithContinuationLabVirtualMachine = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVirtualMachine - ArmTemplateInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateInfo - NetworkInterfaceProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfaceProperties - ResponseWithContinuationUser = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationUser - LabVirtualMachineCreationParameter = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineCreationParameter - ArtifactDeploymentStatusPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusPropertiesFragment - FormulaPropertiesFromVm = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FormulaPropertiesFromVm - ArtifactInstallPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallPropertiesFragment - ResponseWithContinuationLabVhd = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVhd - Subnet = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Subnet - UserSecretStoreFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStoreFragment - AttachNewDataDiskOptions = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachNewDataDiskOptions - GalleryImageReferenceFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReferenceFragment - ParameterInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParameterInfo - ComputeDataDisk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDisk - GenerateArmTemplateRequest = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateArmTemplateRequest - ComputeVmInstanceViewStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatus - GenerateUploadUriParameter = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriParameter - ComputeVmProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmProperties - GenerateUploadUriResponse = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriResponse - PercentageCostThresholdProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PercentageCostThresholdProperties - IdentityProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::IdentityProperties - WindowsOsInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsInfo - InboundNatRuleFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRuleFragment - CustomImagePropertiesFromVm = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesFromVm - UserIdentityFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentityFragment - ResponseWithContinuationSchedule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSchedule - TargetCostProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostProperties - DetachDataDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDataDiskProperties - LabCostSummaryProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostSummaryProperties - ResponseWithContinuationPolicy = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationPolicy - LabCostDetailsProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostDetailsProperties - ResponseWithContinuationNotificationChannel = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationNotificationChannel - LabResourceCostProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabResourceCostProperties - EvaluatePoliciesRequest = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesRequest - SubnetOverrideFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverrideFragment - PolicySetResult = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicySetResult - SubnetSharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfigurationFragment - Event = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Event - LabVhd = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVhd - DayDetailsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetailsFragment - SubnetFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetFragment - UserIdentity = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentity - SharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfigurationFragment - ResponseWithContinuationServiceRunner = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationServiceRunner - NetworkInterfacePropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfacePropertiesFragment - ArtifactDeploymentStatusProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusProperties - ShutdownNotificationContent = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ShutdownNotificationContent - ResponseWithContinuationSecret = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSecret - RetargetScheduleProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::RetargetScheduleProperties - BulkCreationParameters = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::BulkCreationParameters - ResponseWithContinuationVirtualNetwork = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationVirtualNetwork - ComputeDataDiskFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDiskFragment - NotifyParameters = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotifyParameters - ComputeVmPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmPropertiesFragment - OperationError = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationError - LinuxOsInfo = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsInfo - OperationMetadataDisplay = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadataDisplay - DataDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DataDiskProperties - OperationMetadata = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadata - EnvironmentDeploymentProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnvironmentDeploymentProperties - OperationResult = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationResult - PolicyViolation = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyViolation - SubnetOverride = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverride - EventFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EventFragment - SubnetSharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfiguration - ApplyArtifactsRequest = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplyArtifactsRequest - Port = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Port - ArtifactParameterPropertiesFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterPropertiesFragment - PortFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PortFragment - ProviderOperationResult = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ProviderOperationResult - CostThresholdProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdProperties - Resource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Resource - DetachDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDiskProperties - ResponseWithContinuationArmTemplate = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArmTemplate - EvaluatePoliciesResponse = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesResponse - ResponseWithContinuationArtifact = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifact - ArmTemplateParameterProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateParameterProperties - ResponseWithContinuationArtifactSource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifactSource - ComputeVmInstanceViewStatusFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatusFragment - ResponseWithContinuationCustomImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationCustomImage - EvaluatePoliciesProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesProperties - ResponseWithContinuationDisk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDisk - AttachDiskProperties = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachDiskProperties - ResponseWithContinuationDtlEnvironment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDtlEnvironment - NotificationSettingsFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettingsFragment - ResponseWithContinuationFormula = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationFormula - CustomImagePropertiesCustom = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesCustom - ResponseWithContinuationGalleryImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationGalleryImage - Schedule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Schedule - ApplicableSchedule = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableSchedule - ScheduleFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ScheduleFragment - ApplicableScheduleFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableScheduleFragment - ArmTemplate = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplate - Artifact = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Artifact - ArtifactSource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSource - ArtifactSourceFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSourceFragment - CustomImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImage - Disk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Disk - DtlEnvironment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DtlEnvironment - Formula = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Formula - GalleryImage = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImage - Lab = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab - LabCost = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCost - LabFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabFragment - LabVirtualMachine = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine - LabVirtualMachineFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineFragment - NotificationChannel = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannel - NotificationChannelFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelFragment - Policy = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Policy - PolicyFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFragment - Secret = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Secret - ServiceRunner = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ServiceRunner - User = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::User - VirtualNetwork = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetwork - UserFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserFragment - VirtualNetworkFragment = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetworkFragment - EnableStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnableStatus - NotificationStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationStatus - SourceControlType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SourceControlType - StorageType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::StorageType - CostThresholdStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdStatus - WindowsOsState = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsState - LinuxOsState = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsState - CustomImageOsType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImageOsType - HostCachingOptions = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HostCachingOptions - NotificationChannelEventType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelEventType - TransportProtocol = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TransportProtocol - VirtualMachineCreationSource = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualMachineCreationSource - FileUploadOptions = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FileUploadOptions - PremiumDataDisk = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PremiumDataDisk - TargetCostStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostStatus - ReportingCycleType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ReportingCycleType - CostType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostType - HttpStatusCode = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HttpStatusCode - PolicyStatus = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyStatus - PolicyFactName = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFactName - PolicyEvaluatorType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyEvaluatorType - UsagePermissionType = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UsagePermissionType + SharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfiguration + WeekDetails = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetails + NetworkInterfaceProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfaceProperties + HourDetails = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetails + ScheduleCreationParameter = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameter + EnvironmentDeploymentPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentPropertiesFragment + VirtualNetworkList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkList + Subnet = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Subnet + DayDetailsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetailsFragment + DtlEnvironmentList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentList + NotificationSettingsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettingsFragment + EvaluatePoliciesProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesProperties + UserSecretStoreFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStoreFragment + EvaluatePoliciesRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesRequest + ArtifactInstallProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallProperties + PolicyViolation = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyViolation + ParametersValueFileInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParametersValueFileInfo + PolicySetResult = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicySetResult + ArmTemplateInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateInfo + EvaluatePoliciesResponse = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesResponse + ArmTemplateParameterProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterProperties + Event = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Event + UserSecretStore = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStore + EventFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EventFragment + ArtifactDeploymentStatusPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusPropertiesFragment + ExportResourceUsageParameters = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExportResourceUsageParameters + ArtifactInstallPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallPropertiesFragment + ExternalSubnet = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnet + UserIdentity = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentity + ExternalSubnetFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnetFragment + ArtifactSourceList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceList + GalleryImageReference = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReference + AttachNewDataDiskOptions = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptions + InboundNatRule = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRule + BulkCreationParameters = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParameters + DayDetails = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetails + NotificationSettings = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettings + ComputeDataDisk = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDisk + ShutdownNotificationContent = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ShutdownNotificationContent + ComputeVmInstanceViewStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatus + LabVirtualMachineCreationParameter = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameter + ComputeVmProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmProperties + FormulaPropertiesFromVm = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVm + PercentageCostThresholdProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PercentageCostThresholdProperties + ServiceRunnerList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunnerList + WindowsOsInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfo + GalleryImageReferenceFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReferenceFragment + CustomImagePropertiesFromVm = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVm + InboundNatRuleFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRuleFragment + DataDiskStorageTypeInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfo + SharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfigurationFragment + SubnetOverrideFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverrideFragment + NetworkInterfacePropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfacePropertiesFragment + LinuxOsInfoFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfoFragment + ScheduleCreationParameterFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameterFragment + CustomImagePropertiesCustomFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustomFragment + LabVirtualMachineCreationParameterFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameterFragment + CustomImagePropertiesFromPlanFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlanFragment + FormulaPropertiesFromVmFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVmFragment + CustomImageList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageList + ServiceFabricList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricList + DataDiskPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskPropertiesFragment + FormulaList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaList + DetachDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDiskProperties + SecretList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretList + SubnetSharedPublicIpAddressConfiguration = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfiguration + GalleryImageList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageList + EnvironmentDeploymentProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentProperties + ParameterInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParameterInfo + WeekDetailsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetailsFragment + GenerateArmTemplateRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateArmTemplateRequest + UserList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserList + GenerateUploadUriParameter = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriParameter + ApplyArtifactsRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplyArtifactsRequest + GenerateUploadUriResponse = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriResponse + ArmTemplateList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateList + IdentityProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::IdentityProperties + ArtifactDeploymentStatusProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusProperties + ImportLabVirtualMachineRequest = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ImportLabVirtualMachineRequest + ArtifactList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactList + LabAnnouncementProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementProperties + AttachDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachDiskProperties + LabSupportProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportProperties + BulkCreationParametersFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParametersFragment + ScheduleList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList + ComputeDataDiskFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDiskFragment + LabAnnouncementPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementPropertiesFragment + ComputeVmPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmPropertiesFragment + TargetCostProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostProperties + LinuxOsInfo = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfo + LabCostSummaryProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostSummaryProperties + CustomImagePropertiesFromPlan = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlan + LabCostDetailsProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostDetailsProperties + CustomImagePropertiesFromVmFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVmFragment + LabResourceCostProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabResourceCostProperties + SubnetSharedPublicIpAddressConfigurationFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfigurationFragment + RetargetScheduleProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RetargetScheduleProperties + DetachDataDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDataDiskProperties + LabSupportPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportPropertiesFragment + DiskList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskList + Resource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Resource + HourDetailsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetailsFragment + LabList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabList + UserIdentityFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentityFragment + LabVhd = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhd + ArtifactParameterPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterPropertiesFragment + LabVhdList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhdList + AttachNewDataDiskOptionsFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptionsFragment + ResizeLabVirtualMachineProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ResizeLabVirtualMachineProperties + ComputeVmInstanceViewStatusFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatusFragment + RdpConnection = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RdpConnection + CustomImagePropertiesCustom = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustom + LabVirtualMachineList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList + DataDiskStorageTypeInfoFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfoFragment + ProviderOperationResult = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ProviderOperationResult + SubnetOverride = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverride + PortFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PortFragment + ArtifactParameterProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterProperties + NotificationChannelList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelList + UpdateResource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UpdateResource + NotifyParameters = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotifyParameters + CostThresholdProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdProperties + OperationError = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationError + DataDiskProperties = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskProperties + OperationMetadataDisplay = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadataDisplay + ArmTemplateParameterPropertiesFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterPropertiesFragment + OperationMetadata = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadata + WindowsOsInfoFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfoFragment + OperationResult = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationResult + Port = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Port + SubnetFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetFragment + PolicyList = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyList + Schedule = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule + ApplicableSchedule = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule + ScheduleFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment + ApplicableScheduleFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableScheduleFragment + ArmTemplate = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplate + Artifact = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Artifact + ArtifactSource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource + ArtifactSourceFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceFragment + CustomImage = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage + CustomImageFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageFragment + Disk = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Disk + DiskFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskFragment + DtlEnvironment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment + DtlEnvironmentFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentFragment + Formula = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Formula + FormulaFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaFragment + GalleryImage = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImage + Lab = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Lab + LabCost = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost + LabFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabFragment + LabVirtualMachine = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine + LabVirtualMachineFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineFragment + NotificationChannel = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel + NotificationChannelFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelFragment + Policy = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Policy + PolicyFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFragment + Secret = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Secret + SecretFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretFragment + ServiceFabric = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric + ServiceFabricFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricFragment + ServiceRunner = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner + User = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::User + UserFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserFragment + VirtualNetwork = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork + VirtualNetworkFragment = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkFragment + EnableStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnableStatus + SourceControlType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SourceControlType + StorageType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::StorageType + CostThresholdStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdStatus + WindowsOsState = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsState + LinuxOsState = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsState + CustomImageOsType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageOsType + HostCachingOptions = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HostCachingOptions + NotificationChannelEventType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelEventType + TransportProtocol = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TransportProtocol + VirtualMachineCreationSource = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualMachineCreationSource + FileUploadOptions = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FileUploadOptions + PremiumDataDisk = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PremiumDataDisk + EnvironmentPermission = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentPermission + TargetCostStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostStatus + ReportingCycleType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ReportingCycleType + CostType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostType + HttpStatusCode = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HttpStatusCode + PolicyStatus = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyStatus + PolicyFactName = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFactName + PolicyEvaluatorType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyEvaluatorType + UsagePermissionType = Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UsagePermissionType end # # DevTestLabsManagementClass # class DevTestLabsManagementClass - attr_reader :provider_operations, :labs, :operations, :global_schedules, :artifact_sources, :arm_templates, :artifacts, :costs, :custom_images, :formulas, :gallery_images, :notification_channels, :policy_sets, :policies, :schedules, :service_runners, :users, :disks, :environments, :secrets, :virtual_machines, :virtual_machine_schedules, :virtual_networks, :configurable, :base_url, :options, :model_classes + attr_reader :provider_operations, :labs, :operations, :global_schedules, :artifact_sources, :arm_templates, :artifacts, :costs, :custom_images, :formulas, :gallery_images, :notification_channels, :policy_sets, :policies, :schedules, :service_runners, :users, :disks, :environments, :secrets, :service_fabrics, :service_fabric_schedules, :virtual_machines, :virtual_machine_schedules, :virtual_networks, :configurable, :base_url, :options, :model_classes def initialize(options = {}) if options.is_a?(Hash) && options.length == 0 @@ -208,7 +243,7 @@ def initialize(options = {}) @base_url = options[:base_url].nil? ? nil:options[:base_url] @options = options[:options].nil? ? nil:options[:options] - @client_0 = Azure::DevTestLabs::Mgmt::V2016_05_15::DevTestLabsClient.new(configurable.credentials, base_url, options) + @client_0 = Azure::DevTestLabs::Mgmt::V2018_09_15::DevTestLabsClient.new(configurable.credentials, base_url, options) if(@client_0.respond_to?(:subscription_id)) @client_0.subscription_id = configurable.subscription_id end @@ -233,6 +268,8 @@ def initialize(options = {}) @disks = @client_0.disks @environments = @client_0.environments @secrets = @client_0.secrets + @service_fabrics = @client_0.service_fabrics + @service_fabric_schedules = @client_0.service_fabric_schedules @virtual_machines = @client_0.virtual_machines @virtual_machine_schedules = @client_0.virtual_machine_schedules @virtual_networks = @client_0.virtual_networks @@ -256,473 +293,572 @@ def method_missing(method, *args) end class ModelClasses - def external_subnet_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnetFragment + def shared_public_ip_address_configuration + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfiguration end - def gallery_image_reference - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReference + def week_details + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetails end - def day_details - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetails + def network_interface_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfaceProperties end - def inbound_nat_rule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRule + def hour_details + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetails end - def notification_settings - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettings + def schedule_creation_parameter + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameter end - def shared_public_ip_address_configuration - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfiguration + def environment_deployment_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentPropertiesFragment end - def export_resource_usage_parameters - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExportResourceUsageParameters + def virtual_network_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkList end - def week_details_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetailsFragment + def subnet + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Subnet end - def external_subnet - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExternalSubnet + def day_details_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetailsFragment end - def hour_details_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetailsFragment + def dtl_environment_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentList end - def week_details - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WeekDetails + def notification_settings_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettingsFragment end - def user_secret_store - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStore + def evaluate_policies_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesProperties end - def hour_details - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HourDetails + def user_secret_store_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStoreFragment end - def artifact_parameter_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterProperties + def evaluate_policies_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesRequest end def artifact_install_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallProperties end - def response_with_continuation_lab - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab + def policy_violation + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyViolation end def parameters_value_file_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParametersValueFileInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParametersValueFileInfo end - def response_with_continuation_lab_virtual_machine - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVirtualMachine + def policy_set_result + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicySetResult end def arm_template_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateInfo end - def network_interface_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfaceProperties + def evaluate_policies_response + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EvaluatePoliciesResponse + end + def arm_template_parameter_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterProperties end - def response_with_continuation_user - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationUser + def event + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Event end - def lab_virtual_machine_creation_parameter - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineCreationParameter + def user_secret_store + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserSecretStore + end + def event_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EventFragment end def artifact_deployment_status_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusPropertiesFragment end - def formula_properties_from_vm - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FormulaPropertiesFromVm + def export_resource_usage_parameters + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExportResourceUsageParameters end def artifact_install_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactInstallPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactInstallPropertiesFragment end - def response_with_continuation_lab_vhd - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVhd + def external_subnet + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnet end - def subnet - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Subnet + def user_identity + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentity end - def user_secret_store_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserSecretStoreFragment + def external_subnet_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ExternalSubnetFragment + end + def artifact_source_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceList + end + def gallery_image_reference + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReference end def attach_new_data_disk_options - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachNewDataDiskOptions + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptions end - def gallery_image_reference_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImageReferenceFragment + def inbound_nat_rule + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRule end - def parameter_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ParameterInfo + def bulk_creation_parameters + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParameters + end + def day_details + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DayDetails + end + def notification_settings + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationSettings end def compute_data_disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDisk + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDisk end - def generate_arm_template_request - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateArmTemplateRequest + def shutdown_notification_content + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ShutdownNotificationContent end def compute_vm_instance_view_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatus end - def generate_upload_uri_parameter - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriParameter + def lab_virtual_machine_creation_parameter + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameter end def compute_vm_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmProperties end - def generate_upload_uri_response - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriResponse + def formula_properties_from_vm + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVm end def percentage_cost_threshold_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PercentageCostThresholdProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PercentageCostThresholdProperties end - def identity_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::IdentityProperties + def service_runner_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunnerList end def windows_os_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfo end - def inbound_nat_rule_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::InboundNatRuleFragment + def gallery_image_reference_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageReferenceFragment end def custom_image_properties_from_vm - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesFromVm + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVm end - def user_identity_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentityFragment + def inbound_nat_rule_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::InboundNatRuleFragment end - def response_with_continuation_schedule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSchedule + def data_disk_storage_type_info + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfo end - def target_cost_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostProperties + def shared_public_ip_address_configuration_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SharedPublicIpAddressConfigurationFragment end - def detach_data_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDataDiskProperties + def subnet_override_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverrideFragment end - def lab_cost_summary_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostSummaryProperties + def network_interface_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NetworkInterfacePropertiesFragment end - def response_with_continuation_policy - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationPolicy + def linux_os_info_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfoFragment end - def lab_cost_details_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCostDetailsProperties + def schedule_creation_parameter_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleCreationParameterFragment end - def response_with_continuation_notification_channel - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationNotificationChannel + def custom_image_properties_custom_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustomFragment end - def lab_resource_cost_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabResourceCostProperties + def lab_virtual_machine_creation_parameter_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineCreationParameterFragment end - def evaluate_policies_request - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesRequest + def custom_image_properties_from_plan_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlanFragment end - def subnet_override_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverrideFragment + def formula_properties_from_vm_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaPropertiesFromVmFragment end - def policy_set_result - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicySetResult + def custom_image_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageList end - def subnet_shared_public_ip_address_configuration_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfigurationFragment + def service_fabric_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricList end - def event - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Event + def data_disk_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskPropertiesFragment end - def lab_vhd - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVhd + def formula_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaList end - def day_details_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DayDetailsFragment + def detach_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDiskProperties end - def subnet_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetFragment + def secret_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretList end - def user_identity - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserIdentity + def subnet_shared_public_ip_address_configuration + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfiguration end - def shared_public_ip_address_configuration_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SharedPublicIpAddressConfigurationFragment + def gallery_image_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImageList end - def response_with_continuation_service_runner - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationServiceRunner + def environment_deployment_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentDeploymentProperties end - def network_interface_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NetworkInterfacePropertiesFragment + def parameter_info + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ParameterInfo + end + def week_details_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WeekDetailsFragment + end + def generate_arm_template_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateArmTemplateRequest + end + def user_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserList + end + def generate_upload_uri_parameter + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriParameter + end + def apply_artifacts_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplyArtifactsRequest + end + def generate_upload_uri_response + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GenerateUploadUriResponse + end + def arm_template_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateList + end + def identity_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::IdentityProperties end def artifact_deployment_status_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactDeploymentStatusProperties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactDeploymentStatusProperties end - def shutdown_notification_content - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ShutdownNotificationContent + def import_lab_virtual_machine_request + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ImportLabVirtualMachineRequest end - def response_with_continuation_secret - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationSecret + def artifact_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactList end - def retarget_schedule_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::RetargetScheduleProperties + def lab_announcement_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementProperties end - def bulk_creation_parameters - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::BulkCreationParameters + def attach_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachDiskProperties + end + def lab_support_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportProperties end - def response_with_continuation_virtual_network - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationVirtualNetwork + def bulk_creation_parameters_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::BulkCreationParametersFragment + end + def schedule_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleList end def compute_data_disk_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeDataDiskFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeDataDiskFragment end - def notify_parameters - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotifyParameters + def lab_announcement_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabAnnouncementPropertiesFragment end def compute_vm_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmPropertiesFragment end - def operation_error - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationError + def target_cost_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostProperties end def linux_os_info - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsInfo + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsInfo end - def operation_metadata_display - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadataDisplay + def lab_cost_summary_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostSummaryProperties end - def data_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DataDiskProperties + def custom_image_properties_from_plan + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromPlan end - def operation_metadata - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationMetadata + def lab_cost_details_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCostDetailsProperties end - def environment_deployment_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnvironmentDeploymentProperties + def custom_image_properties_from_vm_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesFromVmFragment end - def operation_result - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationResult + def lab_resource_cost_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabResourceCostProperties end - def policy_violation - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyViolation + def subnet_shared_public_ip_address_configuration_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetSharedPublicIpAddressConfigurationFragment end - def subnet_override - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetOverride + def retarget_schedule_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RetargetScheduleProperties end - def event_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EventFragment + def detach_data_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DetachDataDiskProperties end - def subnet_shared_public_ip_address_configuration - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SubnetSharedPublicIpAddressConfiguration + def lab_support_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabSupportPropertiesFragment end - def apply_artifacts_request - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplyArtifactsRequest + def disk_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskList end - def port - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Port + def resource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Resource + end + def hour_details_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HourDetailsFragment + end + def lab_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabList + end + def user_identity_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserIdentityFragment + end + def lab_vhd + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhd end def artifact_parameter_properties_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactParameterPropertiesFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterPropertiesFragment end - def port_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PortFragment + def lab_vhd_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVhdList end - def provider_operation_result - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ProviderOperationResult + def attach_new_data_disk_options_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::AttachNewDataDiskOptionsFragment end - def cost_threshold_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdProperties + def resize_lab_virtual_machine_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ResizeLabVirtualMachineProperties end - def resource - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Resource + def compute_vm_instance_view_status_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ComputeVmInstanceViewStatusFragment end - def detach_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDiskProperties + def rdp_connection + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::RdpConnection end - def response_with_continuation_arm_template - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArmTemplate + def custom_image_properties_custom + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImagePropertiesCustom end - def evaluate_policies_response - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesResponse + def lab_virtual_machine_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineList end - def response_with_continuation_artifact - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifact + def data_disk_storage_type_info_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskStorageTypeInfoFragment end - def arm_template_parameter_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplateParameterProperties + def provider_operation_result + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ProviderOperationResult end - def response_with_continuation_artifact_source - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationArtifactSource + def subnet_override + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetOverride end - def compute_vm_instance_view_status_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ComputeVmInstanceViewStatusFragment + def port_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PortFragment end - def response_with_continuation_custom_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationCustomImage + def artifact_parameter_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactParameterProperties end - def evaluate_policies_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EvaluatePoliciesProperties + def notification_channel_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelList end - def response_with_continuation_disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDisk + def update_resource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UpdateResource end - def attach_disk_properties - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::AttachDiskProperties + def notify_parameters + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotifyParameters end - def response_with_continuation_dtl_environment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationDtlEnvironment + def cost_threshold_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdProperties end - def notification_settings_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationSettingsFragment + def operation_error + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationError end - def response_with_continuation_formula - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationFormula + def data_disk_properties + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DataDiskProperties end - def custom_image_properties_custom - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImagePropertiesCustom + def operation_metadata_display + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadataDisplay end - def response_with_continuation_gallery_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationGalleryImage + def arm_template_parameter_properties_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplateParameterPropertiesFragment + end + def operation_metadata + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationMetadata + end + def windows_os_info_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsInfoFragment + end + def operation_result + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::OperationResult + end + def port + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Port + end + def subnet_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SubnetFragment + end + def policy_list + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyList end def schedule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Schedule + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Schedule end def applicable_schedule - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableSchedule + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableSchedule end def schedule_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ScheduleFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ScheduleFragment end def applicable_schedule_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableScheduleFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ApplicableScheduleFragment end def arm_template - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArmTemplate + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArmTemplate end def artifact - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Artifact + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Artifact end def artifact_source - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSource end def artifact_source_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ArtifactSourceFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ArtifactSourceFragment end def custom_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImage + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImage + end + def custom_image_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageFragment end def disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Disk + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Disk + end + def disk_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DiskFragment end def dtl_environment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DtlEnvironment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironment + end + def dtl_environment_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::DtlEnvironmentFragment end def formula - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Formula + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Formula + end + def formula_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FormulaFragment end def gallery_image - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GalleryImage + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::GalleryImage end def lab - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Lab end def lab_cost - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabCost + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabCost end def lab_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabFragment end def lab_virtual_machine - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachine end def lab_virtual_machine_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LabVirtualMachineFragment end def notification_channel - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannel + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannel end def notification_channel_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelFragment end def policy - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Policy + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Policy end def policy_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFragment end def secret - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Secret + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::Secret + end + def secret_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SecretFragment + end + def service_fabric + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabric + end + def service_fabric_fragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceFabricFragment end def service_runner - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ServiceRunner + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ServiceRunner end def user - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::User - end - def virtual_network - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetwork + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::User end def user_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UserFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UserFragment + end + def virtual_network + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetwork end def virtual_network_fragment - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualNetworkFragment + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualNetworkFragment end def enable_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::EnableStatus - end - def notification_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnableStatus end def source_control_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::SourceControlType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::SourceControlType end def storage_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::StorageType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::StorageType end def cost_threshold_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostThresholdStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostThresholdStatus end def windows_os_state - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::WindowsOsState + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::WindowsOsState end def linux_os_state - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LinuxOsState + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::LinuxOsState end def custom_image_os_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CustomImageOsType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CustomImageOsType end def host_caching_options - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HostCachingOptions + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HostCachingOptions end def notification_channel_event_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelEventType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::NotificationChannelEventType end def transport_protocol - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TransportProtocol + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TransportProtocol end def virtual_machine_creation_source - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::VirtualMachineCreationSource + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::VirtualMachineCreationSource end def file_upload_options - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::FileUploadOptions + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::FileUploadOptions end def premium_data_disk - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PremiumDataDisk + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PremiumDataDisk + end + def environment_permission + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::EnvironmentPermission end def target_cost_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::TargetCostStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::TargetCostStatus end def reporting_cycle_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ReportingCycleType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::ReportingCycleType end def cost_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::CostType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::CostType end def http_status_code - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::HttpStatusCode + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::HttpStatusCode end def policy_status - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyStatus + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyStatus end def policy_fact_name - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFactName + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyFactName end def policy_evaluator_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyEvaluatorType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::PolicyEvaluatorType end def usage_permission_type - Azure::DevTestLabs::Mgmt::V2016_05_15::Models::UsagePermissionType + Azure::DevTestLabs::Mgmt::V2018_09_15::Models::UsagePermissionType end end end diff --git a/management/azure_mgmt_devtestlabs/lib/version.rb b/management/azure_mgmt_devtestlabs/lib/version.rb index 7b1e87c7b9..9d55c03d23 100644 --- a/management/azure_mgmt_devtestlabs/lib/version.rb +++ b/management/azure_mgmt_devtestlabs/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::DevTestLabs::Mgmt - VERSION = '0.17.1' + VERSION = '0.17.2' end diff --git a/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb b/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb index fce4960469..2b3940450b 100644 --- a/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +++ b/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb @@ -154,7 +154,7 @@ def make_request_async(method, path, options = {}) # def add_telemetry sdk_information = 'azure_mgmt_hdinsight' - sdk_information = "#{sdk_information}/0.17.0" + sdk_information = "#{sdk_information}/0.17.1" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb b/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb index 2720448f5d..ec3cbea050 100644 --- a/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb +++ b/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb @@ -30,6 +30,15 @@ class StorageAccount # @return [String] The storage account access key. attr_accessor :key + # @return [String] The resource ID of storage account, only to be + # specified for Azure Data Lake Storage Gen 2. + attr_accessor :resource_id + + # @return [String] The managed identity (MSI) that is allowed to access + # the storage account, only to be specified for Azure Data Lake Storage + # Gen 2. + attr_accessor :msi_resource_id + # # Mapper for StorageAccount class as Ruby Hash. @@ -83,6 +92,22 @@ def self.mapper() type: { name: 'String' } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + msi_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'msiResourceId', + type: { + name: 'String' + } } } } diff --git a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb index c3fa8c81d0..2c65fadbcc 100644 --- a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +++ b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb @@ -154,7 +154,7 @@ def make_request_async(method, path, options = {}) # def add_telemetry sdk_information = 'azure_mgmt_hdinsight' - sdk_information = "#{sdk_information}/0.17.0" + sdk_information = "#{sdk_information}/0.17.1" add_user_agent_information(sdk_information) end end diff --git a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb index ec0925fe42..07913c6a92 100644 --- a/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb +++ b/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb @@ -30,6 +30,15 @@ class StorageAccount # @return [String] The storage account access key. attr_accessor :key + # @return [String] The resource ID of storage account, only to be + # specified for Azure Data Lake Storage Gen 2. + attr_accessor :resource_id + + # @return [String] The managed identity (MSI) that is allowed to access + # the storage account, only to be specified for Azure Data Lake Storage + # Gen 2. + attr_accessor :msi_resource_id + # # Mapper for StorageAccount class as Ruby Hash. @@ -83,6 +92,22 @@ def self.mapper() type: { name: 'String' } + }, + resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceId', + type: { + name: 'String' + } + }, + msi_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'msiResourceId', + type: { + name: 'String' + } } } } diff --git a/management/azure_mgmt_hdinsight/lib/version.rb b/management/azure_mgmt_hdinsight/lib/version.rb index a8c51f7b0a..f497764b95 100644 --- a/management/azure_mgmt_hdinsight/lib/version.rb +++ b/management/azure_mgmt_hdinsight/lib/version.rb @@ -3,5 +3,5 @@ # Licensed under the MIT License. See License.txt in the project root for license information. module Azure::Hdinsight::Mgmt - VERSION = '0.17.0' + VERSION = '0.17.1' end diff --git a/management/azure_mgmt_labservices/.rspec b/management/azure_mgmt_labservices/.rspec new file mode 100644 index 0000000000..4e33a322b5 --- /dev/null +++ b/management/azure_mgmt_labservices/.rspec @@ -0,0 +1,3 @@ +--require spec_helper +--color +--format documentation diff --git a/management/azure_mgmt_labservices/LICENSE.txt b/management/azure_mgmt_labservices/LICENSE.txt new file mode 100644 index 0000000000..d5b09a3830 --- /dev/null +++ b/management/azure_mgmt_labservices/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_labservices/Rakefile b/management/azure_mgmt_labservices/Rakefile new file mode 100644 index 0000000000..ccbf835904 --- /dev/null +++ b/management/azure_mgmt_labservices/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_labservices/azure_mgmt_labservices.gemspec b/management/azure_mgmt_labservices/azure_mgmt_labservices.gemspec new file mode 100644 index 0000000000..0dc97271c4 --- /dev/null +++ b/management/azure_mgmt_labservices/azure_mgmt_labservices.gemspec @@ -0,0 +1,42 @@ +# 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 '../azure_mgmt_labservices/lib/module_definition' +require '../azure_mgmt_labservices/lib/version' + +Gem::Specification.new do |spec| + spec.name = 'azure_mgmt_labservices' + spec.version = Azure::Labservices::Mgmt::VERSION + spec.authors = 'Microsoft Corporation' + spec.email = 'azrubyteam@microsoft.com' + spec.description = 'Microsoft Azure Labservices Library for Ruby' + spec.summary = 'Official Ruby client library to consume Microsoft Azure Labservices.' + spec.homepage = 'https://aka.ms/azure-sdk-for-ruby' + spec.license = 'MIT' + spec.metadata = { + 'bug_tracker_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/issues', + 'changelog_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md', + 'documentation_uri' => 'https://azure.microsoft.com/en-us/develop/ruby/', + 'homepage_uri' => 'https://aka.ms/azure-sdk-for-ruby', + 'source_code_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/tree/master/management/azure_mgmt_labservices' + } + + spec.files = Dir["LICENSE.txt", "lib/**/*"] + spec.files.reject! { |fn| fn.include? "build.json" } + 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.11.0' +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices.rb new file mode 100644 index 0000000000..ddba00ab47 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices.rb @@ -0,0 +1,109 @@ +# 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 '2018-10-15/generated/azure_mgmt_labservices/module_definition' +require 'ms_rest_azure' + +module Azure::Labservices::Mgmt::V2018_10_15 + autoload :ProviderOperations, '2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb' + autoload :GlobalUsers, '2018-10-15/generated/azure_mgmt_labservices/global_users.rb' + autoload :LabAccounts, '2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb' + autoload :Operations, '2018-10-15/generated/azure_mgmt_labservices/operations.rb' + autoload :GalleryImages, '2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb' + autoload :Labs, '2018-10-15/generated/azure_mgmt_labservices/labs.rb' + autoload :EnvironmentSettings, '2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb' + autoload :Environments, '2018-10-15/generated/azure_mgmt_labservices/environments.rb' + autoload :Users, '2018-10-15/generated/azure_mgmt_labservices/users.rb' + autoload :ManagedLabsClient, '2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb' + + module Models + autoload :SizeAvailability, '2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb' + autoload :RegionalAvailability, '2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb' + autoload :GetRegionalAvailabilityResponse, '2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb' + autoload :ReferenceVmCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb' + autoload :AddUsersPayload, '2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb' + autoload :EnvironmentSettingCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb' + autoload :CreateLabProperties, '2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb' + autoload :ResourceSettingCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb' + autoload :NetworkInterface, '2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb' + autoload :SizeConfigurationPropertiesFragment, '2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb' + autoload :LabCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb' + autoload :ResourceSet, '2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb' + autoload :EnvironmentDetails, '2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb' + autoload :LatestOperationResult, '2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb' + autoload :ResponseWithContinuationGalleryImage, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb' + autoload :RegisterPayload, '2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb' + autoload :VmStateDetails, '2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb' + autoload :SizeConfigurationProperties, '2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb' + autoload :ResourceSettings, '2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb' + autoload :ResponseWithContinuationUser, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb' + autoload :ReferenceVmFragment, '2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb' + autoload :ResponseWithContinuationLabAccount, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb' + autoload :ResponseWithContinuationEnvironment, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb' + autoload :LabDetails, '2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb' + autoload :EnvironmentSize, '2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb' + autoload :ResponseWithContinuationLab, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb' + autoload :EnvironmentSizeFragment, '2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb' + autoload :ListEnvironmentsPayload, '2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb' + autoload :Resource, '2018-10-15/generated/azure_mgmt_labservices/models/resource.rb' + autoload :ListEnvironmentsResponse, '2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb' + autoload :GalleryImageReferenceFragment, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb' + autoload :ListLabsResponse, '2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb' + autoload :GetPersonalPreferencesResponse, '2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb' + autoload :OperationBatchStatusPayload, '2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb' + autoload :ResourceSetFragment, '2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb' + autoload :OperationBatchStatusResponseItem, '2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb' + autoload :ReferenceVm, '2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb' + autoload :OperationBatchStatusResponse, '2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb' + autoload :ResourceSettingsFragment, '2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb' + autoload :OperationError, '2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb' + autoload :SizeInfoFragment, '2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb' + autoload :OperationMetadataDisplay, '2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb' + autoload :ResetPasswordPayload, '2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb' + autoload :OperationMetadata, '2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb' + autoload :VirtualMachineDetails, '2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb' + autoload :OperationResult, '2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb' + autoload :ResponseWithContinuationEnvironmentSetting, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb' + autoload :OperationStatusPayload, '2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb' + autoload :GalleryImageReference, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb' + autoload :OperationStatusResponse, '2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb' + autoload :EnvironmentOperationsPayload, '2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb' + autoload :PersonalPreferencesOperationsPayload, '2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb' + autoload :GetEnvironmentResponse, '2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb' + autoload :ProviderOperationResult, '2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb' + autoload :SizeInfo, '2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb' + autoload :PublishPayload, '2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb' + autoload :Environment, '2018-10-15/generated/azure_mgmt_labservices/models/environment.rb' + autoload :EnvironmentFragment, '2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb' + autoload :EnvironmentSetting, '2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb' + autoload :EnvironmentSettingFragment, '2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb' + autoload :GalleryImage, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb' + autoload :GalleryImageFragment, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb' + autoload :Lab, '2018-10-15/generated/azure_mgmt_labservices/models/lab.rb' + autoload :LabAccount, '2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb' + autoload :LabAccountFragment, '2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb' + autoload :LabFragment, '2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb' + autoload :User, '2018-10-15/generated/azure_mgmt_labservices/models/user.rb' + autoload :UserFragment, '2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb' + autoload :ManagedLabVmSize, '2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb' + autoload :PublishingState, '2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb' + autoload :ConfigurationState, '2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb' + autoload :LabUserAccessMode, '2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb' + autoload :AddRemove, '2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb' + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb new file mode 100644 index 0000000000..a2a2e11a46 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb @@ -0,0 +1,1254 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class EnvironmentSettings + include MsRestAzure + + # + # Creates and initializes a new instance of the EnvironmentSettings class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # List environment setting in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List environment setting in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List environment setting in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting.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 + + # + # Get environment setting + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EnvironmentSetting] operation results. + # + def get(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get environment setting + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @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, lab_account_name, lab_name, environment_setting_name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get environment setting + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @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, lab_account_name, lab_name, environment_setting_name, expand:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.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 + + # + # Create or replace an existing Environment Setting. This operation can take a + # while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSetting] Represents settings of an + # environment, from which environment instances would be created + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EnvironmentSetting] operation results. + # + def create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSetting] Represents settings of an + # environment, from which environment instances would be created + # @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_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.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 + + # + # Delete environment setting. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers: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 + + # + # Modify properties of environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSettingFragment] Represents settings + # of an environment, from which environment instances would be created + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EnvironmentSetting] operation results. + # + def update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil) + response = update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSettingFragment] Represents settings + # of an environment, from which environment instances would be created + # @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 update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil) + update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value! + end + + # + # Modify properties of environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSettingFragment] Represents settings + # of an environment, from which environment instances would be created + # @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 update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_setting is nil' if environment_setting.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingFragment.mapper() + request_content = @client.serialize(request_mapper, environment_setting) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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 + 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::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.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 + + # + # Claims a random environment for a user in an environment settings + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def claim_any(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = claim_any_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # Claims a random environment for a user in an environment settings + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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 claim_any_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + claim_any_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + end + + # + # Claims a random environment for a user in an environment settings + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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 claim_any_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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? + + result + end + + promise.execute + end + + # + # Provisions/deprovisions required resources for an environment setting based + # on current state of the lab/environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param publish_payload [PublishPayload] Payload for Publish operation on + # EnvironmentSetting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def publish(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:nil) + response = publish_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:custom_headers).value! + nil + end + + # + # Provisions/deprovisions required resources for an environment setting based + # on current state of the lab/environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param publish_payload [PublishPayload] Payload for Publish operation on + # EnvironmentSetting. + # @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 publish_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:nil) + publish_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:custom_headers).value! + end + + # + # Provisions/deprovisions required resources for an environment setting based + # on current state of the lab/environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param publish_payload [PublishPayload] Payload for Publish operation on + # EnvironmentSetting. + # @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 publish_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'publish_payload is nil' if publish_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::PublishPayload.mapper() + request_content = @client.serialize(request_mapper, publish_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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? + + result + end + + promise.execute + end + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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 start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers: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 + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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 stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + # Send request + promise = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers: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 + + # + # Create or replace an existing Environment Setting. This operation can take a + # while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSetting] Represents settings of an + # environment, from which environment instances would be created + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [EnvironmentSetting] operation results. + # + def begin_create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil) + response = begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Environment Setting. This operation can take a + # while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSetting] Represents settings of an + # environment, from which environment instances would be created + # @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_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil) + begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Environment Setting. This operation can take a + # while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_setting [EnvironmentSetting] Represents settings of an + # environment, from which environment instances would be created + # @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_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_setting is nil' if environment_setting.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper() + request_content = @client.serialize(request_mapper, environment_setting) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.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::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.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 + + # + # Delete environment setting. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete environment setting. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + end + + # + # Delete environment setting. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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, lab_account_name, lab_name, environment_setting_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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 == 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 + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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_start_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + end + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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 || status_code == 202 + 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 + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + response = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + nil + end + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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_stop_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil) + begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value! + end + + # + # Starts a template by starting all resources inside the template. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @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_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_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 || status_code == 202 + 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 + + # + # List environment setting in a given lab. + # + # @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 [ResponseWithContinuationEnvironmentSetting] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List environment setting in a given lab. + # + # @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:custom_headers).value! + end + + # + # List environment setting in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting.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 + + # + # List environment setting in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=publishingState)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationEnvironmentSetting] which provide lazy + # access to pages of the response. + # + def list_as_lazy(resource_group_name, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb new file mode 100644 index 0000000000..178075d8db --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb @@ -0,0 +1,1286 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class Environments + include MsRestAzure + + # + # Creates and initializes a new instance of the Environments class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # List environments in a given environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List environments in a given environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List environments in a given environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment.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 + + # + # Get environment + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Environment] operation results. + # + def get(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get environment + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @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, lab_account_name, lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get environment + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @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, lab_account_name, lab_name, environment_setting_name, environment_name, expand:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::Environment.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 + + # + # Create or replace an existing Environment. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param environment [Environment] Represents an environment instance + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Environment] operation results. + # + def create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Environment. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param environment [Environment] Represents an environment instance + # @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 create_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil) + create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Environment. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param environment [Environment] Represents an environment instance + # @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 create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, 'environment is nil' if environment.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper() + request_content = @client.serialize(request_mapper, environment) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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::Labservices::Mgmt::V2018_10_15::Models::Environment.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::Labservices::Mgmt::V2018_10_15::Models::Environment.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 + + # + # Delete environment. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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 + + # + # Modify properties of environments. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param environment [EnvironmentFragment] Represents an environment instance + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Environment] operation results. + # + def update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil) + response = update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of environments. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param environment [EnvironmentFragment] Represents an environment instance + # @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 update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:nil) + update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value! + end + + # + # Modify properties of environments. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param environment [EnvironmentFragment] Represents an environment instance + # @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 update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, 'environment is nil' if environment.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment.mapper() + request_content = @client.serialize(request_mapper, environment) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 + 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::Labservices::Mgmt::V2018_10_15::Models::Environment.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 + + # + # Claims the environment and assigns it to the user + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def claim(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # Claims the environment and assigns it to the user + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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 claim_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + end + + # + # Claims the environment and assigns it to the user + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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 claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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? + + result + end + + promise.execute + end + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil) + response = reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @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 reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil) + # Send request + promise = begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: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 + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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 start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + # Send request + promise = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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 + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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 stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + # Send request + promise = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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 + + # + # Delete environment. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete environment. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + end + + # + # Delete environment. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 == 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 + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil) + response = begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value! + nil + end + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @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_reset_password_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil) + begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value! + end + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @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_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, 'reset_password_payload is nil' if reset_password_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload.mapper() + request_content = @client.serialize(request_mapper, reset_password_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 || status_code == 202 + 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 + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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_start_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + end + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 || status_code == 202 + 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 + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + response = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + nil + end + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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_stop_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil) + begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value! + end + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param environment_name [String] The name of the environment. + # @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_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil? + fail ArgumentError, 'environment_name is nil' if environment_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 || status_code == 202 + 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 + + # + # List environments in a given environment setting. + # + # @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 [ResponseWithContinuationEnvironment] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List environments in a given environment setting. + # + # @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:custom_headers).value! + end + + # + # List environments in a given environment setting. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment.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 + + # + # List environments in a given environment setting. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param environment_setting_name [String] The name of the environment Setting. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=networkInterface)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationEnvironment] which provide lazy access to + # pages of the response. + # + def list_as_lazy(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb new file mode 100644 index 0000000000..79fc98efbe --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb @@ -0,0 +1,672 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class GalleryImages + include MsRestAzure + + # + # Creates and initializes a new instance of the GalleryImages class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # List gallery images in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_account_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List gallery images in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_account_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List gallery images in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/galleryimages' + + 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,'labAccountName' => lab_account_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationGalleryImage.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 + + # + # Get gallery image + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GalleryImage] operation results. + # + def get(resource_group_name, lab_account_name, gallery_image_name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_account_name, gallery_image_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get gallery image + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @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, lab_account_name, gallery_image_name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_account_name, gallery_image_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get gallery image + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @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, lab_account_name, gallery_image_name, expand:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'gallery_image_name is nil' if gallery_image_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}' + + 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,'labAccountName' => lab_account_name,'galleryImageName' => gallery_image_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::GalleryImage.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 + + # + # Create or replace an existing Gallery Image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param gallery_image [GalleryImage] Represents an image from the Azure + # Marketplace + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GalleryImage] operation results. + # + def create_or_update(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Gallery Image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param gallery_image [GalleryImage] Represents an image from the Azure + # Marketplace + # @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 create_or_update_with_http_info(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:nil) + create_or_update_async(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Gallery Image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param gallery_image [GalleryImage] Represents an image from the Azure + # Marketplace + # @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 create_or_update_async(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'gallery_image_name is nil' if gallery_image_name.nil? + fail ArgumentError, 'gallery_image is nil' if gallery_image.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImage.mapper() + request_content = @client.serialize(request_mapper, gallery_image) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}' + + 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,'labAccountName' => lab_account_name,'galleryImageName' => gallery_image_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::Labservices::Mgmt::V2018_10_15::Models::GalleryImage.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::Labservices::Mgmt::V2018_10_15::Models::GalleryImage.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 + + # + # Delete gallery image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def delete(resource_group_name, lab_account_name, gallery_image_name, custom_headers:nil) + response = delete_async(resource_group_name, lab_account_name, gallery_image_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete gallery image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @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 delete_with_http_info(resource_group_name, lab_account_name, gallery_image_name, custom_headers:nil) + delete_async(resource_group_name, lab_account_name, gallery_image_name, custom_headers:custom_headers).value! + end + + # + # Delete gallery image. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @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 delete_async(resource_group_name, lab_account_name, gallery_image_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'gallery_image_name is nil' if gallery_image_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}' + + 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,'labAccountName' => lab_account_name,'galleryImageName' => gallery_image_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 == 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 + + # + # Modify properties of gallery images. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param gallery_image [GalleryImageFragment] Represents an image from the + # Azure Marketplace + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GalleryImage] operation results. + # + def update(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:nil) + response = update_async(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of gallery images. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param gallery_image [GalleryImageFragment] Represents an image from the + # Azure Marketplace + # @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 update_with_http_info(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:nil) + update_async(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers:custom_headers).value! + end + + # + # Modify properties of gallery images. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param gallery_image_name [String] The name of the gallery Image. + # @param gallery_image [GalleryImageFragment] Represents an image from the + # Azure Marketplace + # @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 update_async(resource_group_name, lab_account_name, gallery_image_name, gallery_image, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'gallery_image_name is nil' if gallery_image_name.nil? + fail ArgumentError, 'gallery_image is nil' if gallery_image.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageFragment.mapper() + request_content = @client.serialize(request_mapper, gallery_image) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}' + + 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,'labAccountName' => lab_account_name,'galleryImageName' => gallery_image_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 + 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::Labservices::Mgmt::V2018_10_15::Models::GalleryImage.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 + + # + # List gallery images in a given lab account. + # + # @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 [ResponseWithContinuationGalleryImage] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List gallery images in a given lab account. + # + # @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:custom_headers).value! + end + + # + # List gallery images in a given lab account. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationGalleryImage.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 + + # + # List gallery images in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=author)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationGalleryImage] which provide lazy access to + # pages of the response. + # + def list_as_lazy(resource_group_name, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_account_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb new file mode 100644 index 0000000000..1361459977 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb @@ -0,0 +1,1131 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class GlobalUsers + include MsRestAzure + + # + # Creates and initializes a new instance of the GlobalUsers class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # Gets the virtual machine details + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=environment)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GetEnvironmentResponse] operation results. + # + def get_environment(user_name, environment_operations_payload, expand:nil, custom_headers:nil) + response = get_environment_async(user_name, environment_operations_payload, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the virtual machine details + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=environment)' + # @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_environment_with_http_info(user_name, environment_operations_payload, expand:nil, custom_headers:nil) + get_environment_async(user_name, environment_operations_payload, expand:expand, custom_headers:custom_headers).value! + end + + # + # Gets the virtual machine details + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=environment)' + # @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_environment_async(user_name, environment_operations_payload, expand:nil, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'environment_operations_payload is nil' if environment_operations_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload.mapper() + request_content = @client.serialize(request_mapper, environment_operations_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/getEnvironment' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::GetEnvironmentResponse.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 + + # + # Get batch operation status + # + # @param user_name [String] The name of the user. + # @param operation_batch_status_payload [OperationBatchStatusPayload] Payload + # to get the status of an operation + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationBatchStatusResponse] operation results. + # + def get_operation_batch_status(user_name, operation_batch_status_payload, custom_headers:nil) + response = get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get batch operation status + # + # @param user_name [String] The name of the user. + # @param operation_batch_status_payload [OperationBatchStatusPayload] Payload + # to get the status of an 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 get_operation_batch_status_with_http_info(user_name, operation_batch_status_payload, custom_headers:nil) + get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers:custom_headers).value! + end + + # + # Get batch operation status + # + # @param user_name [String] The name of the user. + # @param operation_batch_status_payload [OperationBatchStatusPayload] Payload + # to get the status of an 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 get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'operation_batch_status_payload is nil' if operation_batch_status_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusPayload.mapper() + request_content = @client.serialize(request_mapper, operation_batch_status_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponse.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 status of long running operation + # + # @param user_name [String] The name of the user. + # @param operation_status_payload [OperationStatusPayload] Payload to get the + # status of an operation + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationStatusResponse] operation results. + # + def get_operation_status(user_name, operation_status_payload, custom_headers:nil) + response = get_operation_status_async(user_name, operation_status_payload, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Gets the status of long running operation + # + # @param user_name [String] The name of the user. + # @param operation_status_payload [OperationStatusPayload] Payload to get the + # status of an 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 get_operation_status_with_http_info(user_name, operation_status_payload, custom_headers:nil) + get_operation_status_async(user_name, operation_status_payload, custom_headers:custom_headers).value! + end + + # + # Gets the status of long running operation + # + # @param user_name [String] The name of the user. + # @param operation_status_payload [OperationStatusPayload] Payload to get the + # status of an 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 get_operation_status_async(user_name, operation_status_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'operation_status_payload is nil' if operation_status_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusPayload.mapper() + request_content = @client.serialize(request_mapper, operation_status_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/getOperationStatus' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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::Labservices::Mgmt::V2018_10_15::Models::OperationStatusResponse.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 + + # + # Get personal preferences for a user + # + # @param user_name [String] The name of the user. + # @param personal_preferences_operations_payload + # [PersonalPreferencesOperationsPayload] Represents payload for any Environment + # operations like get, start, stop, connect + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GetPersonalPreferencesResponse] operation results. + # + def get_personal_preferences(user_name, personal_preferences_operations_payload, custom_headers:nil) + response = get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get personal preferences for a user + # + # @param user_name [String] The name of the user. + # @param personal_preferences_operations_payload + # [PersonalPreferencesOperationsPayload] Represents payload for any Environment + # operations like get, start, stop, connect + # @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_personal_preferences_with_http_info(user_name, personal_preferences_operations_payload, custom_headers:nil) + get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:custom_headers).value! + end + + # + # Get personal preferences for a user + # + # @param user_name [String] The name of the user. + # @param personal_preferences_operations_payload + # [PersonalPreferencesOperationsPayload] Represents payload for any Environment + # operations like get, start, stop, connect + # @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_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'personal_preferences_operations_payload is nil' if personal_preferences_operations_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::PersonalPreferencesOperationsPayload.mapper() + request_content = @client.serialize(request_mapper, personal_preferences_operations_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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::Labservices::Mgmt::V2018_10_15::Models::GetPersonalPreferencesResponse.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 + + # + # List Environments for the user + # + # @param user_name [String] The name of the user. + # @param list_environments_payload [ListEnvironmentsPayload] Represents the + # payload to list environments owned by a user + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ListEnvironmentsResponse] operation results. + # + def list_environments(user_name, list_environments_payload, custom_headers:nil) + response = list_environments_async(user_name, list_environments_payload, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List Environments for the user + # + # @param user_name [String] The name of the user. + # @param list_environments_payload [ListEnvironmentsPayload] Represents the + # payload to list environments owned by a user + # @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_environments_with_http_info(user_name, list_environments_payload, custom_headers:nil) + list_environments_async(user_name, list_environments_payload, custom_headers:custom_headers).value! + end + + # + # List Environments for the user + # + # @param user_name [String] The name of the user. + # @param list_environments_payload [ListEnvironmentsPayload] Represents the + # payload to list environments owned by a user + # @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_environments_async(user_name, list_environments_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'list_environments_payload is nil' if list_environments_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsPayload.mapper() + request_content = @client.serialize(request_mapper, list_environments_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/listEnvironments' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsResponse.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 + + # + # List labs for the user. + # + # @param user_name [String] The name of the user. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ListLabsResponse] operation results. + # + def list_labs(user_name, custom_headers:nil) + response = list_labs_async(user_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List labs for the user. + # + # @param user_name [String] The name of the user. + # @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_labs_with_http_info(user_name, custom_headers:nil) + list_labs_async(user_name, custom_headers:custom_headers).value! + end + + # + # List labs for the user. + # + # @param user_name [String] The name of the user. + # @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_labs_async(user_name, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/users/{userName}/listLabs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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::Labservices::Mgmt::V2018_10_15::Models::ListLabsResponse.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 + + # + # Register a user to a managed lab + # + # @param user_name [String] The name of the user. + # @param register_payload [RegisterPayload] Represents payload for Register + # action. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def register(user_name, register_payload, custom_headers:nil) + response = register_async(user_name, register_payload, custom_headers:custom_headers).value! + nil + end + + # + # Register a user to a managed lab + # + # @param user_name [String] The name of the user. + # @param register_payload [RegisterPayload] Represents payload for Register + # action. + # @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 register_with_http_info(user_name, register_payload, custom_headers:nil) + register_async(user_name, register_payload, custom_headers:custom_headers).value! + end + + # + # Register a user to a managed lab + # + # @param user_name [String] The name of the user. + # @param register_payload [RegisterPayload] Represents payload for Register + # action. + # @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 register_async(user_name, register_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'register_payload is nil' if register_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::RegisterPayload.mapper() + request_content = @client.serialize(request_mapper, register_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/register' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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? + + result + end + + promise.execute + end + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param user_name [String] The name of the user. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def reset_password(user_name, reset_password_payload, custom_headers:nil) + response = reset_password_async(user_name, reset_password_payload, custom_headers:custom_headers).value! + nil + end + + # + # @param user_name [String] The name of the user. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @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 reset_password_async(user_name, reset_password_payload, custom_headers:nil) + # Send request + promise = begin_reset_password_async(user_name, reset_password_payload, custom_headers: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 + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def start_environment(user_name, environment_operations_payload, custom_headers:nil) + response = start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! + nil + end + + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @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 start_environment_async(user_name, environment_operations_payload, custom_headers:nil) + # Send request + promise = begin_start_environment_async(user_name, environment_operations_payload, custom_headers: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 + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def stop_environment(user_name, environment_operations_payload, custom_headers:nil) + response = stop_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! + nil + end + + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @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 stop_environment_async(user_name, environment_operations_payload, custom_headers:nil) + # Send request + promise = begin_stop_environment_async(user_name, environment_operations_payload, custom_headers: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 + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param user_name [String] The name of the user. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_reset_password(user_name, reset_password_payload, custom_headers:nil) + response = begin_reset_password_async(user_name, reset_password_payload, custom_headers:custom_headers).value! + nil + end + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param user_name [String] The name of the user. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @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_reset_password_with_http_info(user_name, reset_password_payload, custom_headers:nil) + begin_reset_password_async(user_name, reset_password_payload, custom_headers:custom_headers).value! + end + + # + # Resets the user password on an environment This operation can take a while to + # complete + # + # @param user_name [String] The name of the user. + # @param reset_password_payload [ResetPasswordPayload] Represents the payload + # for resetting passwords. + # @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_reset_password_async(user_name, reset_password_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'reset_password_payload is nil' if reset_password_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload.mapper() + request_content = @client.serialize(request_mapper, reset_password_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/resetPassword' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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 || status_code == 202 + 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 + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_start_environment(user_name, environment_operations_payload, custom_headers:nil) + response = begin_start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! + nil + end + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @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_start_environment_with_http_info(user_name, environment_operations_payload, custom_headers:nil) + begin_start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! + end + + # + # Starts an environment by starting all resources inside the environment. This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @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_start_environment_async(user_name, environment_operations_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'environment_operations_payload is nil' if environment_operations_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload.mapper() + request_content = @client.serialize(request_mapper, environment_operations_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/startEnvironment' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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 || status_code == 202 + 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 + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_stop_environment(user_name, environment_operations_payload, custom_headers:nil) + response = begin_stop_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! + nil + end + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @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_stop_environment_with_http_info(user_name, environment_operations_payload, custom_headers:nil) + begin_stop_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! + end + + # + # Stops an environment by stopping all resources inside the environment This + # operation can take a while to complete + # + # @param user_name [String] The name of the user. + # @param environment_operations_payload [EnvironmentOperationsPayload] + # Represents payload for any Environment operations like get, start, stop, + # connect + # @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_stop_environment_async(user_name, environment_operations_payload, custom_headers:nil) + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'environment_operations_payload is nil' if environment_operations_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload.mapper() + request_content = @client.serialize(request_mapper, environment_operations_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'providers/Microsoft.LabServices/users/{userName}/stopEnvironment' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'userName' => user_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 || status_code == 202 + 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 + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb new file mode 100644 index 0000000000..530afa78bc --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb @@ -0,0 +1,1093 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class LabAccounts + include MsRestAzure + + # + # Creates and initializes a new instance of the LabAccounts class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # List lab accounts in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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_subscription(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_by_subscription_as_lazy(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List lab accounts in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List lab accounts in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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_subscription_async(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts' + + 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: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.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 + + # + # List lab accounts in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List lab accounts in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List lab accounts in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts' + + 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: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.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 + + # + # Get lab account + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabAccount] operation results. + # + def get(resource_group_name, lab_account_name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_account_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get lab account + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @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, lab_account_name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_account_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get lab account + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @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, lab_account_name, expand:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}' + + 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,'labAccountName' => lab_account_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::LabAccount.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 + + # + # Create or replace an existing Lab Account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_account [LabAccount] Represents a lab account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabAccount] operation results. + # + def create_or_update(resource_group_name, lab_account_name, lab_account, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Lab Account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_account [LabAccount] Represents a lab account. + # @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 create_or_update_with_http_info(resource_group_name, lab_account_name, lab_account, custom_headers:nil) + create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Lab Account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_account [LabAccount] Represents a lab account. + # @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 create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_account is nil' if lab_account.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount.mapper() + request_content = @client.serialize(request_mapper, lab_account) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}' + + 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,'labAccountName' => lab_account_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::Labservices::Mgmt::V2018_10_15::Models::LabAccount.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::Labservices::Mgmt::V2018_10_15::Models::LabAccount.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 + + # + # Delete lab account. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_account_name, custom_headers:nil) + response = delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @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, lab_account_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_account_name, custom_headers: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 + + # + # Modify properties of lab accounts. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_account [LabAccountFragment] Represents a lab account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [LabAccount] operation results. + # + def update(resource_group_name, lab_account_name, lab_account, custom_headers:nil) + response = update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of lab accounts. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_account [LabAccountFragment] Represents a lab account. + # @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 update_with_http_info(resource_group_name, lab_account_name, lab_account, custom_headers:nil) + update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value! + end + + # + # Modify properties of lab accounts. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_account [LabAccountFragment] Represents a lab account. + # @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 update_async(resource_group_name, lab_account_name, lab_account, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_account is nil' if lab_account.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccountFragment.mapper() + request_content = @client.serialize(request_mapper, lab_account) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}' + + 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,'labAccountName' => lab_account_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 + 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::Labservices::Mgmt::V2018_10_15::Models::LabAccount.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 + + # + # Create a lab in a lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param create_lab_properties [CreateLabProperties] Properties for creating a + # managed lab and a default environment setting + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def create_lab(resource_group_name, lab_account_name, create_lab_properties, custom_headers:nil) + response = create_lab_async(resource_group_name, lab_account_name, create_lab_properties, custom_headers:custom_headers).value! + nil + end + + # + # Create a lab in a lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param create_lab_properties [CreateLabProperties] Properties for creating a + # managed lab and a default environment setting + # @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 create_lab_with_http_info(resource_group_name, lab_account_name, create_lab_properties, custom_headers:nil) + create_lab_async(resource_group_name, lab_account_name, create_lab_properties, custom_headers:custom_headers).value! + end + + # + # Create a lab in a lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param create_lab_properties [CreateLabProperties] Properties for creating a + # managed lab and a default environment setting + # @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 create_lab_async(resource_group_name, lab_account_name, create_lab_properties, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'create_lab_properties is nil' if create_lab_properties.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::CreateLabProperties.mapper() + request_content = @client.serialize(request_mapper, create_lab_properties) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/createLab' + + 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,'labAccountName' => lab_account_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? + + result + end + + promise.execute + end + + # + # Get regional availability information for each size category configured under + # a lab account + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [GetRegionalAvailabilityResponse] operation results. + # + def get_regional_availability(resource_group_name, lab_account_name, custom_headers:nil) + response = get_regional_availability_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get regional availability information for each size category configured under + # a lab account + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @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_regional_availability_with_http_info(resource_group_name, lab_account_name, custom_headers:nil) + get_regional_availability_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value! + end + + # + # Get regional availability information for each size category configured under + # a lab account + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @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_regional_availability_async(resource_group_name, lab_account_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/getRegionalAvailability' + + 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,'labAccountName' => lab_account_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::Labservices::Mgmt::V2018_10_15::Models::GetRegionalAvailabilityResponse.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 + + # + # Delete lab account. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @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, lab_account_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete lab account. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @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, lab_account_name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value! + end + + # + # Delete lab account. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @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, lab_account_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}' + + 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,'labAccountName' => lab_account_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 == 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 + + # + # List lab accounts in a 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 [ResponseWithContinuationLabAccount] operation results. + # + def list_by_subscription_next(next_page_link, custom_headers:nil) + response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List lab accounts in a 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_by_subscription_next_with_http_info(next_page_link, custom_headers:nil) + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value! + end + + # + # List lab accounts in a 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_by_subscription_next_async(next_page_link, custom_headers:nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.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 + + # + # List lab accounts in a 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 [ResponseWithContinuationLabAccount] 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:custom_headers).value! + response.body unless response.nil? + end + + # + # List lab accounts in a 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:custom_headers).value! + end + + # + # List lab accounts in a 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.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 + + # + # List lab accounts in a subscription. + # + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationLabAccount] which provide lazy access to + # pages of the response. + # + def list_by_subscription_as_lazy(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_subscription_next_async(next_page_link, custom_headers:custom_headers) + end + page + end + end + + # + # List lab accounts in a resource group. + # + # @param resource_group_name [String] The name of the resource group. + # @param expand [String] Specify the $expand query. Example: + # 'properties($expand=sizeConfiguration)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationLabAccount] which provide lazy access to + # pages of the response. + # + def list_by_resource_group_as_lazy(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb new file mode 100644 index 0000000000..11025a6536 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb @@ -0,0 +1,890 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class Labs + include MsRestAzure + + # + # Creates and initializes a new instance of the Labs class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # List labs in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_account_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List labs in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_account_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List labs in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs' + + 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,'labAccountName' => lab_account_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLab.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 + + # + # Get lab + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def get(resource_group_name, lab_account_name, lab_name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_account_name, lab_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get lab + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @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, lab_account_name, lab_name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_account_name, lab_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get lab + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @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, lab_account_name, lab_name, expand:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::Lab.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 + + # + # Create or replace an existing Lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param lab [Lab] Represents a lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def create_or_update(resource_group_name, lab_account_name, lab_name, lab, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_account_name, lab_name, lab, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing Lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param lab [Lab] Represents a lab. + # @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 create_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, lab, custom_headers:nil) + create_or_update_async(resource_group_name, lab_account_name, lab_name, lab, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing Lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param lab [Lab] Represents a lab. + # @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 create_or_update_async(resource_group_name, lab_account_name, lab_name, lab, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'lab is nil' if lab.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Lab.mapper() + request_content = @client.serialize(request_mapper, lab) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_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::Labservices::Mgmt::V2018_10_15::Models::Lab.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::Labservices::Mgmt::V2018_10_15::Models::Lab.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 + + # + # Delete lab. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_account_name, lab_name, custom_headers:nil) + response = delete_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @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, lab_account_name, lab_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_account_name, lab_name, custom_headers: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 + + # + # Modify properties of labs. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param lab [LabFragment] Represents a lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Lab] operation results. + # + def update(resource_group_name, lab_account_name, lab_name, lab, custom_headers:nil) + response = update_async(resource_group_name, lab_account_name, lab_name, lab, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of labs. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param lab [LabFragment] Represents a lab. + # @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 update_with_http_info(resource_group_name, lab_account_name, lab_name, lab, custom_headers:nil) + update_async(resource_group_name, lab_account_name, lab_name, lab, custom_headers:custom_headers).value! + end + + # + # Modify properties of labs. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param lab [LabFragment] Represents a lab. + # @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 update_async(resource_group_name, lab_account_name, lab_name, lab, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'lab is nil' if lab.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabFragment.mapper() + request_content = @client.serialize(request_mapper, lab) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_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 + 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::Labservices::Mgmt::V2018_10_15::Models::Lab.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 + + # + # Add users to a lab + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param add_users_payload [AddUsersPayload] Payload for Add Users operation on + # a Lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def add_users(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:nil) + response = add_users_async(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:custom_headers).value! + nil + end + + # + # Add users to a lab + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param add_users_payload [AddUsersPayload] Payload for Add Users operation on + # a Lab. + # @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 add_users_with_http_info(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:nil) + add_users_async(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:custom_headers).value! + end + + # + # Add users to a lab + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param add_users_payload [AddUsersPayload] Payload for Add Users operation on + # a Lab. + # @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 add_users_async(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'add_users_payload is nil' if add_users_payload.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::AddUsersPayload.mapper() + request_content = @client.serialize(request_mapper, add_users_payload) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/addUsers' + + 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,'labAccountName' => lab_account_name,'labName' => lab_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? + + result + end + + promise.execute + end + + # + # Register to managed lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def register(resource_group_name, lab_account_name, lab_name, custom_headers:nil) + response = register_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! + nil + end + + # + # Register to managed lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @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 register_with_http_info(resource_group_name, lab_account_name, lab_name, custom_headers:nil) + register_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! + end + + # + # Register to managed lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @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 register_async(resource_group_name, lab_account_name, lab_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/register' + + 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,'labAccountName' => lab_account_name,'labName' => lab_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? + + result + end + + promise.execute + end + + # + # Delete lab. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @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, lab_account_name, lab_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete lab. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @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, lab_account_name, lab_name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! + end + + # + # Delete lab. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @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, lab_account_name, lab_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_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 == 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 + + # + # List labs in a given lab account. + # + # @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 [ResponseWithContinuationLab] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List labs in a given lab account. + # + # @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:custom_headers).value! + end + + # + # List labs in a given lab account. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLab.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 + + # + # List labs in a given lab account. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=maxUsersInLab)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationLab] which provide lazy access to pages of + # the response. + # + def list_as_lazy(resource_group_name, lab_account_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_account_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb new file mode 100644 index 0000000000..b73b76603d --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb @@ -0,0 +1,163 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # A service client - single point of access to the REST API. + # + class ManagedLabsClient < 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] Client API version. + attr_reader :api_version + + # @return [String] The subscription ID. + attr_accessor :subscription_id + + # @return [String] The preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] The retry timeout in seconds for Long Running + # Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] Whether a unique x-ms-client-request-id should be + # generated. 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 [ProviderOperations] provider_operations + attr_reader :provider_operations + + # @return [GlobalUsers] global_users + attr_reader :global_users + + # @return [LabAccounts] lab_accounts + attr_reader :lab_accounts + + # @return [Operations] operations + attr_reader :operations + + # @return [GalleryImages] gallery_images + attr_reader :gallery_images + + # @return [Labs] labs + attr_reader :labs + + # @return [EnvironmentSettings] environment_settings + attr_reader :environment_settings + + # @return [Environments] environments + attr_reader :environments + + # @return [Users] users + attr_reader :users + + # + # Creates initializes a new instance of the ManagedLabsClient 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 + + @provider_operations = ProviderOperations.new(self) + @global_users = GlobalUsers.new(self) + @lab_accounts = LabAccounts.new(self) + @operations = Operations.new(self) + @gallery_images = GalleryImages.new(self) + @labs = Labs.new(self) + @environment_settings = EnvironmentSettings.new(self) + @environments = Environments.new(self) + @users = Users.new(self) + @api_version = '2018-10-15' + @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 + if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) + @request_headers['Content-Type'] = options[:headers]['Content-Type'] + end + + 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_labservices' + sdk_information = "#{sdk_information}/0.17.0" + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb new file mode 100644 index 0000000000..6a5f49e4c0 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_remove.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Defines values for AddRemove + # + module AddRemove + Add = "Add" + Remove = "Remove" + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb new file mode 100644 index 0000000000..03a690cf11 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb @@ -0,0 +1,55 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Payload for Add Users operation on a Lab. + # + class AddUsersPayload + + include MsRestAzure + + # @return [Array] List of user emails addresses to add to the + # lab. + attr_accessor :email_addresses + + + # + # Mapper for AddUsersPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'AddUsersPayload', + type: { + name: 'Composite', + class_name: 'AddUsersPayload', + model_properties: { + email_addresses: { + client_side_validation: true, + required: true, + serialized_name: 'emailAddresses', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb new file mode 100644 index 0000000000..6fb1a74a82 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Defines values for ConfigurationState + # + module ConfigurationState + NotApplicable = "NotApplicable" + Completed = "Completed" + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb new file mode 100644 index 0000000000..b0d47bde04 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb @@ -0,0 +1,101 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Properties for creating a managed lab and a default environment setting + # + class CreateLabProperties + + include MsRestAzure + + # @return [EnvironmentSettingCreationParameters] Settings related to + # creating an environment setting + attr_accessor :environment_setting_creation_parameters + + # @return [LabCreationParameters] Settings related to creating a lab + attr_accessor :lab_creation_parameters + + # @return [String] The name of the resource + attr_accessor :name + + # @return [String] The location of the resource + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # + # Mapper for CreateLabProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'CreateLabProperties', + type: { + name: 'Composite', + class_name: 'CreateLabProperties', + model_properties: { + environment_setting_creation_parameters: { + client_side_validation: true, + required: false, + serialized_name: 'environmentSettingCreationParameters', + type: { + name: 'Composite', + class_name: 'EnvironmentSettingCreationParameters' + } + }, + lab_creation_parameters: { + client_side_validation: true, + required: true, + serialized_name: 'labCreationParameters', + type: { + name: 'Composite', + class_name: 'LabCreationParameters' + } + }, + name: { + client_side_validation: true, + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment.rb new file mode 100644 index 0000000000..554d39885e --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment.rb @@ -0,0 +1,235 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents an environment instance + # + class Environment < Resource + + include MsRestAzure + + # @return [ResourceSet] The set of a VM and the setting id it was created + # for + attr_accessor :resource_sets + + # @return [String] The AAD object Id of the user who has claimed the + # environment + attr_accessor :claimed_by_user_object_id + + # @return [String] The user principal Id of the user who has claimed the + # environment + attr_accessor :claimed_by_user_principal_id + + # @return [String] The name or email address of the user who has claimed + # the environment + attr_accessor :claimed_by_user_name + + # @return [Boolean] Is the environment claimed or not + attr_accessor :is_claimed + + # @return [String] Last known power state of the environment + attr_accessor :last_known_power_state + + # @return [NetworkInterface] Network details of the environment + attr_accessor :network_interface + + # @return [Duration] How long the environment has been used by a lab user + attr_accessor :total_usage + + # @return [DateTime] When the password was last reset on the environment. + attr_accessor :password_last_reset + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + + # + # Mapper for Environment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Environment', + type: { + name: 'Composite', + class_name: 'Environment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource_sets: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceSets', + type: { + name: 'Composite', + class_name: 'ResourceSet' + } + }, + claimed_by_user_object_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.claimedByUserObjectId', + type: { + name: 'String' + } + }, + claimed_by_user_principal_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.claimedByUserPrincipalId', + type: { + name: 'String' + } + }, + claimed_by_user_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.claimedByUserName', + type: { + name: 'String' + } + }, + is_claimed: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.isClaimed', + type: { + name: 'Boolean' + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.lastKnownPowerState', + type: { + name: 'String' + } + }, + network_interface: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.networkInterface', + type: { + name: 'Composite', + class_name: 'NetworkInterface' + } + }, + total_usage: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.totalUsage', + type: { + name: 'TimeSpan' + } + }, + password_last_reset: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.passwordLastReset', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb new file mode 100644 index 0000000000..7d021269ec --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb @@ -0,0 +1,149 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # This represents the details about a User's environment and its state. + # + class EnvironmentDetails + + include MsRestAzure + + # @return [String] Name of the Environment + attr_accessor :name + + # @return [String] Description of the Environment + attr_accessor :description + + # @return [String] Resource Id of the environment + attr_accessor :id + + # @return [String] The provisioning state of the environment. This also + # includes LabIsFull and NotYetProvisioned status. + attr_accessor :provisioning_state + + # @return [VirtualMachineDetails] Details of backing DTL virtual machine + # with compute and network details. + attr_accessor :virtual_machine_details + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + # @return [String] Publishing state of the environment setting Possible + # values are Creating, Created, Failed + attr_accessor :environment_state + + # @return [Duration] How long the environment has been used by a lab user + attr_accessor :total_usage + + # @return [DateTime] When the password was last reset on the environment. + attr_accessor :password_last_reset + + + # + # Mapper for EnvironmentDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentDetails', + type: { + name: 'Composite', + class_name: 'EnvironmentDetails', + model_properties: { + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'description', + type: { + name: 'String' + } + }, + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + virtual_machine_details: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'virtualMachineDetails', + type: { + name: 'Composite', + class_name: 'VirtualMachineDetails' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + }, + environment_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'environmentState', + type: { + name: 'String' + } + }, + total_usage: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'totalUsage', + type: { + name: 'TimeSpan' + } + }, + password_last_reset: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'passwordLastReset', + type: { + name: 'DateTime' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb new file mode 100644 index 0000000000..fc4130b163 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb @@ -0,0 +1,121 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents an environment instance + # + class EnvironmentFragment < Resource + + include MsRestAzure + + # @return [ResourceSetFragment] The set of a VM and the setting id it was + # created for + attr_accessor :resource_sets + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for EnvironmentFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentFragment', + type: { + name: 'Composite', + class_name: 'EnvironmentFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + resource_sets: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceSets', + type: { + name: 'Composite', + class_name: 'ResourceSetFragment' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb new file mode 100644 index 0000000000..bfdbec84cc --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents payload for any Environment operations like get, start, stop, + # connect + # + class EnvironmentOperationsPayload + + include MsRestAzure + + # @return [String] The resourceId of the environment + attr_accessor :environment_id + + + # + # Mapper for EnvironmentOperationsPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentOperationsPayload', + type: { + name: 'Composite', + class_name: 'EnvironmentOperationsPayload', + model_properties: { + environment_id: { + client_side_validation: true, + required: true, + serialized_name: 'environmentId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb new file mode 100644 index 0000000000..af46d8344c --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb @@ -0,0 +1,210 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents settings of an environment, from which environment instances + # would be created + # + class EnvironmentSetting < Resource + + include MsRestAzure + + # @return [PublishingState] Describes the readiness of this environment + # setting. Possible values include: 'Draft', 'Publishing', 'Published', + # 'PublishFailed', 'Scaling' + attr_accessor :publishing_state + + # @return [ConfigurationState] Describes the user's progress in + # configuring their environment setting. Possible values include: + # 'NotApplicable', 'Completed' + attr_accessor :configuration_state + + # @return [String] Describes the environment and its resource settings + attr_accessor :description + + # @return [String] Brief title describing the environment and its + # resource settings + attr_accessor :title + + # @return [ResourceSettings] The resource specific settings + attr_accessor :resource_settings + + # @return [DateTime] Time when the template VM was last changed. + attr_accessor :last_changed + + # @return [DateTime] Time when the template VM was last sent for + # publishing. + attr_accessor :last_published + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + + # + # Mapper for EnvironmentSetting class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSetting', + type: { + name: 'Composite', + class_name: 'EnvironmentSetting', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + publishing_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.publishingState', + type: { + name: 'String' + } + }, + configuration_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.configurationState', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + title: { + client_side_validation: true, + required: false, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + resource_settings: { + client_side_validation: true, + required: true, + serialized_name: 'properties.resourceSettings', + type: { + name: 'Composite', + class_name: 'ResourceSettings' + } + }, + last_changed: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.lastChanged', + type: { + name: 'DateTime' + } + }, + last_published: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.lastPublished', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb new file mode 100644 index 0000000000..0ca2d20ebe --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Settings related to creating an environment setting + # + class EnvironmentSettingCreationParameters + + include MsRestAzure + + # @return [ResourceSettingCreationParameters] The resource specific + # settings + attr_accessor :resource_setting_creation_parameters + + + # + # Mapper for EnvironmentSettingCreationParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSettingCreationParameters', + type: { + name: 'Composite', + class_name: 'EnvironmentSettingCreationParameters', + model_properties: { + resource_setting_creation_parameters: { + client_side_validation: true, + required: true, + serialized_name: 'resourceSettingCreationParameters', + type: { + name: 'Composite', + class_name: 'ResourceSettingCreationParameters' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb new file mode 100644 index 0000000000..5dfec2f777 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb @@ -0,0 +1,157 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents settings of an environment, from which environment instances + # would be created + # + class EnvironmentSettingFragment < Resource + + include MsRestAzure + + # @return [ConfigurationState] Describes the user's progress in + # configuring their environment setting. Possible values include: + # 'NotApplicable', 'Completed' + attr_accessor :configuration_state + + # @return [String] Describes the environment and its resource settings + attr_accessor :description + + # @return [String] Brief title describing the environment and its + # resource settings + attr_accessor :title + + # @return [ResourceSettingsFragment] The resource specific settings + attr_accessor :resource_settings + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for EnvironmentSettingFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSettingFragment', + type: { + name: 'Composite', + class_name: 'EnvironmentSettingFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + configuration_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.configurationState', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + title: { + client_side_validation: true, + required: false, + serialized_name: 'properties.title', + type: { + name: 'String' + } + }, + resource_settings: { + client_side_validation: true, + required: false, + serialized_name: 'properties.resourceSettings', + type: { + name: 'Composite', + class_name: 'ResourceSettingsFragment' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb new file mode 100644 index 0000000000..e1da5a8764 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb @@ -0,0 +1,110 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a size category supported by this Lab Account (small, medium + # or large) + # + class EnvironmentSize + + include MsRestAzure + + # @return [ManagedLabVmSize] The size category. Possible values include: + # 'Basic', 'Standard', 'Performance' + attr_accessor :name + + # @return [Array] Represents a set of compute sizes that can + # serve this given size type + attr_accessor :vm_sizes + + # @return The pay-as-you-go dollar price per hour this size will cost. It + # does not include discounts and may not reflect the actual price the + # size will cost. This is the maximum price of all prices within this + # tier. + attr_accessor :max_price + + # @return [Integer] The number of cores a VM of this size has. This is + # the minimum number of cores within this tier. + attr_accessor :min_number_of_cores + + # @return [Float] The amount of memory available (in GB). This is the + # minimum amount of memory within this tier. + attr_accessor :min_memory + + + # + # Mapper for EnvironmentSize class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSize', + type: { + name: 'Composite', + class_name: 'EnvironmentSize', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + vm_sizes: { + client_side_validation: true, + required: false, + serialized_name: 'vmSizes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SizeInfoElementType', + type: { + name: 'Composite', + class_name: 'SizeInfo' + } + } + } + }, + max_price: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'maxPrice', + type: { + name: 'Number' + } + }, + min_number_of_cores: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minNumberOfCores', + type: { + name: 'Number' + } + }, + min_memory: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'minMemory', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb new file mode 100644 index 0000000000..ef0adb5087 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb @@ -0,0 +1,69 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a size category supported by this Lab Account (small, medium + # or large) + # + class EnvironmentSizeFragment + + include MsRestAzure + + # @return [ManagedLabVmSize] The size category. Possible values include: + # 'Basic', 'Standard', 'Performance' + attr_accessor :name + + # @return [Array] Represents a set of compute sizes + # that can serve this given size type + attr_accessor :vm_sizes + + + # + # Mapper for EnvironmentSizeFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSizeFragment', + type: { + name: 'Composite', + class_name: 'EnvironmentSizeFragment', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + vm_sizes: { + client_side_validation: true, + required: false, + serialized_name: 'vmSizes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SizeInfoFragmentElementType', + type: { + name: 'Composite', + class_name: 'SizeInfoFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb new file mode 100644 index 0000000000..114c9e2bf2 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb @@ -0,0 +1,231 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents an image from the Azure Marketplace + # + class GalleryImage < Resource + + include MsRestAzure + + # @return [String] The author of the gallery image. + attr_accessor :author + + # @return [DateTime] The creation date of the gallery image. + attr_accessor :created_date + + # @return [String] The description of the gallery image. + attr_accessor :description + + # @return [GalleryImageReference] The image reference of the gallery + # image. + attr_accessor :image_reference + + # @return [String] The icon of the gallery image. + attr_accessor :icon + + # @return [Boolean] Indicates whether this gallery image is enabled. + attr_accessor :is_enabled + + # @return [Boolean] Indicates whether this gallery has been overridden + # for this lab account + attr_accessor :is_override + + # @return [String] The third party plan that applies to this image + attr_accessor :plan_id + + # @return [Boolean] Indicates if the plan has been authorized for + # programmatic deployment. + attr_accessor :is_plan_authorized + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + + # + # Mapper for GalleryImage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImage', + type: { + name: 'Composite', + class_name: 'GalleryImage', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + author: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.author', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + description: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.description', + type: { + name: 'String' + } + }, + image_reference: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.imageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReference' + } + }, + icon: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.icon', + type: { + name: 'String' + } + }, + is_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isEnabled', + type: { + name: 'Boolean' + } + }, + is_override: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isOverride', + type: { + name: 'Boolean' + } + }, + plan_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.planId', + type: { + name: 'String' + } + }, + is_plan_authorized: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isPlanAuthorized', + type: { + name: 'Boolean' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb new file mode 100644 index 0000000000..ac109f0c83 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb @@ -0,0 +1,143 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents an image from the Azure Marketplace + # + class GalleryImageFragment < Resource + + include MsRestAzure + + # @return [Boolean] Indicates whether this gallery image is enabled. + attr_accessor :is_enabled + + # @return [Boolean] Indicates whether this gallery has been overridden + # for this lab account + attr_accessor :is_override + + # @return [Boolean] Indicates if the plan has been authorized for + # programmatic deployment. + attr_accessor :is_plan_authorized + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for GalleryImageFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageFragment', + type: { + name: 'Composite', + class_name: 'GalleryImageFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + is_enabled: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isEnabled', + type: { + name: 'Boolean' + } + }, + is_override: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isOverride', + type: { + name: 'Boolean' + } + }, + is_plan_authorized: { + client_side_validation: true, + required: false, + serialized_name: 'properties.isPlanAuthorized', + type: { + name: 'Boolean' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb new file mode 100644 index 0000000000..fb5978d9da --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb @@ -0,0 +1,90 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The reference information for an Azure Marketplace image. + # + class GalleryImageReference + + include MsRestAzure + + # @return [String] The offer of the gallery image. + attr_accessor :offer + + # @return [String] The publisher of the gallery image. + attr_accessor :publisher + + # @return [String] The SKU of the gallery image. + attr_accessor :sku + + # @return [String] The OS type of the gallery image. + attr_accessor :os_type + + # @return [String] The version of the gallery image. + attr_accessor :version + + + # + # Mapper for GalleryImageReference class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageReference', + type: { + name: 'Composite', + class_name: 'GalleryImageReference', + model_properties: { + offer: { + client_side_validation: true, + required: false, + serialized_name: 'offer', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + serialized_name: 'publisher', + type: { + name: 'String' + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb new file mode 100644 index 0000000000..0eb7425420 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb @@ -0,0 +1,90 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The reference information for an Azure Marketplace image. + # + class GalleryImageReferenceFragment + + include MsRestAzure + + # @return [String] The offer of the gallery image. + attr_accessor :offer + + # @return [String] The publisher of the gallery image. + attr_accessor :publisher + + # @return [String] The SKU of the gallery image. + attr_accessor :sku + + # @return [String] The OS type of the gallery image. + attr_accessor :os_type + + # @return [String] The version of the gallery image. + attr_accessor :version + + + # + # Mapper for GalleryImageReferenceFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageReferenceFragment', + type: { + name: 'Composite', + class_name: 'GalleryImageReferenceFragment', + model_properties: { + offer: { + client_side_validation: true, + required: false, + serialized_name: 'offer', + type: { + name: 'String' + } + }, + publisher: { + client_side_validation: true, + required: false, + serialized_name: 'publisher', + type: { + name: 'String' + } + }, + sku: { + client_side_validation: true, + required: false, + serialized_name: 'sku', + type: { + name: 'String' + } + }, + os_type: { + client_side_validation: true, + required: false, + serialized_name: 'osType', + type: { + name: 'String' + } + }, + version: { + client_side_validation: true, + required: false, + serialized_name: 'version', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb new file mode 100644 index 0000000000..e091a2eb04 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the environments details + # + class GetEnvironmentResponse + + include MsRestAzure + + # @return [EnvironmentDetails] Details of the environment + attr_accessor :environment + + + # + # Mapper for GetEnvironmentResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GetEnvironmentResponse', + type: { + name: 'Composite', + class_name: 'GetEnvironmentResponse', + model_properties: { + environment: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'environment', + type: { + name: 'Composite', + class_name: 'EnvironmentDetails' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb new file mode 100644 index 0000000000..c237025b01 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb @@ -0,0 +1,65 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the PersonalPreferences for the user + # + class GetPersonalPreferencesResponse + + include MsRestAzure + + # @return [String] Id to be used by the cache orchestrator + attr_accessor :id + + # @return [Array] Array of favorite lab resource ids + attr_accessor :favorite_lab_resource_ids + + + # + # Mapper for GetPersonalPreferencesResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GetPersonalPreferencesResponse', + type: { + name: 'Composite', + class_name: 'GetPersonalPreferencesResponse', + model_properties: { + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + favorite_lab_resource_ids: { + client_side_validation: true, + required: false, + serialized_name: 'favoriteLabResourceIds', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb new file mode 100644 index 0000000000..40ff2b15d1 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb @@ -0,0 +1,56 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response model from the GetRegionalAvailability action + # + class GetRegionalAvailabilityResponse + + include MsRestAzure + + # @return [Array] Availability information for + # different size categories per region + attr_accessor :regional_availability + + + # + # Mapper for GetRegionalAvailabilityResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'GetRegionalAvailabilityResponse', + type: { + name: 'Composite', + class_name: 'GetRegionalAvailabilityResponse', + model_properties: { + regional_availability: { + client_side_validation: true, + required: false, + serialized_name: 'regionalAvailability', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'RegionalAvailabilityElementType', + type: { + name: 'Composite', + class_name: 'RegionalAvailability' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab.rb new file mode 100644 index 0000000000..edf3c307e5 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab.rb @@ -0,0 +1,219 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a lab. + # + class Lab < Resource + + include MsRestAzure + + # @return [Integer] Maximum number of users allowed in the lab. + attr_accessor :max_users_in_lab + + # @return [Integer] Maximum value MaxUsersInLab can be set to, as + # specified by the service + attr_accessor :user_quota + + # @return [String] Invitation code that users can use to join a lab. + attr_accessor :invitation_code + + # @return [String] Object id of the user that created the lab. + attr_accessor :created_by_object_id + + # @return [Duration] Maximum duration a user can use an environment for + # in the lab. + attr_accessor :usage_quota + + # @return [LabUserAccessMode] Lab user access mode (open to all vs. + # restricted to those listed on the lab). Possible values include: + # 'Restricted', 'Open' + attr_accessor :user_access_mode + + # @return [String] Lab creator name + attr_accessor :created_by_user_principal_name + + # @return [DateTime] Creation date for the lab + attr_accessor :created_date + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + + # + # Mapper for Lab class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Lab', + type: { + name: 'Composite', + class_name: 'Lab', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + max_users_in_lab: { + client_side_validation: true, + required: false, + serialized_name: 'properties.maxUsersInLab', + type: { + name: 'Number' + } + }, + user_quota: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.userQuota', + type: { + name: 'Number' + } + }, + invitation_code: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.invitationCode', + type: { + name: 'String' + } + }, + created_by_object_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdByObjectId', + type: { + name: 'String' + } + }, + usage_quota: { + client_side_validation: true, + required: false, + serialized_name: 'properties.usageQuota', + type: { + name: 'TimeSpan' + } + }, + user_access_mode: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userAccessMode', + type: { + name: 'String' + } + }, + created_by_user_principal_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdByUserPrincipalName', + type: { + name: 'String' + } + }, + created_date: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.createdDate', + type: { + name: 'DateTime' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb new file mode 100644 index 0000000000..3f11639ca6 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb @@ -0,0 +1,147 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a lab account. + # + class LabAccount < Resource + + include MsRestAzure + + # @return [SizeConfigurationProperties] Represents the size configuration + # under the lab account + attr_accessor :size_configuration + + # @return [Boolean] Represents if region selection is enabled + attr_accessor :enabled_region_selection + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + + # + # Mapper for LabAccount class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabAccount', + type: { + name: 'Composite', + class_name: 'LabAccount', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + size_configuration: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.sizeConfiguration', + type: { + name: 'Composite', + class_name: 'SizeConfigurationProperties' + } + }, + enabled_region_selection: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enabledRegionSelection', + type: { + name: 'Boolean' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb new file mode 100644 index 0000000000..e96814b701 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb @@ -0,0 +1,119 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a lab account. + # + class LabAccountFragment < Resource + + include MsRestAzure + + # @return [Boolean] Represents if region selection is enabled + attr_accessor :enabled_region_selection + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for LabAccountFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabAccountFragment', + type: { + name: 'Composite', + class_name: 'LabAccountFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + enabled_region_selection: { + client_side_validation: true, + required: false, + serialized_name: 'properties.enabledRegionSelection', + type: { + name: 'Boolean' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb new file mode 100644 index 0000000000..8392ff41d9 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Settings related to creating a lab + # + class LabCreationParameters + + include MsRestAzure + + # @return [Integer] Maximum number of users allowed in the lab. + attr_accessor :max_users_in_lab + + + # + # Mapper for LabCreationParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabCreationParameters', + type: { + name: 'Composite', + class_name: 'LabCreationParameters', + model_properties: { + max_users_in_lab: { + client_side_validation: true, + required: false, + serialized_name: 'maxUsersInLab', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb new file mode 100644 index 0000000000..c4fed2c48c --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb @@ -0,0 +1,82 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # This represents the details about a lab that the User is in, and its + # state. + # + class LabDetails + + include MsRestAzure + + # @return [String] Name of the lab + attr_accessor :name + + # @return [String] The provisioning state of the lab. + attr_accessor :provisioning_state + + # @return [String] The Id of the lab. + attr_accessor :id + + # @return [Duration] The maximum duration a user can use a VM in this + # lab. + attr_accessor :usage_quota + + + # + # Mapper for LabDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabDetails', + type: { + name: 'Composite', + class_name: 'LabDetails', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + id: { + client_side_validation: true, + required: false, + serialized_name: 'id', + type: { + name: 'String' + } + }, + usage_quota: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'usageQuota', + type: { + name: 'TimeSpan' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb new file mode 100644 index 0000000000..f2f0dcb178 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb @@ -0,0 +1,144 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a lab. + # + class LabFragment < Resource + + include MsRestAzure + + # @return [Integer] Maximum number of users allowed in the lab. + attr_accessor :max_users_in_lab + + # @return [Duration] Maximum duration a user can use an environment for + # in the lab. + attr_accessor :usage_quota + + # @return [LabUserAccessMode] Lab user access mode (open to all vs. + # restricted to those listed on the lab). Possible values include: + # 'Restricted', 'Open' + attr_accessor :user_access_mode + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for LabFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LabFragment', + type: { + name: 'Composite', + class_name: 'LabFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + max_users_in_lab: { + client_side_validation: true, + required: false, + serialized_name: 'properties.maxUsersInLab', + type: { + name: 'Number' + } + }, + usage_quota: { + client_side_validation: true, + required: false, + serialized_name: 'properties.usageQuota', + type: { + name: 'TimeSpan' + } + }, + user_access_mode: { + client_side_validation: true, + required: false, + serialized_name: 'properties.userAccessMode', + type: { + name: 'String' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb new file mode 100644 index 0000000000..f0e908a589 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Defines values for LabUserAccessMode + # + module LabUserAccessMode + Restricted = "Restricted" + Open = "Open" + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb new file mode 100644 index 0000000000..d86bba1db3 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb @@ -0,0 +1,107 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Details of the status of an operation. + # + class LatestOperationResult + + include MsRestAzure + + # @return [String] The current status of the operation. + attr_accessor :status + + # @return [String] Error code on failure. + attr_accessor :error_code + + # @return [String] The error message. + attr_accessor :error_message + + # @return [String] Request URI of the operation. + attr_accessor :request_uri + + # @return [String] The HttpMethod - PUT/POST/DELETE for the operation. + attr_accessor :http_method + + # @return [String] The URL to use to check long-running operation status + attr_accessor :operation_url + + + # + # Mapper for LatestOperationResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'LatestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult', + model_properties: { + status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'status', + type: { + name: 'String' + } + }, + error_code: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'errorCode', + type: { + name: 'String' + } + }, + error_message: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'errorMessage', + type: { + name: 'String' + } + }, + request_uri: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'requestUri', + type: { + name: 'String' + } + }, + http_method: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'httpMethod', + type: { + name: 'String' + } + }, + operation_url: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'operationUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb new file mode 100644 index 0000000000..68f679dee3 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the payload to list environments owned by a user + # + class ListEnvironmentsPayload + + include MsRestAzure + + # @return [String] The resource Id of the lab + attr_accessor :lab_id + + + # + # Mapper for ListEnvironmentsPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ListEnvironmentsPayload', + type: { + name: 'Composite', + class_name: 'ListEnvironmentsPayload', + model_properties: { + lab_id: { + client_side_validation: true, + required: false, + serialized_name: 'labId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb new file mode 100644 index 0000000000..20e6c4847f --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb @@ -0,0 +1,55 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the list of environments owned by a user + # + class ListEnvironmentsResponse + + include MsRestAzure + + # @return [Array] List of all the environments + attr_accessor :environments + + + # + # Mapper for ListEnvironmentsResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ListEnvironmentsResponse', + type: { + name: 'Composite', + class_name: 'ListEnvironmentsResponse', + model_properties: { + environments: { + client_side_validation: true, + required: false, + serialized_name: 'environments', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentDetailsElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentDetails' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb new file mode 100644 index 0000000000..5909556ac5 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb @@ -0,0 +1,55 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Lists the labs owned by a user + # + class ListLabsResponse + + include MsRestAzure + + # @return [Array] List of all the labs + attr_accessor :labs + + + # + # Mapper for ListLabsResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ListLabsResponse', + type: { + name: 'Composite', + class_name: 'ListLabsResponse', + model_properties: { + labs: { + client_side_validation: true, + required: false, + serialized_name: 'labs', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabDetailsElementType', + type: { + name: 'Composite', + class_name: 'LabDetails' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb new file mode 100644 index 0000000000..c7c981375b --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb @@ -0,0 +1,17 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Defines values for ManagedLabVmSize + # + module ManagedLabVmSize + Basic = "Basic" + Standard = "Standard" + Performance = "Performance" + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb new file mode 100644 index 0000000000..bd3bdbc1ea --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb @@ -0,0 +1,83 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Network details of the environment + # + class NetworkInterface + + include MsRestAzure + + # @return [String] PrivateIp address of the Compute VM + attr_accessor :private_ip_address + + # @return [String] Connection information for Linux + attr_accessor :ssh_authority + + # @return [String] Connection information for Windows + attr_accessor :rdp_authority + + # @return [String] Username of the VM + attr_accessor :username + + + # + # Mapper for NetworkInterface class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'NetworkInterface', + type: { + name: 'Composite', + class_name: 'NetworkInterface', + model_properties: { + private_ip_address: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'privateIpAddress', + type: { + name: 'String' + } + }, + ssh_authority: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'sshAuthority', + type: { + name: 'String' + } + }, + rdp_authority: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'rdpAuthority', + type: { + name: 'String' + } + }, + username: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'username', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb new file mode 100644 index 0000000000..d7d612c2f4 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Payload to get the status of an operation + # + class OperationBatchStatusPayload + + include MsRestAzure + + # @return [Array] The operation url of long running operation + attr_accessor :urls + + + # + # Mapper for OperationBatchStatusPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationBatchStatusPayload', + type: { + name: 'Composite', + class_name: 'OperationBatchStatusPayload', + model_properties: { + urls: { + client_side_validation: true, + required: true, + serialized_name: 'urls', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb new file mode 100644 index 0000000000..2cdf4ef6b2 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Status Details of the long running operation for an environment + # + class OperationBatchStatusResponse + + include MsRestAzure + + # @return [Array] Gets a collection of + # items that contain the operation url and status. + attr_accessor :items + + + # + # Mapper for OperationBatchStatusResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationBatchStatusResponse', + type: { + name: 'Composite', + class_name: 'OperationBatchStatusResponse', + model_properties: { + items: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'items', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationBatchStatusResponseItemElementType', + type: { + name: 'Composite', + class_name: 'OperationBatchStatusResponseItem' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb new file mode 100644 index 0000000000..9000099954 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb @@ -0,0 +1,61 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the status of an operation that used the batch API. + # + class OperationBatchStatusResponseItem + + include MsRestAzure + + # @return [String] status of the long running operation for an + # environment + attr_accessor :operation_url + + # @return [String] status of the long running operation for an + # environment + attr_accessor :status + + + # + # Mapper for OperationBatchStatusResponseItem class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationBatchStatusResponseItem', + type: { + name: 'Composite', + class_name: 'OperationBatchStatusResponseItem', + model_properties: { + operation_url: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'operationUrl', + type: { + name: 'String' + } + }, + status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'status', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb new file mode 100644 index 0000000000..b3d25a3294 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_error.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Error details for the operation in case of a failure. + # + class OperationError + + include MsRestAzure + + # @return [String] The error code of the operation error. + attr_accessor :code + + # @return [String] The error message of the operation error. + attr_accessor :message + + + # + # Mapper for OperationError class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationError', + type: { + name: 'Composite', + class_name: 'OperationError', + model_properties: { + code: { + client_side_validation: true, + required: false, + serialized_name: 'code', + type: { + name: 'String' + } + }, + message: { + client_side_validation: true, + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb new file mode 100644 index 0000000000..b25e96c9cb --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The REST API operation supported by ManagedLab ResourceProvider. + # + class OperationMetadata + + include MsRestAzure + + # @return [String] Operation name: {provider}/{resource}/{operation} + attr_accessor :name + + # @return [OperationMetadataDisplay] The object that describes the + # operations + attr_accessor :display + + + # + # Mapper for OperationMetadata class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationMetadata', + type: { + name: 'Composite', + class_name: 'OperationMetadata', + model_properties: { + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + client_side_validation: true, + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationMetadataDisplay' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb new file mode 100644 index 0000000000..d2762ecb65 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb @@ -0,0 +1,80 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The object that describes the operations + # + class OperationMetadataDisplay + + include MsRestAzure + + # @return [String] Friendly name of the resource provider + attr_accessor :provider + + # @return [String] Resource type on which the operation is performed. + attr_accessor :resource + + # @return [String] Operation type: read, write, delete, listKeys/action, + # etc. + attr_accessor :operation + + # @return [String] Friendly name of the operation + attr_accessor :description + + + # + # Mapper for OperationMetadataDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationMetadataDisplay', + type: { + name: 'Composite', + class_name: 'OperationMetadataDisplay', + model_properties: { + provider: { + client_side_validation: true, + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + client_side_validation: true, + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + client_side_validation: true, + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + client_side_validation: true, + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb new file mode 100644 index 0000000000..145bb53168 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_result.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # An Operation Result + # + class OperationResult + + include MsRestAzure + + # @return [String] The operation status. + attr_accessor :status + + # @return [OperationError] Error details for the operation in case of a + # failure. + attr_accessor :error + + + # + # Mapper for OperationResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationResult', + type: { + name: 'Composite', + class_name: 'OperationResult', + model_properties: { + status: { + client_side_validation: true, + required: false, + serialized_name: 'status', + type: { + name: 'String' + } + }, + error: { + client_side_validation: true, + required: false, + serialized_name: 'error', + type: { + name: 'Composite', + class_name: 'OperationError' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb new file mode 100644 index 0000000000..adff9ff768 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Payload to get the status of an operation + # + class OperationStatusPayload + + include MsRestAzure + + # @return [String] The operation url of long running operation + attr_accessor :operation_url + + + # + # Mapper for OperationStatusPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationStatusPayload', + type: { + name: 'Composite', + class_name: 'OperationStatusPayload', + model_properties: { + operation_url: { + client_side_validation: true, + required: true, + serialized_name: 'operationUrl', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb new file mode 100644 index 0000000000..405392c8eb --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Status Details of the long running operation for an environment + # + class OperationStatusResponse + + include MsRestAzure + + # @return [String] status of the long running operation for an + # environment + attr_accessor :status + + + # + # Mapper for OperationStatusResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'OperationStatusResponse', + type: { + name: 'Composite', + class_name: 'OperationStatusResponse', + model_properties: { + status: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'status', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb new file mode 100644 index 0000000000..8bae086d25 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb @@ -0,0 +1,71 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents payload for any Environment operations like get, start, stop, + # connect + # + class PersonalPreferencesOperationsPayload + + include MsRestAzure + + # @return [String] Resource Id of the lab account + attr_accessor :lab_account_resource_id + + # @return [AddRemove] Enum indicating if user is adding or removing a + # favorite lab. Possible values include: 'Add', 'Remove' + attr_accessor :add_remove + + # @return [String] Resource Id of the lab to add/remove from the + # favorites list + attr_accessor :lab_resource_id + + + # + # Mapper for PersonalPreferencesOperationsPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PersonalPreferencesOperationsPayload', + type: { + name: 'Composite', + class_name: 'PersonalPreferencesOperationsPayload', + model_properties: { + lab_account_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'labAccountResourceId', + type: { + name: 'String' + } + }, + add_remove: { + client_side_validation: true, + required: false, + serialized_name: 'addRemove', + type: { + name: 'String' + } + }, + lab_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'labResourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb new file mode 100644 index 0000000000..bc4c797056 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb @@ -0,0 +1,101 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Result of the request to list REST API operations + # + class ProviderOperationResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] List of operations supported by the + # resource provider. + attr_accessor :value + + # @return [String] URL to get the next set of operation list results if + # there are any. + 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 [ProviderOperationResult] 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 ProviderOperationResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ProviderOperationResult', + type: { + name: 'Composite', + class_name: 'ProviderOperationResult', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'OperationMetadataElementType', + type: { + name: 'Composite', + class_name: 'OperationMetadata' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb new file mode 100644 index 0000000000..50c402dc53 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Payload for Publish operation on EnvironmentSetting. + # + class PublishPayload + + include MsRestAzure + + # @return [Boolean] Whether to use existing VM custom image when + # publishing. + attr_accessor :use_existing_image + + + # + # Mapper for PublishPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'PublishPayload', + type: { + name: 'Composite', + class_name: 'PublishPayload', + model_properties: { + use_existing_image: { + client_side_validation: true, + required: false, + serialized_name: 'useExistingImage', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb new file mode 100644 index 0000000000..dd1daec314 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb @@ -0,0 +1,19 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Defines values for PublishingState + # + module PublishingState + Draft = "Draft" + Publishing = "Publishing" + Published = "Published" + PublishFailed = "PublishFailed" + Scaling = "Scaling" + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb new file mode 100644 index 0000000000..35ed9e6bb9 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb @@ -0,0 +1,84 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Details of a Reference Vm + # + class ReferenceVm + + include MsRestAzure + + # @return [String] The username of the virtual machine + attr_accessor :user_name + + # @return [String] The password of the virtual machine. This will be set + # to null in GET resource API + attr_accessor :password + + # @return [VmStateDetails] The state details for the reference virtual + # machine. + attr_accessor :vm_state_details + + # @return [String] VM resource Id for the environment + attr_accessor :vm_resource_id + + + # + # Mapper for ReferenceVm class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ReferenceVm', + type: { + name: 'Composite', + class_name: 'ReferenceVm', + model_properties: { + user_name: { + client_side_validation: true, + required: true, + serialized_name: 'userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + }, + vm_state_details: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'vmStateDetails', + type: { + name: 'Composite', + class_name: 'VmStateDetails' + } + }, + vm_resource_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'vmResourceId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb new file mode 100644 index 0000000000..f4d4b0fe9c --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Creation parameters for Reference Vm + # + class ReferenceVmCreationParameters + + include MsRestAzure + + # @return [String] The username of the virtual machine + attr_accessor :user_name + + # @return [String] The password of the virtual machine. + attr_accessor :password + + + # + # Mapper for ReferenceVmCreationParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ReferenceVmCreationParameters', + type: { + name: 'Composite', + class_name: 'ReferenceVmCreationParameters', + model_properties: { + user_name: { + client_side_validation: true, + required: true, + serialized_name: 'userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: true, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb new file mode 100644 index 0000000000..0638845bcc --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb @@ -0,0 +1,58 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Details of a Reference Vm + # + class ReferenceVmFragment + + include MsRestAzure + + # @return [String] The username of the virtual machine + attr_accessor :user_name + + # @return [String] The password of the virtual machine. This will be set + # to null in GET resource API + attr_accessor :password + + + # + # Mapper for ReferenceVmFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ReferenceVmFragment', + type: { + name: 'Composite', + class_name: 'ReferenceVmFragment', + model_properties: { + user_name: { + client_side_validation: true, + required: false, + serialized_name: 'userName', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb new file mode 100644 index 0000000000..14de50edbf --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb @@ -0,0 +1,67 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The availability information of sizes across regions + # + class RegionalAvailability + + include MsRestAzure + + # @return [String] Corresponding region + attr_accessor :region + + # @return [Array] List of all the size information for + # the region + attr_accessor :size_availabilities + + + # + # Mapper for RegionalAvailability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RegionalAvailability', + type: { + name: 'Composite', + class_name: 'RegionalAvailability', + model_properties: { + region: { + client_side_validation: true, + required: false, + serialized_name: 'region', + type: { + name: 'String' + } + }, + size_availabilities: { + client_side_validation: true, + required: false, + serialized_name: 'sizeAvailabilities', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'SizeAvailabilityElementType', + type: { + name: 'Composite', + class_name: 'SizeAvailability' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb new file mode 100644 index 0000000000..cb34cca683 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/register_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents payload for Register action. + # + class RegisterPayload + + include MsRestAzure + + # @return [String] The registration code of the lab. + attr_accessor :registration_code + + + # + # Mapper for RegisterPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'RegisterPayload', + type: { + name: 'Composite', + class_name: 'RegisterPayload', + model_properties: { + registration_code: { + client_side_validation: true, + required: false, + serialized_name: 'registrationCode', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb new file mode 100644 index 0000000000..f5c7e01094 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the payload for resetting passwords. + # + class ResetPasswordPayload + + include MsRestAzure + + # @return [String] The resourceId of the environment + attr_accessor :environment_id + + # @return [String] The username for which the password will be reset. + attr_accessor :username + + # @return [String] The password to assign to the user specified in + attr_accessor :password + + + # + # Mapper for ResetPasswordPayload class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResetPasswordPayload', + type: { + name: 'Composite', + class_name: 'ResetPasswordPayload', + model_properties: { + environment_id: { + client_side_validation: true, + required: true, + serialized_name: 'environmentId', + type: { + name: 'String' + } + }, + username: { + client_side_validation: true, + required: false, + serialized_name: 'username', + type: { + name: 'String' + } + }, + password: { + client_side_validation: true, + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource.rb new file mode 100644 index 0000000000..816c487eaf --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource.rb @@ -0,0 +1,110 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # An Azure resource. + # + class Resource + + include MsRestAzure + + # @return [String] The identifier of the resource. + attr_accessor :id + + # @return [String] The name of the resource. + attr_accessor :name + + # @return [String] The type of the resource. + attr_accessor :type + + # @return [String] The location of the resource. + attr_accessor :location + + # @return [Hash{String => String}] The tags of the resource. + attr_accessor :tags + + + # @return [String] the name of the resource group of the resource. + def resource_group + unless self.id.nil? + groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/) + groups.captures[0].strip if groups + end + end + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb new file mode 100644 index 0000000000..ab683d96da --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a VM and the setting Id it was created for. + # + class ResourceSet + + include MsRestAzure + + # @return [String] VM resource Id for the environment + attr_accessor :vm_resource_id + + # @return [String] resourceSettingId for the environment + attr_accessor :resource_setting_id + + + # + # Mapper for ResourceSet class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceSet', + type: { + name: 'Composite', + class_name: 'ResourceSet', + model_properties: { + vm_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'vmResourceId', + type: { + name: 'String' + } + }, + resource_setting_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceSettingId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb new file mode 100644 index 0000000000..c0a12a7e6a --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents a VM and the setting Id it was created for. + # + class ResourceSetFragment + + include MsRestAzure + + # @return [String] VM resource Id for the environment + attr_accessor :vm_resource_id + + # @return [String] resourceSettingId for the environment + attr_accessor :resource_setting_id + + + # + # Mapper for ResourceSetFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceSetFragment', + type: { + name: 'Composite', + class_name: 'ResourceSetFragment', + model_properties: { + vm_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'vmResourceId', + type: { + name: 'String' + } + }, + resource_setting_id: { + client_side_validation: true, + required: false, + serialized_name: 'resourceSettingId', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb new file mode 100644 index 0000000000..7a10f720c2 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb @@ -0,0 +1,94 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents resource specific settings + # + class ResourceSettingCreationParameters + + include MsRestAzure + + # @return [String] The location where the virtual machine will live + attr_accessor :location + + # @return [String] The name of the resource setting + attr_accessor :name + + # @return [String] The resource id of the gallery image used for creating + # the virtual machine + attr_accessor :gallery_image_resource_id + + # @return [ManagedLabVmSize] The size of the virtual machine. Possible + # values include: 'Basic', 'Standard', 'Performance' + attr_accessor :size + + # @return [ReferenceVmCreationParameters] Creation parameters for + # Reference Vm + attr_accessor :reference_vm_creation_parameters + + + # + # Mapper for ResourceSettingCreationParameters class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceSettingCreationParameters', + type: { + name: 'Composite', + class_name: 'ResourceSettingCreationParameters', + model_properties: { + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + gallery_image_resource_id: { + client_side_validation: true, + required: true, + serialized_name: 'galleryImageResourceId', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'size', + type: { + name: 'String' + } + }, + reference_vm_creation_parameters: { + client_side_validation: true, + required: true, + serialized_name: 'referenceVmCreationParameters', + type: { + name: 'Composite', + class_name: 'ReferenceVmCreationParameters' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb new file mode 100644 index 0000000000..6d0038d620 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents resource specific settings + # + class ResourceSettings + + include MsRestAzure + + # @return [String] The unique id of the resource setting + attr_accessor :id + + # @return [String] The resource id of the gallery image used for creating + # the virtual machine + attr_accessor :gallery_image_resource_id + + # @return [String] The name of the image used to created the environment + # setting + attr_accessor :image_name + + # @return [ManagedLabVmSize] The size of the virtual machine. Possible + # values include: 'Basic', 'Standard', 'Performance' + attr_accessor :size + + # @return [Integer] The translated compute cores of the virtual machine + attr_accessor :cores + + # @return [ReferenceVm] Details specific to Reference Vm + attr_accessor :reference_vm + + + # + # Mapper for ResourceSettings class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceSettings', + type: { + name: 'Composite', + class_name: 'ResourceSettings', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + gallery_image_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'galleryImageResourceId', + type: { + name: 'String' + } + }, + image_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'imageName', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'size', + type: { + name: 'String' + } + }, + cores: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'cores', + type: { + name: 'Number' + } + }, + reference_vm: { + client_side_validation: true, + required: true, + serialized_name: 'referenceVm', + type: { + name: 'Composite', + class_name: 'ReferenceVm' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb new file mode 100644 index 0000000000..6793cffdaa --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb @@ -0,0 +1,71 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents resource specific settings + # + class ResourceSettingsFragment + + include MsRestAzure + + # @return [String] The resource id of the gallery image used for creating + # the virtual machine + attr_accessor :gallery_image_resource_id + + # @return [ManagedLabVmSize] The size of the virtual machine. Possible + # values include: 'Basic', 'Standard', 'Performance' + attr_accessor :size + + # @return [ReferenceVmFragment] Details specific to Reference Vm + attr_accessor :reference_vm + + + # + # Mapper for ResourceSettingsFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResourceSettingsFragment', + type: { + name: 'Composite', + class_name: 'ResourceSettingsFragment', + model_properties: { + gallery_image_resource_id: { + client_side_validation: true, + required: false, + serialized_name: 'galleryImageResourceId', + type: { + name: 'String' + } + }, + size: { + client_side_validation: true, + required: false, + serialized_name: 'size', + type: { + name: 'String' + } + }, + reference_vm: { + client_side_validation: true, + required: false, + serialized_name: 'referenceVm', + type: { + name: 'Composite', + class_name: 'ReferenceVmFragment' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb new file mode 100644 index 0000000000..c9201fd56f --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb @@ -0,0 +1,98 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response of a list operation. + # + class ResponseWithContinuationEnvironment + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ResponseWithContinuationEnvironment] 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 ResponseWithContinuationEnvironment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResponseWithContinuation[Environment]', + type: { + name: 'Composite', + class_name: 'ResponseWithContinuationEnvironment', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentElementType', + type: { + name: 'Composite', + class_name: 'Environment' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb new file mode 100644 index 0000000000..2a66f1896e --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb @@ -0,0 +1,100 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response of a list operation. + # + class ResponseWithContinuationEnvironmentSetting + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ResponseWithContinuationEnvironmentSetting] 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 ResponseWithContinuationEnvironmentSetting class as Ruby + # Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResponseWithContinuation[EnvironmentSetting]', + type: { + name: 'Composite', + class_name: 'ResponseWithContinuationEnvironmentSetting', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSettingElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentSetting' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb new file mode 100644 index 0000000000..d110a7422f --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb @@ -0,0 +1,98 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response of a list operation. + # + class ResponseWithContinuationGalleryImage + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ResponseWithContinuationGalleryImage] 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 ResponseWithContinuationGalleryImage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResponseWithContinuation[GalleryImage]', + type: { + name: 'Composite', + class_name: 'ResponseWithContinuationGalleryImage', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'GalleryImageElementType', + type: { + name: 'Composite', + class_name: 'GalleryImage' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb new file mode 100644 index 0000000000..cb916e85fb --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb @@ -0,0 +1,98 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response of a list operation. + # + class ResponseWithContinuationLab + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ResponseWithContinuationLab] 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 ResponseWithContinuationLab class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResponseWithContinuation[Lab]', + type: { + name: 'Composite', + class_name: 'ResponseWithContinuationLab', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabElementType', + type: { + name: 'Composite', + class_name: 'Lab' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb new file mode 100644 index 0000000000..783915ae03 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb @@ -0,0 +1,98 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response of a list operation. + # + class ResponseWithContinuationLabAccount + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ResponseWithContinuationLabAccount] 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 ResponseWithContinuationLabAccount class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResponseWithContinuation[LabAccount]', + type: { + name: 'Composite', + class_name: 'ResponseWithContinuationLabAccount', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'LabAccountElementType', + type: { + name: 'Composite', + class_name: 'LabAccount' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb new file mode 100644 index 0000000000..a9b4172aed --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb @@ -0,0 +1,98 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The response of a list operation. + # + class ResponseWithContinuationUser + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] Results of the list operation. + attr_accessor :value + + # @return [String] Link for next set of results. + 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 [ResponseWithContinuationUser] 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 ResponseWithContinuationUser class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'ResponseWithContinuation[User]', + type: { + name: 'Composite', + class_name: 'ResponseWithContinuationUser', + model_properties: { + value: { + client_side_validation: true, + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'UserElementType', + type: { + name: 'Composite', + class_name: 'User' + } + } + } + }, + next_link: { + client_side_validation: true, + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb new file mode 100644 index 0000000000..fb100ad73d --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_availability.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the size information + # + class SizeAvailability + + include MsRestAzure + + # @return [ManagedLabVmSize] The category of the size (Basic, Standard, + # Performance). Possible values include: 'Basic', 'Standard', + # 'Performance' + attr_accessor :size_category + + # @return [Boolean] Whether or not this size category is available + attr_accessor :is_available + + + # + # Mapper for SizeAvailability class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SizeAvailability', + type: { + name: 'Composite', + class_name: 'SizeAvailability', + model_properties: { + size_category: { + client_side_validation: true, + required: false, + serialized_name: 'sizeCategory', + type: { + name: 'String' + } + }, + is_available: { + client_side_validation: true, + required: false, + serialized_name: 'isAvailable', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb new file mode 100644 index 0000000000..346f245051 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb @@ -0,0 +1,56 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the size configuration under the lab account + # + class SizeConfigurationProperties + + include MsRestAzure + + # @return [Array] Represents a list of size categories + # supported by this Lab Account (Small, Medium, Large) + attr_accessor :environment_sizes + + + # + # Mapper for SizeConfigurationProperties class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SizeConfigurationProperties', + type: { + name: 'Composite', + class_name: 'SizeConfigurationProperties', + model_properties: { + environment_sizes: { + client_side_validation: true, + required: false, + serialized_name: 'environmentSizes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSizeElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentSize' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb new file mode 100644 index 0000000000..8c22319b83 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb @@ -0,0 +1,56 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Represents the size configuration under the lab account + # + class SizeConfigurationPropertiesFragment + + include MsRestAzure + + # @return [Array] Represents a list of size + # categories supported by this Lab Account (Small, Medium, Large) + attr_accessor :environment_sizes + + + # + # Mapper for SizeConfigurationPropertiesFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SizeConfigurationPropertiesFragment', + type: { + name: 'Composite', + class_name: 'SizeConfigurationPropertiesFragment', + model_properties: { + environment_sizes: { + client_side_validation: true, + required: false, + serialized_name: 'environmentSizes', + type: { + name: 'Sequence', + element: { + client_side_validation: true, + required: false, + serialized_name: 'EnvironmentSizeFragmentElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentSizeFragment' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb new file mode 100644 index 0000000000..73d6bd6e2a --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb @@ -0,0 +1,82 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Contains detailed information about a size + # + class SizeInfo + + include MsRestAzure + + # @return [String] Represents the actual compute size, e.g. + # Standard_A2_v2. + attr_accessor :compute_size + + # @return The pay-as-you-go price per hour this size will cost. It does + # not include discounts and may not reflect the actual price the size + # will cost. + attr_accessor :price + + # @return [Integer] The number of cores a VM of this size has. + attr_accessor :number_of_cores + + # @return [Float] The amount of memory available (in GB). + attr_accessor :memory + + + # + # Mapper for SizeInfo class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SizeInfo', + type: { + name: 'Composite', + class_name: 'SizeInfo', + model_properties: { + compute_size: { + client_side_validation: true, + required: false, + serialized_name: 'computeSize', + type: { + name: 'String' + } + }, + price: { + client_side_validation: true, + required: false, + serialized_name: 'price', + type: { + name: 'Number' + } + }, + number_of_cores: { + client_side_validation: true, + required: false, + serialized_name: 'numberOfCores', + type: { + name: 'Number' + } + }, + memory: { + client_side_validation: true, + required: false, + serialized_name: 'memory', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb new file mode 100644 index 0000000000..481b8ef21a --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb @@ -0,0 +1,82 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Contains detailed information about a size + # + class SizeInfoFragment + + include MsRestAzure + + # @return [String] Represents the actual compute size, e.g. + # Standard_A2_v2. + attr_accessor :compute_size + + # @return The pay-as-you-go price per hour this size will cost. It does + # not include discounts and may not reflect the actual price the size + # will cost. + attr_accessor :price + + # @return [Integer] The number of cores a VM of this size has. + attr_accessor :number_of_cores + + # @return [Float] The amount of memory available (in GB). + attr_accessor :memory + + + # + # Mapper for SizeInfoFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'SizeInfoFragment', + type: { + name: 'Composite', + class_name: 'SizeInfoFragment', + model_properties: { + compute_size: { + client_side_validation: true, + required: false, + serialized_name: 'computeSize', + type: { + name: 'String' + } + }, + price: { + client_side_validation: true, + required: false, + serialized_name: 'price', + type: { + name: 'Number' + } + }, + number_of_cores: { + client_side_validation: true, + required: false, + serialized_name: 'numberOfCores', + type: { + name: 'Number' + } + }, + memory: { + client_side_validation: true, + required: false, + serialized_name: 'memory', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/user.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/user.rb new file mode 100644 index 0000000000..0864019aae --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/user.rb @@ -0,0 +1,186 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The User registered to a lab + # + class User < Resource + + include MsRestAzure + + # @return [String] The user email address, as it was specified during + # registration. + attr_accessor :email + + # @return [String] The user family name, as it was specified during + # registration. + attr_accessor :family_name + + # @return [String] The user given name, as it was specified during + # registration. + attr_accessor :given_name + + # @return [String] The user tenant ID, as it was specified during + # registration. + attr_accessor :tenant_id + + # @return [Duration] How long the user has used his VMs in this lab + attr_accessor :total_usage + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + # @return [LatestOperationResult] The details of the latest operation. + # ex: status, error + attr_accessor :latest_operation_result + + + # + # Mapper for User class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'User', + type: { + name: 'Composite', + class_name: 'User', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + email: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.email', + type: { + name: 'String' + } + }, + family_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.familyName', + type: { + name: 'String' + } + }, + given_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.givenName', + type: { + name: 'String' + } + }, + tenant_id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.tenantId', + type: { + name: 'String' + } + }, + total_usage: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.totalUsage', + type: { + name: 'TimeSpan' + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + }, + latest_operation_result: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'properties.latestOperationResult', + type: { + name: 'Composite', + class_name: 'LatestOperationResult' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb new file mode 100644 index 0000000000..a7dc6a1784 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.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::Labservices::Mgmt::V2018_10_15 + module Models + # + # The User registered to a lab + # + class UserFragment < Resource + + include MsRestAzure + + # @return [String] The provisioning status of the resource. + attr_accessor :provisioning_state + + # @return [String] The unique immutable identifier of a resource (Guid). + attr_accessor :unique_identifier + + + # + # Mapper for UserFragment class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'UserFragment', + type: { + name: 'Composite', + class_name: 'UserFragment', + model_properties: { + id: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + client_side_validation: true, + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + client_side_validation: true, + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + client_side_validation: true, + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + client_side_validation: true, + required: false, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + unique_identifier: { + client_side_validation: true, + required: false, + serialized_name: 'properties.uniqueIdentifier', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb new file mode 100644 index 0000000000..529292d05d --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb @@ -0,0 +1,107 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Details of the backing virtual machine. + # + class VirtualMachineDetails + + include MsRestAzure + + # @return [String] Provisioning state of the Dtl VM + attr_accessor :provisioning_state + + # @return [String] Connection information for Windows + attr_accessor :rdp_authority + + # @return [String] Connection information for Linux + attr_accessor :ssh_authority + + # @return [String] PrivateIp address of the compute VM + attr_accessor :private_ip_address + + # @return [String] Compute VM login user name + attr_accessor :user_name + + # @return [String] Last known compute power state captured in DTL + attr_accessor :last_known_power_state + + + # + # Mapper for VirtualMachineDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VirtualMachineDetails', + type: { + name: 'Composite', + class_name: 'VirtualMachineDetails', + model_properties: { + provisioning_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'provisioningState', + type: { + name: 'String' + } + }, + rdp_authority: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'rdpAuthority', + type: { + name: 'String' + } + }, + ssh_authority: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'sshAuthority', + type: { + name: 'String' + } + }, + private_ip_address: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'privateIpAddress', + type: { + name: 'String' + } + }, + user_name: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'userName', + type: { + name: 'String' + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'lastKnownPowerState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb new file mode 100644 index 0000000000..96c763021c --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb @@ -0,0 +1,86 @@ +# 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::Labservices::Mgmt::V2018_10_15 + module Models + # + # Details about the state of the reference virtual machine. + # + class VmStateDetails + + include MsRestAzure + + # @return [String] The RdpAuthority property is a server DNS host name or + # IP address followed by the service port number for RDP (Remote Desktop + # Protocol). + attr_accessor :rdp_authority + + # @return [String] The SshAuthority property is a server DNS host name or + # IP address followed by the service port number for SSH. + attr_accessor :ssh_authority + + # @return [String] The power state of the reference virtual machine. + attr_accessor :power_state + + # @return [String] Last known compute power state captured in DTL + attr_accessor :last_known_power_state + + + # + # Mapper for VmStateDetails class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + client_side_validation: true, + required: false, + serialized_name: 'VmStateDetails', + type: { + name: 'Composite', + class_name: 'VmStateDetails', + model_properties: { + rdp_authority: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'rdpAuthority', + type: { + name: 'String' + } + }, + ssh_authority: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'sshAuthority', + type: { + name: 'String' + } + }, + power_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'powerState', + type: { + name: 'String' + } + }, + last_known_power_state: { + client_side_validation: true, + required: false, + read_only: true, + serialized_name: 'lastKnownPowerState', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/module_definition.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/module_definition.rb new file mode 100644 index 0000000000..2667639b7e --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/module_definition.rb @@ -0,0 +1,9 @@ +# 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::Labservices end +module Azure::Labservices::Mgmt end +module Azure::Labservices::Mgmt::V2018_10_15 end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/operations.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/operations.rb new file mode 100644 index 0000000000..b79ace8f72 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/operations.rb @@ -0,0 +1,117 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + 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 [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # Get operation + # + # @param location_name [String] The name of the location. + # @param operation_name [String] The name of the operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationResult] operation results. + # + def get(location_name, operation_name, custom_headers:nil) + response = get_async(location_name, operation_name, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get operation + # + # @param location_name [String] The name of the location. + # @param operation_name [String] The name of the 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 get_with_http_info(location_name, operation_name, custom_headers:nil) + get_async(location_name, operation_name, custom_headers:custom_headers).value! + end + + # + # Get operation + # + # @param location_name [String] The name of the location. + # @param operation_name [String] The name of the 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 get_async(location_name, operation_name, custom_headers:nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location_name is nil' if location_name.nil? + fail ArgumentError, 'operation_name is nil' if operation_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/locations/{locationName}/operations/{operationName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'locationName' => location_name,'operationName' => operation_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::Labservices::Mgmt::V2018_10_15::Models::OperationResult.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 + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb new file mode 100644 index 0000000000..01f727141c --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb @@ -0,0 +1,215 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class ProviderOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ProviderOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # Result of the request to list 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:custom_headers) + first_page.get_all_items + end + + # + # Result of the request to list 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:custom_headers).value! + end + + # + # Result of the request to list 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/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::Labservices::Mgmt::V2018_10_15::Models::ProviderOperationResult.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 + + # + # Result of the request to list 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 [ProviderOperationResult] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Result of the request to list 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:custom_headers).value! + end + + # + # Result of the request to list 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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ProviderOperationResult.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 + + # + # Result of the request to list REST API operations + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ProviderOperationResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers:nil) + response = list_async(custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb new file mode 100644 index 0000000000..99934a734f --- /dev/null +++ b/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb @@ -0,0 +1,729 @@ +# 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::Labservices::Mgmt::V2018_10_15 + # + # The Managed Labs Client. + # + class Users + include MsRestAzure + + # + # Creates and initializes a new instance of the Users class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ManagedLabsClient] reference to the ManagedLabsClient + attr_reader :client + + # + # List users in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + first_page = list_as_lazy(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) + first_page.get_all_items + end + + # + # List users in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + list_async(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! + end + + # + # List users in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @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, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/users' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name}, + query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationUser.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 + + # + # Get user + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def get(resource_group_name, lab_account_name, lab_name, user_name, expand:nil, custom_headers:nil) + response = get_async(resource_group_name, lab_account_name, lab_name, user_name, expand:expand, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Get user + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @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, lab_account_name, lab_name, user_name, expand:nil, custom_headers:nil) + get_async(resource_group_name, lab_account_name, lab_name, user_name, expand:expand, custom_headers:custom_headers).value! + end + + # + # Get user + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @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, lab_account_name, lab_name, user_name, expand:nil, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'userName' => user_name}, + query_params: {'$expand' => expand,'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::Labservices::Mgmt::V2018_10_15::Models::User.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 + + # + # Create or replace an existing User. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param user [User] The User registered to a lab + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def create_or_update(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:nil) + response = create_or_update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Create or replace an existing User. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param user [User] The User registered to a lab + # @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 create_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:nil) + create_or_update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:custom_headers).value! + end + + # + # Create or replace an existing User. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param user [User] The User registered to a lab + # @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 create_or_update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'user is nil' if user.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::User.mapper() + request_content = @client.serialize(request_mapper, user) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'userName' => user_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::Labservices::Mgmt::V2018_10_15::Models::User.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::Labservices::Mgmt::V2018_10_15::Models::User.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 + + # + # Delete user. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def delete(resource_group_name, lab_account_name, lab_name, user_name, custom_headers:nil) + response = delete_async(resource_group_name, lab_account_name, lab_name, user_name, custom_headers:custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @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, lab_account_name, lab_name, user_name, custom_headers:nil) + # Send request + promise = begin_delete_async(resource_group_name, lab_account_name, lab_name, user_name, custom_headers: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 + + # + # Modify properties of users. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param user [UserFragment] The User registered to a lab + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [User] operation results. + # + def update(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:nil) + response = update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # Modify properties of users. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param user [UserFragment] The User registered to a lab + # @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 update_with_http_info(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:nil) + update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:custom_headers).value! + end + + # + # Modify properties of users. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @param user [UserFragment] The User registered to a lab + # @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 update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, 'user is nil' if user.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + # Serialize Request + request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::UserFragment.mapper() + request_content = @client.serialize(request_mapper, user) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'userName' => user_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 + 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::Labservices::Mgmt::V2018_10_15::Models::User.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 + + # + # Delete user. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @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, lab_account_name, lab_name, user_name, custom_headers:nil) + response = begin_delete_async(resource_group_name, lab_account_name, lab_name, user_name, custom_headers:custom_headers).value! + nil + end + + # + # Delete user. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @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, lab_account_name, lab_name, user_name, custom_headers:nil) + begin_delete_async(resource_group_name, lab_account_name, lab_name, user_name, custom_headers:custom_headers).value! + end + + # + # Delete user. This operation can take a while to complete + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param user_name [String] The name of the user. + # @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, lab_account_name, lab_name, user_name, custom_headers: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, 'lab_account_name is nil' if lab_account_name.nil? + fail ArgumentError, 'lab_name is nil' if lab_name.nil? + fail ArgumentError, 'user_name is nil' if user_name.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}' + + 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,'labAccountName' => lab_account_name,'labName' => lab_name,'userName' => user_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 == 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 + + # + # List users in a given lab. + # + # @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 [ResponseWithContinuationUser] operation results. + # + def list_next(next_page_link, custom_headers:nil) + response = list_next_async(next_page_link, custom_headers:custom_headers).value! + response.body unless response.nil? + end + + # + # List users in a given lab. + # + # @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:custom_headers).value! + end + + # + # List users in a given lab. + # + # @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 = {} + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # 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::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationUser.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 + + # + # List users in a given lab. + # + # @param resource_group_name [String] The name of the resource group. + # @param lab_account_name [String] The name of the lab Account. + # @param lab_name [String] The name of the lab. + # @param expand [String] Specify the $expand query. Example: + # 'properties($select=email)' + # @param filter [String] The filter to apply to the operation. + # @param top [Integer] The maximum number of resources to return from the + # operation. + # @param orderby [String] The ordering expression for the results, using OData + # notation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ResponseWithContinuationUser] which provide lazy access to pages of + # the response. + # + def list_as_lazy(resource_group_name, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) + response = list_async(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_labservices/lib/azure_mgmt_labservices.rb b/management/azure_mgmt_labservices/lib/azure_mgmt_labservices.rb new file mode 100644 index 0000000000..d21d1d008f --- /dev/null +++ b/management/azure_mgmt_labservices/lib/azure_mgmt_labservices.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 '2018-10-15/generated/azure_mgmt_labservices' +require 'profiles/latest/labservices_latest_profile_client' diff --git a/management/azure_mgmt_labservices/lib/module_definition.rb b/management/azure_mgmt_labservices/lib/module_definition.rb new file mode 100644 index 0000000000..be563ea8e3 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/module_definition.rb @@ -0,0 +1,7 @@ +# 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. + +module Azure end +module Azure::Labservices end +module Azure::Labservices::Mgmt end diff --git a/management/azure_mgmt_labservices/lib/profiles/.gitignore b/management/azure_mgmt_labservices/lib/profiles/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/management/azure_mgmt_labservices/lib/profiles/latest/labservices_latest_profile_client.rb b/management/azure_mgmt_labservices/lib/profiles/latest/labservices_latest_profile_client.rb new file mode 100644 index 0000000000..ac2a4000bc --- /dev/null +++ b/management/azure_mgmt_labservices/lib/profiles/latest/labservices_latest_profile_client.rb @@ -0,0 +1,40 @@ +# 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 'profiles/latest/labservices_module_definition' +require 'profiles/latest/modules/labservices_profile_module' + +module Azure::Labservices::Profiles::Latest + module Mgmt + # + # Client class for the Latest profile SDK. + # + class Client < LabservicesManagementClass + include MsRestAzure::Common::Configurable + + # + # Initializes a new instance of the Client class. + # @param options [Hash] hash of client options. + # options = { + # tenant_id: 'YOUR TENANT ID', + # client_id: 'YOUR CLIENT ID', + # client_secret: 'YOUR CLIENT SECRET', + # subscription_id: 'YOUR SUBSCRIPTION ID', + # credentials: credentials, + # active_directory_settings: active_directory_settings, + # base_url: 'YOUR BASE URL', + # options: options + # } + # 'credentials' are optional and if not passed in the hash, will be obtained + # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider. + # + # Also, base_url, active_directory_settings & options are optional. + # + def initialize(options = {}) + super(options) + end + + end + end +end diff --git a/management/azure_mgmt_labservices/lib/profiles/latest/labservices_module_definition.rb b/management/azure_mgmt_labservices/lib/profiles/latest/labservices_module_definition.rb new file mode 100644 index 0000000000..dbd5da33f8 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/profiles/latest/labservices_module_definition.rb @@ -0,0 +1,8 @@ +# 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. + +module Azure end +module Azure::Labservices end +module Azure::Labservices::Profiles end +module Azure::Labservices::Profiles::Latest end diff --git a/management/azure_mgmt_labservices/lib/profiles/latest/modules/labservices_profile_module.rb b/management/azure_mgmt_labservices/lib/profiles/latest/modules/labservices_profile_module.rb new file mode 100644 index 0000000000..fecd222794 --- /dev/null +++ b/management/azure_mgmt_labservices/lib/profiles/latest/modules/labservices_profile_module.rb @@ -0,0 +1,369 @@ +# 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 'azure_mgmt_labservices' + +module Azure::Labservices::Profiles::Latest + module Mgmt + ProviderOperations = Azure::Labservices::Mgmt::V2018_10_15::ProviderOperations + GlobalUsers = Azure::Labservices::Mgmt::V2018_10_15::GlobalUsers + LabAccounts = Azure::Labservices::Mgmt::V2018_10_15::LabAccounts + Operations = Azure::Labservices::Mgmt::V2018_10_15::Operations + GalleryImages = Azure::Labservices::Mgmt::V2018_10_15::GalleryImages + Labs = Azure::Labservices::Mgmt::V2018_10_15::Labs + EnvironmentSettings = Azure::Labservices::Mgmt::V2018_10_15::EnvironmentSettings + Environments = Azure::Labservices::Mgmt::V2018_10_15::Environments + Users = Azure::Labservices::Mgmt::V2018_10_15::Users + + module Models + SizeAvailability = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeAvailability + RegionalAvailability = Azure::Labservices::Mgmt::V2018_10_15::Models::RegionalAvailability + GetRegionalAvailabilityResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::GetRegionalAvailabilityResponse + ReferenceVmCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmCreationParameters + AddUsersPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::AddUsersPayload + EnvironmentSettingCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingCreationParameters + CreateLabProperties = Azure::Labservices::Mgmt::V2018_10_15::Models::CreateLabProperties + ResourceSettingCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingCreationParameters + NetworkInterface = Azure::Labservices::Mgmt::V2018_10_15::Models::NetworkInterface + SizeConfigurationPropertiesFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationPropertiesFragment + LabCreationParameters = Azure::Labservices::Mgmt::V2018_10_15::Models::LabCreationParameters + ResourceSet = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSet + EnvironmentDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentDetails + LatestOperationResult = Azure::Labservices::Mgmt::V2018_10_15::Models::LatestOperationResult + ResponseWithContinuationGalleryImage = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationGalleryImage + RegisterPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::RegisterPayload + VmStateDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::VmStateDetails + SizeConfigurationProperties = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationProperties + ResourceSettings = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettings + ResponseWithContinuationUser = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationUser + ReferenceVmFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmFragment + ResponseWithContinuationLabAccount = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount + ResponseWithContinuationEnvironment = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment + LabDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::LabDetails + EnvironmentSize = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSize + ResponseWithContinuationLab = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLab + EnvironmentSizeFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSizeFragment + ListEnvironmentsPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsPayload + Resource = Azure::Labservices::Mgmt::V2018_10_15::Models::Resource + ListEnvironmentsResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsResponse + GalleryImageReferenceFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReferenceFragment + ListLabsResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::ListLabsResponse + GetPersonalPreferencesResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::GetPersonalPreferencesResponse + OperationBatchStatusPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusPayload + ResourceSetFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSetFragment + OperationBatchStatusResponseItem = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponseItem + ReferenceVm = Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVm + OperationBatchStatusResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponse + ResourceSettingsFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingsFragment + OperationError = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationError + SizeInfoFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfoFragment + OperationMetadataDisplay = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadataDisplay + ResetPasswordPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload + OperationMetadata = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadata + VirtualMachineDetails = Azure::Labservices::Mgmt::V2018_10_15::Models::VirtualMachineDetails + OperationResult = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationResult + ResponseWithContinuationEnvironmentSetting = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting + OperationStatusPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusPayload + GalleryImageReference = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReference + OperationStatusResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusResponse + EnvironmentOperationsPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload + PersonalPreferencesOperationsPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::PersonalPreferencesOperationsPayload + GetEnvironmentResponse = Azure::Labservices::Mgmt::V2018_10_15::Models::GetEnvironmentResponse + ProviderOperationResult = Azure::Labservices::Mgmt::V2018_10_15::Models::ProviderOperationResult + SizeInfo = Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfo + PublishPayload = Azure::Labservices::Mgmt::V2018_10_15::Models::PublishPayload + Environment = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment + EnvironmentFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment + EnvironmentSetting = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting + EnvironmentSettingFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingFragment + GalleryImage = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImage + GalleryImageFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageFragment + Lab = Azure::Labservices::Mgmt::V2018_10_15::Models::Lab + LabAccount = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount + LabAccountFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccountFragment + LabFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::LabFragment + User = Azure::Labservices::Mgmt::V2018_10_15::Models::User + UserFragment = Azure::Labservices::Mgmt::V2018_10_15::Models::UserFragment + ManagedLabVmSize = Azure::Labservices::Mgmt::V2018_10_15::Models::ManagedLabVmSize + PublishingState = Azure::Labservices::Mgmt::V2018_10_15::Models::PublishingState + ConfigurationState = Azure::Labservices::Mgmt::V2018_10_15::Models::ConfigurationState + LabUserAccessMode = Azure::Labservices::Mgmt::V2018_10_15::Models::LabUserAccessMode + AddRemove = Azure::Labservices::Mgmt::V2018_10_15::Models::AddRemove + end + + # + # LabservicesManagementClass + # + class LabservicesManagementClass + attr_reader :provider_operations, :global_users, :lab_accounts, :operations, :gallery_images, :labs, :environment_settings, :environments, :users, :configurable, :base_url, :options, :model_classes + + def initialize(options = {}) + if options.is_a?(Hash) && options.length == 0 + @options = setup_default_options + else + @options = options + end + + reset!(options) + + @configurable = self + @base_url = options[:base_url].nil? ? nil:options[:base_url] + @options = options[:options].nil? ? nil:options[:options] + + @client_0 = Azure::Labservices::Mgmt::V2018_10_15::ManagedLabsClient.new(configurable.credentials, base_url, options) + if(@client_0.respond_to?(:subscription_id)) + @client_0.subscription_id = configurable.subscription_id + end + add_telemetry(@client_0) + @provider_operations = @client_0.provider_operations + @global_users = @client_0.global_users + @lab_accounts = @client_0.lab_accounts + @operations = @client_0.operations + @gallery_images = @client_0.gallery_images + @labs = @client_0.labs + @environment_settings = @client_0.environment_settings + @environments = @client_0.environments + @users = @client_0.users + + @model_classes = ModelClasses.new + end + + def add_telemetry(client) + profile_information = 'Profiles/Latest/Labservices/Mgmt' + client.add_user_agent_information(profile_information) + end + + def method_missing(method, *args) + if @client_0.respond_to?method + @client_0.send(method, *args) + else + super + end + end + + end + + class ModelClasses + def size_availability + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeAvailability + end + def regional_availability + Azure::Labservices::Mgmt::V2018_10_15::Models::RegionalAvailability + end + def get_regional_availability_response + Azure::Labservices::Mgmt::V2018_10_15::Models::GetRegionalAvailabilityResponse + end + def reference_vm_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmCreationParameters + end + def add_users_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::AddUsersPayload + end + def environment_setting_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingCreationParameters + end + def create_lab_properties + Azure::Labservices::Mgmt::V2018_10_15::Models::CreateLabProperties + end + def resource_setting_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingCreationParameters + end + def network_interface + Azure::Labservices::Mgmt::V2018_10_15::Models::NetworkInterface + end + def size_configuration_properties_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationPropertiesFragment + end + def lab_creation_parameters + Azure::Labservices::Mgmt::V2018_10_15::Models::LabCreationParameters + end + def resource_set + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSet + end + def environment_details + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentDetails + end + def latest_operation_result + Azure::Labservices::Mgmt::V2018_10_15::Models::LatestOperationResult + end + def response_with_continuation_gallery_image + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationGalleryImage + end + def register_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::RegisterPayload + end + def vm_state_details + Azure::Labservices::Mgmt::V2018_10_15::Models::VmStateDetails + end + def size_configuration_properties + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeConfigurationProperties + end + def resource_settings + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettings + end + def response_with_continuation_user + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationUser + end + def reference_vm_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVmFragment + end + def response_with_continuation_lab_account + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount + end + def response_with_continuation_environment + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironment + end + def lab_details + Azure::Labservices::Mgmt::V2018_10_15::Models::LabDetails + end + def environment_size + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSize + end + def response_with_continuation_lab + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLab + end + def environment_size_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSizeFragment + end + def list_environments_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsPayload + end + def resource + Azure::Labservices::Mgmt::V2018_10_15::Models::Resource + end + def list_environments_response + Azure::Labservices::Mgmt::V2018_10_15::Models::ListEnvironmentsResponse + end + def gallery_image_reference_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReferenceFragment + end + def list_labs_response + Azure::Labservices::Mgmt::V2018_10_15::Models::ListLabsResponse + end + def get_personal_preferences_response + Azure::Labservices::Mgmt::V2018_10_15::Models::GetPersonalPreferencesResponse + end + def operation_batch_status_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusPayload + end + def resource_set_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSetFragment + end + def operation_batch_status_response_item + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponseItem + end + def reference_vm + Azure::Labservices::Mgmt::V2018_10_15::Models::ReferenceVm + end + def operation_batch_status_response + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationBatchStatusResponse + end + def resource_settings_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::ResourceSettingsFragment + end + def operation_error + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationError + end + def size_info_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfoFragment + end + def operation_metadata_display + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadataDisplay + end + def reset_password_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload + end + def operation_metadata + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationMetadata + end + def virtual_machine_details + Azure::Labservices::Mgmt::V2018_10_15::Models::VirtualMachineDetails + end + def operation_result + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationResult + end + def response_with_continuation_environment_setting + Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting + end + def operation_status_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusPayload + end + def gallery_image_reference + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageReference + end + def operation_status_response + Azure::Labservices::Mgmt::V2018_10_15::Models::OperationStatusResponse + end + def environment_operations_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentOperationsPayload + end + def personal_preferences_operations_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::PersonalPreferencesOperationsPayload + end + def get_environment_response + Azure::Labservices::Mgmt::V2018_10_15::Models::GetEnvironmentResponse + end + def provider_operation_result + Azure::Labservices::Mgmt::V2018_10_15::Models::ProviderOperationResult + end + def size_info + Azure::Labservices::Mgmt::V2018_10_15::Models::SizeInfo + end + def publish_payload + Azure::Labservices::Mgmt::V2018_10_15::Models::PublishPayload + end + def environment + Azure::Labservices::Mgmt::V2018_10_15::Models::Environment + end + def environment_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment + end + def environment_setting + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting + end + def environment_setting_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingFragment + end + def gallery_image + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImage + end + def gallery_image_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::GalleryImageFragment + end + def lab + Azure::Labservices::Mgmt::V2018_10_15::Models::Lab + end + def lab_account + Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount + end + def lab_account_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccountFragment + end + def lab_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::LabFragment + end + def user + Azure::Labservices::Mgmt::V2018_10_15::Models::User + end + def user_fragment + Azure::Labservices::Mgmt::V2018_10_15::Models::UserFragment + end + def managed_lab_vm_size + Azure::Labservices::Mgmt::V2018_10_15::Models::ManagedLabVmSize + end + def publishing_state + Azure::Labservices::Mgmt::V2018_10_15::Models::PublishingState + end + def configuration_state + Azure::Labservices::Mgmt::V2018_10_15::Models::ConfigurationState + end + def lab_user_access_mode + Azure::Labservices::Mgmt::V2018_10_15::Models::LabUserAccessMode + end + def add_remove + Azure::Labservices::Mgmt::V2018_10_15::Models::AddRemove + end + end + end +end diff --git a/management/azure_mgmt_labservices/lib/version.rb b/management/azure_mgmt_labservices/lib/version.rb new file mode 100644 index 0000000000..f926b29cbb --- /dev/null +++ b/management/azure_mgmt_labservices/lib/version.rb @@ -0,0 +1,7 @@ +# 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. + +module Azure::Labservices::Mgmt + VERSION = '0.17.0' +end diff --git a/management/azure_mgmt_labservices/spec/spec_helper.rb b/management/azure_mgmt_labservices/spec/spec_helper.rb new file mode 100644 index 0000000000..069c2dde5c --- /dev/null +++ b/management/azure_mgmt_labservices/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'))