Release 03132019 (#2320)
* Config Changes for azure_mgmt_advisor * Regen all SDKs & Profiles * Config Changes for event grid * Regen all SDKs & Profiles * Config changes for Marketplace ordering * Regen all SDKs & Profiles * Config changes for Computer Vision * Regen all SDKs & Profiles * Config changes for Text Analytics * Regen all SDKs & Profiles * Config changes for Monitor * Regen all SDKs & Profiles
This commit is contained in:
Родитель
ad260f28e8
Коммит
3daa9566f8
10
ChangeLog.md
10
ChangeLog.md
|
@ -1,3 +1,13 @@
|
|||
## 2019.03.13 - Azure Ruby SDK Release
|
||||
* Released the following SDKs
|
||||
- azure_mgmt_advisor - v0.17.0
|
||||
- azure_mgmt_event_grid - v0.17.5
|
||||
- azure_mgmt_marketplace_ordering - v0.17.3
|
||||
- azure_mgmt_monitor - v0.17.3
|
||||
- azure_cognitiveservices_computervision - v0.19.0
|
||||
- azure_cognitiveservices_textanalytics - v0.17.3
|
||||
- azure_sdk - v0.23.0
|
||||
|
||||
## 2019.03.12 - Azure Ruby SDK Release
|
||||
* Released all management, data and rollup SDKs to fix the empty value in nextLink.
|
||||
Refer [Issue #2316](https://github.com/Azure/azure-sdk-for-ruby/issues/2316) for more details.
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -13,6 +13,7 @@ group :development, :test do
|
|||
end
|
||||
|
||||
gem 'octokit', '~> 4.0'
|
||||
gem 'azure_mgmt_advisor', path: 'management/azure_mgmt_advisor'
|
||||
gem 'azure_mgmt_analysis_services', path: 'management/azure_mgmt_analysis_services'
|
||||
gem 'azure_mgmt_api_management', path: 'management/azure_mgmt_api_management'
|
||||
gem 'azure_mgmt_authorization', path: 'management/azure_mgmt_authorization'
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
module Azure
|
||||
VERSION = '0.22.5'
|
||||
VERSION = '0.23.0'
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
require 'latest/module_definition'
|
||||
require 'latest/modules/advisor_profile_module'
|
||||
require 'latest/modules/analysisservices_profile_module'
|
||||
require 'latest/modules/apimanagement_profile_module'
|
||||
require 'latest/modules/authorization_profile_module'
|
||||
|
@ -104,7 +105,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, :edge_gateway, :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, :maria_db, :marketplace_ordering, :media_services, :mixed_reality, :monitor, :managed_service_identity, :net_app, :network, :notification_hubs, :operational_insights, :policy, :policy_insights, :power_bi_embedded, :private_dns, :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, :luis_runtime, :luis_authoring, :news_search, :qnamaker, :spell_check, :text_analytics, :video_search, :web_search, :visual_search
|
||||
attr_reader :advisor, :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, :edge_gateway, :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, :maria_db, :marketplace_ordering, :media_services, :mixed_reality, :monitor, :managed_service_identity, :net_app, :network, :notification_hubs, :operational_insights, :policy, :policy_insights, :power_bi_embedded, :private_dns, :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, :luis_runtime, :luis_authoring, :news_search, :qnamaker, :spell_check, :text_analytics, :video_search, :web_search, :visual_search
|
||||
|
||||
#
|
||||
# Initializes a new instance of the Client class.
|
||||
|
@ -136,6 +137,7 @@ module Azure::Profiles::Latest
|
|||
base_url = options[:base_url].nil? ? nil:options[:base_url]
|
||||
sdk_options = options[:options].nil? ? nil:options[:options]
|
||||
|
||||
@advisor = AdvisorAdapter.new(self, base_url, sdk_options)
|
||||
@analysis_services = AnalysisServicesAdapter.new(self, base_url, sdk_options)
|
||||
@api_management = ApiManagementAdapter.new(self, base_url, sdk_options)
|
||||
@authorization = AuthorizationAdapter.new(self, base_url, sdk_options)
|
||||
|
@ -231,6 +233,14 @@ module Azure::Profiles::Latest
|
|||
@visual_search = VisualSearchAdapter.new(self, base_url, sdk_options)
|
||||
end
|
||||
|
||||
class AdvisorAdapter
|
||||
attr_accessor :mgmt
|
||||
|
||||
def initialize(context, base_url, options)
|
||||
@mgmt = Azure::Profiles::Latest::Advisor::Mgmt::AdvisorManagementClass.new(context, base_url, options)
|
||||
end
|
||||
end
|
||||
|
||||
class AnalysisServicesAdapter
|
||||
attr_accessor :mgmt
|
||||
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
# 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_advisor'
|
||||
|
||||
module Azure::Profiles::Latest
|
||||
module Advisor
|
||||
module Mgmt
|
||||
Configurations = Azure::Advisor::Mgmt::V2017_04_19::Configurations
|
||||
Recommendations = Azure::Advisor::Mgmt::V2017_04_19::Recommendations
|
||||
Operations = Azure::Advisor::Mgmt::V2017_04_19::Operations
|
||||
Suppressions = Azure::Advisor::Mgmt::V2017_04_19::Suppressions
|
||||
|
||||
module Models
|
||||
ResourceRecommendationBaseListResult = Azure::Advisor::Mgmt::V2017_04_19::Models::ResourceRecommendationBaseListResult
|
||||
Resource = Azure::Advisor::Mgmt::V2017_04_19::Models::Resource
|
||||
ConfigData = Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigData
|
||||
OperationDisplayInfo = Azure::Advisor::Mgmt::V2017_04_19::Models::OperationDisplayInfo
|
||||
ARMErrorResponseBody = Azure::Advisor::Mgmt::V2017_04_19::Models::ARMErrorResponseBody
|
||||
OperationEntity = Azure::Advisor::Mgmt::V2017_04_19::Models::OperationEntity
|
||||
ShortDescription = Azure::Advisor::Mgmt::V2017_04_19::Models::ShortDescription
|
||||
ConfigurationListResult = Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigurationListResult
|
||||
OperationEntityListResult = Azure::Advisor::Mgmt::V2017_04_19::Models::OperationEntityListResult
|
||||
ConfigDataProperties = Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigDataProperties
|
||||
SuppressionContractListResult = Azure::Advisor::Mgmt::V2017_04_19::Models::SuppressionContractListResult
|
||||
ResourceRecommendationBase = Azure::Advisor::Mgmt::V2017_04_19::Models::ResourceRecommendationBase
|
||||
SuppressionContract = Azure::Advisor::Mgmt::V2017_04_19::Models::SuppressionContract
|
||||
Category = Azure::Advisor::Mgmt::V2017_04_19::Models::Category
|
||||
Impact = Azure::Advisor::Mgmt::V2017_04_19::Models::Impact
|
||||
Risk = Azure::Advisor::Mgmt::V2017_04_19::Models::Risk
|
||||
end
|
||||
|
||||
class AdvisorManagementClass
|
||||
attr_reader :configurations, :recommendations, :operations, :suppressions, :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::Advisor::Mgmt::V2017_04_19::AdvisorManagementClient.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)
|
||||
@configurations = @client_0.configurations
|
||||
@recommendations = @client_0.recommendations
|
||||
@operations = @client_0.operations
|
||||
@suppressions = @client_0.suppressions
|
||||
|
||||
@model_classes = ModelClasses.new
|
||||
end
|
||||
|
||||
def add_telemetry(client)
|
||||
profile_information = "Profiles/azure_sdk/#{Azure::VERSION}/Latest/Advisor/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 resource_recommendation_base_list_result
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ResourceRecommendationBaseListResult
|
||||
end
|
||||
def resource
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::Resource
|
||||
end
|
||||
def config_data
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigData
|
||||
end
|
||||
def operation_display_info
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::OperationDisplayInfo
|
||||
end
|
||||
def armerror_response_body
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ARMErrorResponseBody
|
||||
end
|
||||
def operation_entity
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::OperationEntity
|
||||
end
|
||||
def short_description
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ShortDescription
|
||||
end
|
||||
def configuration_list_result
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigurationListResult
|
||||
end
|
||||
def operation_entity_list_result
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::OperationEntityListResult
|
||||
end
|
||||
def config_data_properties
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigDataProperties
|
||||
end
|
||||
def suppression_contract_list_result
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::SuppressionContractListResult
|
||||
end
|
||||
def resource_recommendation_base
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::ResourceRecommendationBase
|
||||
end
|
||||
def suppression_contract
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::SuppressionContract
|
||||
end
|
||||
def category
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::Category
|
||||
end
|
||||
def impact
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::Impact
|
||||
end
|
||||
def risk
|
||||
Azure::Advisor::Mgmt::V2017_04_19::Models::Risk
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -25,27 +25,31 @@ module Azure::Profiles::Latest
|
|||
OcrResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult
|
||||
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
|
||||
LandmarkResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults
|
||||
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
|
||||
FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult
|
||||
AreaOfInterestResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult
|
||||
ImageDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription
|
||||
ImageUrl = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl
|
||||
CategoryDetail = Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail
|
||||
ComputerVisionError = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError
|
||||
ImageType = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType
|
||||
LandmarkResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults
|
||||
FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
CelebrityResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults
|
||||
DetectedBrand = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedBrand
|
||||
Word = Azure::CognitiveServices::ComputerVision::V2_0::Models::Word
|
||||
CelebritiesModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel
|
||||
Line = Azure::CognitiveServices::ComputerVision::V2_0::Models::Line
|
||||
ImageCaption = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption
|
||||
TextRecognitionResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResult
|
||||
ImageAnalysis = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis
|
||||
TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult
|
||||
ObjectHierarchy = Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy
|
||||
ReadOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::ReadOperationResult
|
||||
AdultInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo
|
||||
Gender = Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender
|
||||
TextOperationStatusCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes
|
||||
TextRecognitionResultDimensionUnit = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultDimensionUnit
|
||||
TextRecognitionResultConfidenceClass = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultConfidenceClass
|
||||
OcrLanguages = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages
|
||||
VisualFeatureTypes = Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes
|
||||
TextRecognitionMode = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionMode
|
||||
|
@ -132,62 +136,68 @@ module Azure::Profiles::Latest
|
|||
def tag_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult
|
||||
end
|
||||
def image_analysis
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis
|
||||
def image_metadata
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata
|
||||
end
|
||||
def area_of_interest_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult
|
||||
end
|
||||
def celebrities_model
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel
|
||||
def image_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription
|
||||
end
|
||||
def image_url
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl
|
||||
end
|
||||
def adult_info
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo
|
||||
def category_detail
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail
|
||||
end
|
||||
def computer_vision_error
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError
|
||||
end
|
||||
def image_caption
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption
|
||||
def image_type
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType
|
||||
end
|
||||
def landmark_results
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults
|
||||
end
|
||||
def object_hierarchy
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy
|
||||
def face_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
end
|
||||
def celebrity_results
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults
|
||||
end
|
||||
def image_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription
|
||||
def detected_brand
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedBrand
|
||||
end
|
||||
def word
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::Word
|
||||
end
|
||||
def image_type
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType
|
||||
def celebrities_model
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel
|
||||
end
|
||||
def line
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::Line
|
||||
end
|
||||
def image_metadata
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata
|
||||
def image_caption
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption
|
||||
end
|
||||
def recognition_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult
|
||||
def text_recognition_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResult
|
||||
end
|
||||
def face_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
def image_analysis
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis
|
||||
end
|
||||
def text_operation_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult
|
||||
end
|
||||
def category_detail
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail
|
||||
def object_hierarchy
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy
|
||||
end
|
||||
def read_operation_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ReadOperationResult
|
||||
end
|
||||
def adult_info
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo
|
||||
end
|
||||
def gender
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender
|
||||
|
@ -195,6 +205,12 @@ module Azure::Profiles::Latest
|
|||
def text_operation_status_codes
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes
|
||||
end
|
||||
def text_recognition_result_dimension_unit
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultDimensionUnit
|
||||
end
|
||||
def text_recognition_result_confidence_class
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultConfidenceClass
|
||||
end
|
||||
def ocr_languages
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages
|
||||
end
|
||||
|
|
|
@ -187,56 +187,89 @@ module Azure::Profiles::Latest
|
|||
end
|
||||
end
|
||||
module Mgmt
|
||||
EventSubscriptions = Azure::EventGrid::Mgmt::V2019_01_01::EventSubscriptions
|
||||
Operations = Azure::EventGrid::Mgmt::V2019_01_01::Operations
|
||||
Topics = Azure::EventGrid::Mgmt::V2019_01_01::Topics
|
||||
TopicTypes = Azure::EventGrid::Mgmt::V2019_01_01::TopicTypes
|
||||
Domains = Azure::EventGrid::Mgmt::V2019_02_01_preview::Domains
|
||||
DomainTopics = Azure::EventGrid::Mgmt::V2019_02_01_preview::DomainTopics
|
||||
EventSubscriptions = Azure::EventGrid::Mgmt::V2019_02_01_preview::EventSubscriptions
|
||||
Operations = Azure::EventGrid::Mgmt::V2019_02_01_preview::Operations
|
||||
Topics = Azure::EventGrid::Mgmt::V2019_02_01_preview::Topics
|
||||
TopicTypes = Azure::EventGrid::Mgmt::V2019_02_01_preview::TopicTypes
|
||||
|
||||
module Models
|
||||
EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionsListResult
|
||||
OperationInfo = Azure::EventGrid::Mgmt::V2019_01_01::Models::OperationInfo
|
||||
EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionFilter
|
||||
Operation = Azure::EventGrid::Mgmt::V2019_01_01::Models::Operation
|
||||
DeadLetterDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::DeadLetterDestination
|
||||
OperationsListResult = Azure::EventGrid::Mgmt::V2019_01_01::Models::OperationsListResult
|
||||
EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionUpdateParameters
|
||||
EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionFullUrl
|
||||
TopicTypesListResult = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicTypesListResult
|
||||
EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionDestination
|
||||
TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicRegenerateKeyRequest
|
||||
RetryPolicy = Azure::EventGrid::Mgmt::V2019_01_01::Models::RetryPolicy
|
||||
Resource = Azure::EventGrid::Mgmt::V2019_01_01::Models::Resource
|
||||
TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicSharedAccessKeys
|
||||
TopicsListResult = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicsListResult
|
||||
EventTypesListResult = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventTypesListResult
|
||||
TopicUpdateParameters = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicUpdateParameters
|
||||
StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::StorageBlobDeadLetterDestination
|
||||
WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::WebHookEventSubscriptionDestination
|
||||
EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventHubEventSubscriptionDestination
|
||||
StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::StorageQueueEventSubscriptionDestination
|
||||
HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_01_01::Models::HybridConnectionEventSubscriptionDestination
|
||||
EventSubscription = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscription
|
||||
TrackedResource = Azure::EventGrid::Mgmt::V2019_01_01::Models::TrackedResource
|
||||
Topic = Azure::EventGrid::Mgmt::V2019_01_01::Models::Topic
|
||||
EventType = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventType
|
||||
TopicTypeInfo = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicTypeInfo
|
||||
EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionProvisioningState
|
||||
TopicProvisioningState = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicProvisioningState
|
||||
ResourceRegionType = Azure::EventGrid::Mgmt::V2019_01_01::Models::ResourceRegionType
|
||||
TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicTypeProvisioningState
|
||||
EventSubscriptionFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionFilter
|
||||
RetryPolicy = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::RetryPolicy
|
||||
Resource = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Resource
|
||||
DeadLetterDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DeadLetterDestination
|
||||
JsonFieldWithDefault = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::JsonFieldWithDefault
|
||||
InputSchemaMapping = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::InputSchemaMapping
|
||||
JsonField = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::JsonField
|
||||
TopicRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicRegenerateKeyRequest
|
||||
TopicTypesListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypesListResult
|
||||
DomainsListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainsListResult
|
||||
TopicsListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicsListResult
|
||||
DomainRegenerateKeyRequest = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainRegenerateKeyRequest
|
||||
EventSubscriptionFullUrl = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionFullUrl
|
||||
DomainTopicsListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopicsListResult
|
||||
EventSubscriptionUpdateParameters = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionUpdateParameters
|
||||
AdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::AdvancedFilter
|
||||
EventSubscriptionsListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult
|
||||
DomainUpdateParameters = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainUpdateParameters
|
||||
OperationInfo = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::OperationInfo
|
||||
EventTypesListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventTypesListResult
|
||||
Operation = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Operation
|
||||
TopicSharedAccessKeys = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicSharedAccessKeys
|
||||
OperationsListResult = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::OperationsListResult
|
||||
EventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionDestination
|
||||
TopicUpdateParameters = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicUpdateParameters
|
||||
DomainSharedAccessKeys = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainSharedAccessKeys
|
||||
JsonInputSchemaMapping = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::JsonInputSchemaMapping
|
||||
TrackedResource = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TrackedResource
|
||||
Domain = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain
|
||||
DomainTopic = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopic
|
||||
NumberInAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberInAdvancedFilter
|
||||
StorageBlobDeadLetterDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StorageBlobDeadLetterDestination
|
||||
NumberNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberNotInAdvancedFilter
|
||||
NumberLessThanAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberLessThanAdvancedFilter
|
||||
NumberGreaterThanAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberGreaterThanAdvancedFilter
|
||||
NumberLessThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberLessThanOrEqualsAdvancedFilter
|
||||
NumberGreaterThanOrEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter
|
||||
BoolEqualsAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::BoolEqualsAdvancedFilter
|
||||
StringInAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringInAdvancedFilter
|
||||
StringNotInAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringNotInAdvancedFilter
|
||||
StringBeginsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringBeginsWithAdvancedFilter
|
||||
StringEndsWithAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringEndsWithAdvancedFilter
|
||||
StringContainsAdvancedFilter = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringContainsAdvancedFilter
|
||||
WebHookEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::WebHookEventSubscriptionDestination
|
||||
EventHubEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventHubEventSubscriptionDestination
|
||||
StorageQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StorageQueueEventSubscriptionDestination
|
||||
HybridConnectionEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::HybridConnectionEventSubscriptionDestination
|
||||
ServiceBusQueueEventSubscriptionDestination = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::ServiceBusQueueEventSubscriptionDestination
|
||||
EventSubscription = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription
|
||||
Topic = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic
|
||||
EventType = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventType
|
||||
TopicTypeInfo = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypeInfo
|
||||
DomainProvisioningState = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainProvisioningState
|
||||
InputSchema = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::InputSchema
|
||||
DomainTopicProvisioningState = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopicProvisioningState
|
||||
EventSubscriptionProvisioningState = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionProvisioningState
|
||||
EventDeliverySchema = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventDeliverySchema
|
||||
TopicProvisioningState = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicProvisioningState
|
||||
ResourceRegionType = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::ResourceRegionType
|
||||
TopicTypeProvisioningState = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypeProvisioningState
|
||||
end
|
||||
|
||||
class EventGridManagementClass
|
||||
attr_reader :event_subscriptions, :operations, :topics, :topic_types, :configurable, :base_url, :options, :model_classes
|
||||
attr_reader :domains, :domain_topics, :event_subscriptions, :operations, :topics, :topic_types, :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::EventGrid::Mgmt::V2019_01_01::EventGridManagementClient.new(configurable.credentials, base_url, options)
|
||||
@client_0 = Azure::EventGrid::Mgmt::V2019_02_01_preview::EventGridManagementClient.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)
|
||||
@domains = @client_0.domains
|
||||
@domain_topics = @client_0.domain_topics
|
||||
@event_subscriptions = @client_0.event_subscriptions
|
||||
@operations = @client_0.operations
|
||||
@topics = @client_0.topics
|
||||
|
@ -259,98 +292,185 @@ module Azure::Profiles::Latest
|
|||
end
|
||||
|
||||
class ModelClasses
|
||||
def event_subscriptions_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionsListResult
|
||||
end
|
||||
def operation_info
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::OperationInfo
|
||||
end
|
||||
def event_subscription_filter
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionFilter
|
||||
end
|
||||
def operation
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::Operation
|
||||
end
|
||||
def dead_letter_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::DeadLetterDestination
|
||||
end
|
||||
def operations_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::OperationsListResult
|
||||
end
|
||||
def event_subscription_update_parameters
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionUpdateParameters
|
||||
end
|
||||
def event_subscription_full_url
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionFullUrl
|
||||
end
|
||||
def topic_types_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicTypesListResult
|
||||
end
|
||||
def event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionDestination
|
||||
end
|
||||
def topic_regenerate_key_request
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicRegenerateKeyRequest
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionFilter
|
||||
end
|
||||
def retry_policy
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::RetryPolicy
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::RetryPolicy
|
||||
end
|
||||
def resource
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::Resource
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Resource
|
||||
end
|
||||
def topic_shared_access_keys
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicSharedAccessKeys
|
||||
def dead_letter_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DeadLetterDestination
|
||||
end
|
||||
def json_field_with_default
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::JsonFieldWithDefault
|
||||
end
|
||||
def input_schema_mapping
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::InputSchemaMapping
|
||||
end
|
||||
def json_field
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::JsonField
|
||||
end
|
||||
def topic_regenerate_key_request
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicRegenerateKeyRequest
|
||||
end
|
||||
def topic_types_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypesListResult
|
||||
end
|
||||
def domains_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainsListResult
|
||||
end
|
||||
def topics_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicsListResult
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicsListResult
|
||||
end
|
||||
def domain_regenerate_key_request
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainRegenerateKeyRequest
|
||||
end
|
||||
def event_subscription_full_url
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionFullUrl
|
||||
end
|
||||
def domain_topics_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopicsListResult
|
||||
end
|
||||
def event_subscription_update_parameters
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionUpdateParameters
|
||||
end
|
||||
def advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::AdvancedFilter
|
||||
end
|
||||
def event_subscriptions_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionsListResult
|
||||
end
|
||||
def domain_update_parameters
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainUpdateParameters
|
||||
end
|
||||
def operation_info
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::OperationInfo
|
||||
end
|
||||
def event_types_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventTypesListResult
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventTypesListResult
|
||||
end
|
||||
def operation
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Operation
|
||||
end
|
||||
def topic_shared_access_keys
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicSharedAccessKeys
|
||||
end
|
||||
def operations_list_result
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::OperationsListResult
|
||||
end
|
||||
def event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionDestination
|
||||
end
|
||||
def topic_update_parameters
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicUpdateParameters
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicUpdateParameters
|
||||
end
|
||||
def storage_blob_dead_letter_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::StorageBlobDeadLetterDestination
|
||||
def domain_shared_access_keys
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainSharedAccessKeys
|
||||
end
|
||||
def web_hook_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::WebHookEventSubscriptionDestination
|
||||
end
|
||||
def event_hub_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventHubEventSubscriptionDestination
|
||||
end
|
||||
def storage_queue_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::StorageQueueEventSubscriptionDestination
|
||||
end
|
||||
def hybrid_connection_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::HybridConnectionEventSubscriptionDestination
|
||||
end
|
||||
def event_subscription
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscription
|
||||
def json_input_schema_mapping
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::JsonInputSchemaMapping
|
||||
end
|
||||
def tracked_resource
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TrackedResource
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TrackedResource
|
||||
end
|
||||
def domain
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Domain
|
||||
end
|
||||
def domain_topic
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopic
|
||||
end
|
||||
def number_in_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberInAdvancedFilter
|
||||
end
|
||||
def storage_blob_dead_letter_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StorageBlobDeadLetterDestination
|
||||
end
|
||||
def number_not_in_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberNotInAdvancedFilter
|
||||
end
|
||||
def number_less_than_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberLessThanAdvancedFilter
|
||||
end
|
||||
def number_greater_than_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberGreaterThanAdvancedFilter
|
||||
end
|
||||
def number_less_than_or_equals_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberLessThanOrEqualsAdvancedFilter
|
||||
end
|
||||
def number_greater_than_or_equals_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::NumberGreaterThanOrEqualsAdvancedFilter
|
||||
end
|
||||
def bool_equals_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::BoolEqualsAdvancedFilter
|
||||
end
|
||||
def string_in_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringInAdvancedFilter
|
||||
end
|
||||
def string_not_in_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringNotInAdvancedFilter
|
||||
end
|
||||
def string_begins_with_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringBeginsWithAdvancedFilter
|
||||
end
|
||||
def string_ends_with_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringEndsWithAdvancedFilter
|
||||
end
|
||||
def string_contains_advanced_filter
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StringContainsAdvancedFilter
|
||||
end
|
||||
def web_hook_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::WebHookEventSubscriptionDestination
|
||||
end
|
||||
def event_hub_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventHubEventSubscriptionDestination
|
||||
end
|
||||
def storage_queue_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::StorageQueueEventSubscriptionDestination
|
||||
end
|
||||
def hybrid_connection_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::HybridConnectionEventSubscriptionDestination
|
||||
end
|
||||
def service_bus_queue_event_subscription_destination
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::ServiceBusQueueEventSubscriptionDestination
|
||||
end
|
||||
def event_subscription
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscription
|
||||
end
|
||||
def topic
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::Topic
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic
|
||||
end
|
||||
def event_type
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventType
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventType
|
||||
end
|
||||
def topic_type_info
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicTypeInfo
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypeInfo
|
||||
end
|
||||
def domain_provisioning_state
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainProvisioningState
|
||||
end
|
||||
def input_schema
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::InputSchema
|
||||
end
|
||||
def domain_topic_provisioning_state
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::DomainTopicProvisioningState
|
||||
end
|
||||
def event_subscription_provisioning_state
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::EventSubscriptionProvisioningState
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventSubscriptionProvisioningState
|
||||
end
|
||||
def event_delivery_schema
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::EventDeliverySchema
|
||||
end
|
||||
def topic_provisioning_state
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicProvisioningState
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicProvisioningState
|
||||
end
|
||||
def resource_region_type
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::ResourceRegionType
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::ResourceRegionType
|
||||
end
|
||||
def topic_type_provisioning_state
|
||||
Azure::EventGrid::Mgmt::V2019_01_01::Models::TopicTypeProvisioningState
|
||||
Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::TopicTypeProvisioningState
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,12 +19,14 @@ module Azure::Profiles::Latest
|
|||
DiagnosticSettingsOperations = Azure::Monitor::Mgmt::V2017_05_01_preview::DiagnosticSettingsOperations
|
||||
DiagnosticSettingsCategoryOperations = Azure::Monitor::Mgmt::V2017_05_01_preview::DiagnosticSettingsCategoryOperations
|
||||
MetricBaseline = Azure::Monitor::Mgmt::V2017_11_01_preview::MetricBaseline
|
||||
MetricNamespaces = Azure::Monitor::Mgmt::V2017_12_01_preview::MetricNamespaces
|
||||
MetricDefinitions = Azure::Monitor::Mgmt::V2018_01_01::MetricDefinitions
|
||||
Metrics = Azure::Monitor::Mgmt::V2018_01_01::Metrics
|
||||
MetricAlerts = Azure::Monitor::Mgmt::V2018_03_01::MetricAlerts
|
||||
MetricAlertsStatus = Azure::Monitor::Mgmt::V2018_03_01::MetricAlertsStatus
|
||||
ActionGroups = Azure::Monitor::Mgmt::V2018_03_01::ActionGroups
|
||||
ScheduledQueryRules = Azure::Monitor::Mgmt::V2018_04_16::ScheduledQueryRules
|
||||
VMInsights = Azure::Monitor::Mgmt::V2018_11_27_preview::VMInsights
|
||||
ActionGroups = Azure::Monitor::Mgmt::V2019_03_01::ActionGroups
|
||||
|
||||
module Models
|
||||
RecurrentSchedule = Azure::Monitor::Mgmt::V2015_04_01::Models::RecurrentSchedule
|
||||
|
@ -99,6 +101,9 @@ module Azure::Profiles::Latest
|
|||
TimeSeriesInformation = Azure::Monitor::Mgmt::V2017_11_01_preview::Models::TimeSeriesInformation
|
||||
CalculateBaselineResponse = Azure::Monitor::Mgmt::V2017_11_01_preview::Models::CalculateBaselineResponse
|
||||
Sensitivity = Azure::Monitor::Mgmt::V2017_11_01_preview::Models::Sensitivity
|
||||
MetricNamespaceCollection = Azure::Monitor::Mgmt::V2017_12_01_preview::Models::MetricNamespaceCollection
|
||||
MetricNamespaceName = Azure::Monitor::Mgmt::V2017_12_01_preview::Models::MetricNamespaceName
|
||||
MetricNamespace = Azure::Monitor::Mgmt::V2017_12_01_preview::Models::MetricNamespace
|
||||
MetricValue = Azure::Monitor::Mgmt::V2018_01_01::Models::MetricValue
|
||||
LocalizableString = Azure::Monitor::Mgmt::V2018_01_01::Models::LocalizableString
|
||||
MetadataValue = Azure::Monitor::Mgmt::V2018_01_01::Models::MetadataValue
|
||||
|
@ -111,33 +116,18 @@ module Azure::Profiles::Latest
|
|||
Unit = Azure::Monitor::Mgmt::V2018_01_01::Models::Unit
|
||||
AggregationType = Azure::Monitor::Mgmt::V2018_01_01::Models::AggregationType
|
||||
ResultType = Azure::Monitor::Mgmt::V2018_01_01::Models::ResultType
|
||||
EmailReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::EmailReceiver
|
||||
SmsReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::SmsReceiver
|
||||
MetricAlertCriteria = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertCriteria
|
||||
WebhookReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::WebhookReceiver
|
||||
MetricAlertResourcePatch = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertResourcePatch
|
||||
ItsmReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::ItsmReceiver
|
||||
MetricAlertStatusProperties = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertStatusProperties
|
||||
AzureAppPushReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::AzureAppPushReceiver
|
||||
MetricAlertStatusCollection = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertStatusCollection
|
||||
AutomationRunbookReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::AutomationRunbookReceiver
|
||||
MetricCriteria = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricCriteria
|
||||
VoiceReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::VoiceReceiver
|
||||
LogicAppReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::LogicAppReceiver
|
||||
MetricAlertAction = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertAction
|
||||
MetricAlertResourceCollection = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertResourceCollection
|
||||
ActionGroupPatchBody = Azure::Monitor::Mgmt::V2018_03_01::Models::ActionGroupPatchBody
|
||||
MetricDimension = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricDimension
|
||||
AzureFunctionReceiver = Azure::Monitor::Mgmt::V2018_03_01::Models::AzureFunctionReceiver
|
||||
MetricAlertStatus = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertStatus
|
||||
EnableRequest = Azure::Monitor::Mgmt::V2018_03_01::Models::EnableRequest
|
||||
ActionGroupList = Azure::Monitor::Mgmt::V2018_03_01::Models::ActionGroupList
|
||||
MetricAlertResource = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertResource
|
||||
MetricAlertSingleResourceMultipleMetricCriteria = Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertSingleResourceMultipleMetricCriteria
|
||||
ActionGroupResource = Azure::Monitor::Mgmt::V2018_03_01::Models::ActionGroupResource
|
||||
ReceiverStatus = Azure::Monitor::Mgmt::V2018_03_01::Models::ReceiverStatus
|
||||
LogSearchRuleResourceCollection = Azure::Monitor::Mgmt::V2018_04_16::Models::LogSearchRuleResourceCollection
|
||||
Resource = Azure::Monitor::Mgmt::V2018_04_16::Models::Resource
|
||||
LogMetricTrigger = Azure::Monitor::Mgmt::V2018_04_16::Models::LogMetricTrigger
|
||||
Schedule = Azure::Monitor::Mgmt::V2018_04_16::Models::Schedule
|
||||
TriggerCondition = Azure::Monitor::Mgmt::V2018_04_16::Models::TriggerCondition
|
||||
|
@ -145,7 +135,6 @@ module Azure::Profiles::Latest
|
|||
Source = Azure::Monitor::Mgmt::V2018_04_16::Models::Source
|
||||
AzNsActionGroup = Azure::Monitor::Mgmt::V2018_04_16::Models::AzNsActionGroup
|
||||
LogSearchRuleResourcePatch = Azure::Monitor::Mgmt::V2018_04_16::Models::LogSearchRuleResourcePatch
|
||||
ErrorResponse = Azure::Monitor::Mgmt::V2018_04_16::Models::ErrorResponse
|
||||
LogSearchRuleResource = Azure::Monitor::Mgmt::V2018_04_16::Models::LogSearchRuleResource
|
||||
AlertingAction = Azure::Monitor::Mgmt::V2018_04_16::Models::AlertingAction
|
||||
Enabled = Azure::Monitor::Mgmt::V2018_04_16::Models::Enabled
|
||||
|
@ -154,10 +143,35 @@ module Azure::Profiles::Latest
|
|||
ConditionalOperator = Azure::Monitor::Mgmt::V2018_04_16::Models::ConditionalOperator
|
||||
MetricTriggerType = Azure::Monitor::Mgmt::V2018_04_16::Models::MetricTriggerType
|
||||
AlertSeverity = Azure::Monitor::Mgmt::V2018_04_16::Models::AlertSeverity
|
||||
WorkspaceInfo = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::WorkspaceInfo
|
||||
ProxyResource = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::ProxyResource
|
||||
DataContainer = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::DataContainer
|
||||
ResponseWithError = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::ResponseWithError
|
||||
Error = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::Error
|
||||
VMInsightsOnboardingStatus = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::VMInsightsOnboardingStatus
|
||||
OnboardingStatus = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::OnboardingStatus
|
||||
DataStatus = Azure::Monitor::Mgmt::V2018_11_27_preview::Models::DataStatus
|
||||
LogicAppReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::LogicAppReceiver
|
||||
Resource = Azure::Monitor::Mgmt::V2019_03_01::Models::Resource
|
||||
AzureFunctionReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::AzureFunctionReceiver
|
||||
SmsReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::SmsReceiver
|
||||
ArmRoleReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::ArmRoleReceiver
|
||||
ItsmReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::ItsmReceiver
|
||||
AzureAppPushReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::AzureAppPushReceiver
|
||||
VoiceReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::VoiceReceiver
|
||||
ActionGroupList = Azure::Monitor::Mgmt::V2019_03_01::Models::ActionGroupList
|
||||
WebhookReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::WebhookReceiver
|
||||
EnableRequest = Azure::Monitor::Mgmt::V2019_03_01::Models::EnableRequest
|
||||
EmailReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::EmailReceiver
|
||||
ErrorResponse = Azure::Monitor::Mgmt::V2019_03_01::Models::ErrorResponse
|
||||
AutomationRunbookReceiver = Azure::Monitor::Mgmt::V2019_03_01::Models::AutomationRunbookReceiver
|
||||
ActionGroupPatchBody = Azure::Monitor::Mgmt::V2019_03_01::Models::ActionGroupPatchBody
|
||||
ActionGroupResource = Azure::Monitor::Mgmt::V2019_03_01::Models::ActionGroupResource
|
||||
ReceiverStatus = Azure::Monitor::Mgmt::V2019_03_01::Models::ReceiverStatus
|
||||
end
|
||||
|
||||
class MonitorManagementClass
|
||||
attr_reader :activity_logs, :autoscale_settings, :event_categories, :operations, :tenant_activity_logs, :alert_rules, :alert_rule_incidents, :log_profiles, :activity_log_alerts, :diagnostic_settings_operations, :diagnostic_settings_category_operations, :metric_baseline, :metric_definitions, :metrics, :metric_alerts, :metric_alerts_status, :action_groups, :scheduled_query_rules, :configurable, :base_url, :options, :model_classes
|
||||
attr_reader :activity_logs, :autoscale_settings, :event_categories, :operations, :tenant_activity_logs, :alert_rules, :alert_rule_incidents, :log_profiles, :activity_log_alerts, :diagnostic_settings_operations, :diagnostic_settings_category_operations, :metric_baseline, :metric_namespaces, :metric_definitions, :metrics, :metric_alerts, :metric_alerts_status, :scheduled_query_rules, :vminsights, :action_groups, :configurable, :base_url, :options, :model_classes
|
||||
|
||||
def initialize(configurable, base_url=nil, options=nil)
|
||||
@configurable, @base_url, @options = configurable, base_url, options
|
||||
|
@ -204,29 +218,49 @@ module Azure::Profiles::Latest
|
|||
add_telemetry(@client_4)
|
||||
@metric_baseline = @client_4.metric_baseline
|
||||
|
||||
@client_5 = Azure::Monitor::Mgmt::V2018_01_01::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
@client_5 = Azure::Monitor::Mgmt::V2017_12_01_preview::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
if(@client_5.respond_to?(:subscription_id))
|
||||
@client_5.subscription_id = configurable.subscription_id
|
||||
end
|
||||
add_telemetry(@client_5)
|
||||
@metric_definitions = @client_5.metric_definitions
|
||||
@metrics = @client_5.metrics
|
||||
@metric_namespaces = @client_5.metric_namespaces
|
||||
|
||||
@client_6 = Azure::Monitor::Mgmt::V2018_03_01::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
@client_6 = Azure::Monitor::Mgmt::V2018_01_01::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
if(@client_6.respond_to?(:subscription_id))
|
||||
@client_6.subscription_id = configurable.subscription_id
|
||||
end
|
||||
add_telemetry(@client_6)
|
||||
@metric_alerts = @client_6.metric_alerts
|
||||
@metric_alerts_status = @client_6.metric_alerts_status
|
||||
@action_groups = @client_6.action_groups
|
||||
@metric_definitions = @client_6.metric_definitions
|
||||
@metrics = @client_6.metrics
|
||||
|
||||
@client_7 = Azure::Monitor::Mgmt::V2018_04_16::MonitorClient.new(configurable.credentials, base_url, options)
|
||||
@client_7 = Azure::Monitor::Mgmt::V2018_03_01::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
if(@client_7.respond_to?(:subscription_id))
|
||||
@client_7.subscription_id = configurable.subscription_id
|
||||
end
|
||||
add_telemetry(@client_7)
|
||||
@scheduled_query_rules = @client_7.scheduled_query_rules
|
||||
@metric_alerts = @client_7.metric_alerts
|
||||
@metric_alerts_status = @client_7.metric_alerts_status
|
||||
|
||||
@client_8 = Azure::Monitor::Mgmt::V2018_04_16::MonitorClient.new(configurable.credentials, base_url, options)
|
||||
if(@client_8.respond_to?(:subscription_id))
|
||||
@client_8.subscription_id = configurable.subscription_id
|
||||
end
|
||||
add_telemetry(@client_8)
|
||||
@scheduled_query_rules = @client_8.scheduled_query_rules
|
||||
|
||||
@client_9 = Azure::Monitor::Mgmt::V2018_11_27_preview::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
if(@client_9.respond_to?(:subscription_id))
|
||||
@client_9.subscription_id = configurable.subscription_id
|
||||
end
|
||||
add_telemetry(@client_9)
|
||||
@vminsights = @client_9.vminsights
|
||||
|
||||
@client_10 = Azure::Monitor::Mgmt::V2019_03_01::MonitorManagementClient.new(configurable.credentials, base_url, options)
|
||||
if(@client_10.respond_to?(:subscription_id))
|
||||
@client_10.subscription_id = configurable.subscription_id
|
||||
end
|
||||
add_telemetry(@client_10)
|
||||
@action_groups = @client_10.action_groups
|
||||
|
||||
@model_classes = ModelClasses.new
|
||||
end
|
||||
|
@ -237,7 +271,13 @@ module Azure::Profiles::Latest
|
|||
end
|
||||
|
||||
def method_missing(method, *args)
|
||||
if @client_7.respond_to?method
|
||||
if @client_10.respond_to?method
|
||||
@client_10.send(method, *args)
|
||||
elsif @client_9.respond_to?method
|
||||
@client_9.send(method, *args)
|
||||
elsif @client_8.respond_to?method
|
||||
@client_8.send(method, *args)
|
||||
elsif @client_7.respond_to?method
|
||||
@client_7.send(method, *args)
|
||||
elsif @client_6.respond_to?method
|
||||
@client_6.send(method, *args)
|
||||
|
@ -475,6 +515,15 @@ module Azure::Profiles::Latest
|
|||
def sensitivity
|
||||
Azure::Monitor::Mgmt::V2017_11_01_preview::Models::Sensitivity
|
||||
end
|
||||
def metric_namespace_collection
|
||||
Azure::Monitor::Mgmt::V2017_12_01_preview::Models::MetricNamespaceCollection
|
||||
end
|
||||
def metric_namespace_name
|
||||
Azure::Monitor::Mgmt::V2017_12_01_preview::Models::MetricNamespaceName
|
||||
end
|
||||
def metric_namespace
|
||||
Azure::Monitor::Mgmt::V2017_12_01_preview::Models::MetricNamespace
|
||||
end
|
||||
def metric_value
|
||||
Azure::Monitor::Mgmt::V2018_01_01::Models::MetricValue
|
||||
end
|
||||
|
@ -511,87 +560,42 @@ module Azure::Profiles::Latest
|
|||
def result_type
|
||||
Azure::Monitor::Mgmt::V2018_01_01::Models::ResultType
|
||||
end
|
||||
def email_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::EmailReceiver
|
||||
end
|
||||
def sms_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::SmsReceiver
|
||||
end
|
||||
def metric_alert_criteria
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertCriteria
|
||||
end
|
||||
def webhook_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::WebhookReceiver
|
||||
end
|
||||
def metric_alert_resource_patch
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertResourcePatch
|
||||
end
|
||||
def itsm_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::ItsmReceiver
|
||||
end
|
||||
def metric_alert_status_properties
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertStatusProperties
|
||||
end
|
||||
def azure_app_push_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::AzureAppPushReceiver
|
||||
end
|
||||
def metric_alert_status_collection
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertStatusCollection
|
||||
end
|
||||
def automation_runbook_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::AutomationRunbookReceiver
|
||||
end
|
||||
def metric_criteria
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricCriteria
|
||||
end
|
||||
def voice_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::VoiceReceiver
|
||||
end
|
||||
def logic_app_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::LogicAppReceiver
|
||||
end
|
||||
def metric_alert_action
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertAction
|
||||
end
|
||||
def metric_alert_resource_collection
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertResourceCollection
|
||||
end
|
||||
def action_group_patch_body
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::ActionGroupPatchBody
|
||||
end
|
||||
def metric_dimension
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricDimension
|
||||
end
|
||||
def azure_function_receiver
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::AzureFunctionReceiver
|
||||
end
|
||||
def metric_alert_status
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertStatus
|
||||
end
|
||||
def enable_request
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::EnableRequest
|
||||
end
|
||||
def action_group_list
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::ActionGroupList
|
||||
end
|
||||
def metric_alert_resource
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertResource
|
||||
end
|
||||
def metric_alert_single_resource_multiple_metric_criteria
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::MetricAlertSingleResourceMultipleMetricCriteria
|
||||
end
|
||||
def action_group_resource
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::ActionGroupResource
|
||||
end
|
||||
def receiver_status
|
||||
Azure::Monitor::Mgmt::V2018_03_01::Models::ReceiverStatus
|
||||
end
|
||||
def log_search_rule_resource_collection
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::LogSearchRuleResourceCollection
|
||||
end
|
||||
def resource
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::Resource
|
||||
end
|
||||
def log_metric_trigger
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::LogMetricTrigger
|
||||
end
|
||||
|
@ -613,9 +617,6 @@ module Azure::Profiles::Latest
|
|||
def log_search_rule_resource_patch
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::LogSearchRuleResourcePatch
|
||||
end
|
||||
def error_response
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::ErrorResponse
|
||||
end
|
||||
def log_search_rule_resource
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::LogSearchRuleResource
|
||||
end
|
||||
|
@ -640,6 +641,81 @@ module Azure::Profiles::Latest
|
|||
def alert_severity
|
||||
Azure::Monitor::Mgmt::V2018_04_16::Models::AlertSeverity
|
||||
end
|
||||
def workspace_info
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::WorkspaceInfo
|
||||
end
|
||||
def proxy_resource
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::ProxyResource
|
||||
end
|
||||
def data_container
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::DataContainer
|
||||
end
|
||||
def response_with_error
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::ResponseWithError
|
||||
end
|
||||
def error
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::Error
|
||||
end
|
||||
def vminsights_onboarding_status
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::VMInsightsOnboardingStatus
|
||||
end
|
||||
def onboarding_status
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::OnboardingStatus
|
||||
end
|
||||
def data_status
|
||||
Azure::Monitor::Mgmt::V2018_11_27_preview::Models::DataStatus
|
||||
end
|
||||
def logic_app_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::LogicAppReceiver
|
||||
end
|
||||
def resource
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::Resource
|
||||
end
|
||||
def azure_function_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::AzureFunctionReceiver
|
||||
end
|
||||
def sms_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::SmsReceiver
|
||||
end
|
||||
def arm_role_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ArmRoleReceiver
|
||||
end
|
||||
def itsm_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ItsmReceiver
|
||||
end
|
||||
def azure_app_push_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::AzureAppPushReceiver
|
||||
end
|
||||
def voice_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::VoiceReceiver
|
||||
end
|
||||
def action_group_list
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ActionGroupList
|
||||
end
|
||||
def webhook_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::WebhookReceiver
|
||||
end
|
||||
def enable_request
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::EnableRequest
|
||||
end
|
||||
def email_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::EmailReceiver
|
||||
end
|
||||
def error_response
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ErrorResponse
|
||||
end
|
||||
def automation_runbook_receiver
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::AutomationRunbookReceiver
|
||||
end
|
||||
def action_group_patch_body
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ActionGroupPatchBody
|
||||
end
|
||||
def action_group_resource
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ActionGroupResource
|
||||
end
|
||||
def receiver_status
|
||||
Azure::Monitor::Mgmt::V2019_03_01::Models::ReceiverStatus
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,24 +8,26 @@ module Azure::Profiles::Latest
|
|||
module TextAnalytics
|
||||
|
||||
module Models
|
||||
DetectedLanguage = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::DetectedLanguage
|
||||
MultiLanguageInput = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageInput
|
||||
LanguageBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResultItem
|
||||
KeyPhraseBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResultItem
|
||||
LanguageBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResult
|
||||
KeyPhraseBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResult
|
||||
SentimentBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResultItem
|
||||
ErrorResponse = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorResponse
|
||||
SentimentBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResult
|
||||
BatchInput = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::BatchInput
|
||||
MatchRecordV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MatchRecordV2dot1
|
||||
ErrorRecord = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorRecord
|
||||
EntityRecordV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntityRecordV2dot1
|
||||
Input = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::Input
|
||||
EntitiesBatchResultItemV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultItemV2dot1
|
||||
InternalError = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::InternalError
|
||||
EntitiesBatchResultV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultV2dot1
|
||||
MultiLanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageBatchInput
|
||||
ErrorResponse = Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorResponse
|
||||
MultiLanguageInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageInput
|
||||
KeyPhraseBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResultItem
|
||||
MatchRecord = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MatchRecord
|
||||
KeyPhraseBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResult
|
||||
DocumentStatistics = Azure::CognitiveServices::TextAnalytics::V2_1::Models::DocumentStatistics
|
||||
LanguageInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageInput
|
||||
ErrorRecord = Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorRecord
|
||||
LanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchInput
|
||||
EntitiesBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResult
|
||||
DetectedLanguage = Azure::CognitiveServices::TextAnalytics::V2_1::Models::DetectedLanguage
|
||||
MultiLanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput
|
||||
LanguageBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResultItem
|
||||
EntitiesBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResultItem
|
||||
LanguageBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResult
|
||||
InternalError = Azure::CognitiveServices::TextAnalytics::V2_1::Models::InternalError
|
||||
SentimentBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResultItem
|
||||
RequestStatistics = Azure::CognitiveServices::TextAnalytics::V2_1::Models::RequestStatistics
|
||||
SentimentBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResult
|
||||
EntityRecord = Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntityRecord
|
||||
end
|
||||
|
||||
class TextAnalyticsDataClass
|
||||
|
@ -34,7 +36,7 @@ module Azure::Profiles::Latest
|
|||
def initialize(configurable, base_url=nil, options=nil)
|
||||
@configurable, @base_url, @options = configurable, base_url, options
|
||||
|
||||
@client_0 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::TextAnalyticsClient.new(configurable.credentials, options)
|
||||
@client_0 = Azure::CognitiveServices::TextAnalytics::V2_1::TextAnalyticsClient.new(configurable.credentials, options)
|
||||
if(@client_0.respond_to?(:subscription_id))
|
||||
@client_0.subscription_id = configurable.subscription_id
|
||||
end
|
||||
|
@ -57,59 +59,65 @@ module Azure::Profiles::Latest
|
|||
end
|
||||
|
||||
class ModelClasses
|
||||
def detected_language
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::DetectedLanguage
|
||||
def error_response
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorResponse
|
||||
end
|
||||
def multi_language_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageInput
|
||||
end
|
||||
def language_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResultItem
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageInput
|
||||
end
|
||||
def key_phrase_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResultItem
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResultItem
|
||||
end
|
||||
def language_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResult
|
||||
def match_record
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::MatchRecord
|
||||
end
|
||||
def key_phrase_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResult
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResult
|
||||
end
|
||||
def sentiment_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResultItem
|
||||
def document_statistics
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::DocumentStatistics
|
||||
end
|
||||
def error_response
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorResponse
|
||||
end
|
||||
def sentiment_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResult
|
||||
end
|
||||
def batch_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::BatchInput
|
||||
end
|
||||
def match_record_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MatchRecordV2dot1
|
||||
def language_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageInput
|
||||
end
|
||||
def error_record
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorRecord
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorRecord
|
||||
end
|
||||
def entity_record_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntityRecordV2dot1
|
||||
def language_batch_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchInput
|
||||
end
|
||||
def input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::Input
|
||||
def entities_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResult
|
||||
end
|
||||
def entities_batch_result_item_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultItemV2dot1
|
||||
end
|
||||
def internal_error
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::InternalError
|
||||
end
|
||||
def entities_batch_result_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultV2dot1
|
||||
def detected_language
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::DetectedLanguage
|
||||
end
|
||||
def multi_language_batch_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageBatchInput
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput
|
||||
end
|
||||
def language_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResultItem
|
||||
end
|
||||
def entities_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResultItem
|
||||
end
|
||||
def language_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResult
|
||||
end
|
||||
def internal_error
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::InternalError
|
||||
end
|
||||
def sentiment_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResultItem
|
||||
end
|
||||
def request_statistics
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::RequestStatistics
|
||||
end
|
||||
def sentiment_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResult
|
||||
end
|
||||
def entity_record
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntityRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,103 +1,13 @@
|
|||
{
|
||||
"management": [
|
||||
"azure_mgmt_analysis_services",
|
||||
"azure_mgmt_api_management",
|
||||
"azure_mgmt_authorization",
|
||||
"azure_mgmt_automation",
|
||||
"azure_mgmt_batch",
|
||||
"azure_mgmt_billing",
|
||||
"azure_mgmt_cdn",
|
||||
"azure_mgmt_cognitive_services",
|
||||
"azure_mgmt_commerce",
|
||||
"azure_mgmt_compute",
|
||||
"azure_mgmt_consumption",
|
||||
"azure_mgmt_container_instance",
|
||||
"azure_mgmt_container_registry",
|
||||
"azure_mgmt_container_service",
|
||||
"azure_mgmt_customer_insights",
|
||||
"azure_mgmt_datalake_analytics",
|
||||
"azure_mgmt_datalake_store",
|
||||
"azure_mgmt_data_migration",
|
||||
"azure_mgmt_dev_spaces",
|
||||
"azure_mgmt_devtestlabs",
|
||||
"azure_mgmt_dns",
|
||||
"azure_mgmt_edgegateway",
|
||||
"azure_mgmt_advisor",
|
||||
"azure_mgmt_event_grid",
|
||||
"azure_mgmt_event_hub",
|
||||
"azure_mgmt_features",
|
||||
"azure_mgmt_hdinsight",
|
||||
"azure_mgmt_iot_central",
|
||||
"azure_mgmt_iot_hub",
|
||||
"azure_mgmt_key_vault",
|
||||
"azure_mgmt_kusto",
|
||||
"azure_mgmt_labservices",
|
||||
"azure_mgmt_links",
|
||||
"azure_mgmt_locks",
|
||||
"azure_mgmt_logic",
|
||||
"azure_mgmt_machine_learning",
|
||||
"azure_mgmt_machine_learning_services",
|
||||
"azure_mgmt_managed_applications",
|
||||
"azure_mgmt_mariadb",
|
||||
"azure_mgmt_marketplace_ordering",
|
||||
"azure_mgmt_media_services",
|
||||
"azure_mgmt_mixedreality",
|
||||
"azure_mgmt_monitor",
|
||||
"azure_mgmt_msi",
|
||||
"azure_mgmt_netapp",
|
||||
"azure_mgmt_network",
|
||||
"azure_mgmt_notification_hubs",
|
||||
"azure_mgmt_operational_insights",
|
||||
"azure_mgmt_policy",
|
||||
"azure_mgmt_policy_insights",
|
||||
"azure_mgmt_powerbi_embedded",
|
||||
"azure_mgmt_privatedns",
|
||||
"azure_mgmt_recovery_services",
|
||||
"azure_mgmt_recovery_services_backup",
|
||||
"azure_mgmt_recovery_services_site_recovery",
|
||||
"azure_mgmt_redis",
|
||||
"azure_mgmt_relay",
|
||||
"azure_mgmt_resources",
|
||||
"azure_mgmt_resources_management",
|
||||
"azure_mgmt_scheduler",
|
||||
"azure_mgmt_search",
|
||||
"azure_mgmt_security",
|
||||
"azure_mgmt_service_bus",
|
||||
"azure_mgmt_service_fabric",
|
||||
"azure_mgmt_signalr",
|
||||
"azure_mgmt_sql",
|
||||
"azure_mgmt_sqlvirtualmachine",
|
||||
"azure_mgmt_stor_simple8000_series",
|
||||
"azure_mgmt_storage",
|
||||
"azure_mgmt_stream_analytics",
|
||||
"azure_mgmt_subscriptions",
|
||||
"azure_mgmt_traffic_manager",
|
||||
"azure_mgmt_web"
|
||||
"azure_mgmt_monitor"
|
||||
],
|
||||
"data": [
|
||||
"azure_cognitiveservices_autosuggest",
|
||||
"azure_cognitiveservices_customimagesearch",
|
||||
"azure_cognitiveservices_computervision",
|
||||
"azure_cognitiveservices_contentmoderator",
|
||||
"azure_cognitiveservices_customsearch",
|
||||
"azure_cognitiveservices_customvisiontraining",
|
||||
"azure_cognitiveservices_customvisionprediction",
|
||||
"azure_cognitiveservices_entitysearch",
|
||||
"azure_cognitiveservices_face",
|
||||
"azure_cognitiveservices_imagesearch",
|
||||
"azure_cognitiveservices_localsearch",
|
||||
"azure_cognitiveservices_luisruntime",
|
||||
"azure_cognitiveservices_luisauthoring",
|
||||
"azure_cognitiveservices_newssearch",
|
||||
"azure_cognitiveservices_qnamaker",
|
||||
"azure_cognitiveservices_spellcheck",
|
||||
"azure_cognitiveservices_textanalytics",
|
||||
"azure_cognitiveservices_videosearch",
|
||||
"azure_cognitiveservices_websearch",
|
||||
"azure_cognitiveservices_visualsearch",
|
||||
"azure_event_grid",
|
||||
"azure_graph_rbac",
|
||||
"azure_key_vault",
|
||||
"azure_service_fabric"
|
||||
"azure_cognitiveservices_textanalytics"
|
||||
],
|
||||
"rollup": [
|
||||
"azure_sdk"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"rollup": {
|
||||
"azure_sdk": "0.22.5"
|
||||
"azure_sdk": "0.23.0"
|
||||
},
|
||||
"data": {
|
||||
"azure_cognitiveservices_autosuggest": "0.17.1",
|
||||
"azure_cognitiveservices_customimagesearch": "0.17.1",
|
||||
"azure_cognitiveservices_computervision": "0.18.1",
|
||||
"azure_cognitiveservices_computervision": "0.19.0",
|
||||
"azure_cognitiveservices_contentmoderator": "0.17.2",
|
||||
"azure_cognitiveservices_customsearch": "0.18.1",
|
||||
"azure_cognitiveservices_customvisiontraining": "0.17.1",
|
||||
|
@ -19,7 +19,7 @@
|
|||
"azure_cognitiveservices_newssearch": "0.18.1",
|
||||
"azure_cognitiveservices_qnamaker": "0.17.1",
|
||||
"azure_cognitiveservices_spellcheck": "0.18.1",
|
||||
"azure_cognitiveservices_textanalytics": "0.17.2",
|
||||
"azure_cognitiveservices_textanalytics": "0.17.3",
|
||||
"azure_cognitiveservices_videosearch": "0.18.1",
|
||||
"azure_cognitiveservices_websearch": "0.18.1",
|
||||
"azure_cognitiveservices_visualsearch": "0.18.1",
|
||||
|
@ -29,6 +29,7 @@
|
|||
"azure_service_fabric": "0.17.1"
|
||||
},
|
||||
"management" : {
|
||||
"azure_mgmt_advisor": "0.17.0",
|
||||
"azure_mgmt_analysis_services": "0.17.2",
|
||||
"azure_mgmt_api_management": "0.18.2",
|
||||
"azure_mgmt_authorization": "0.18.3",
|
||||
|
@ -51,7 +52,7 @@
|
|||
"azure_mgmt_devtestlabs": "0.17.3",
|
||||
"azure_mgmt_dns": "0.17.3",
|
||||
"azure_mgmt_edgegateway": "0.17.1",
|
||||
"azure_mgmt_event_grid": "0.17.4",
|
||||
"azure_mgmt_event_grid": "0.17.5",
|
||||
"azure_mgmt_event_hub": "0.17.2",
|
||||
"azure_mgmt_features": "0.17.2",
|
||||
"azure_mgmt_hdinsight": "0.17.2",
|
||||
|
@ -67,10 +68,10 @@
|
|||
"azure_mgmt_machine_learning_services": "0.17.1",
|
||||
"azure_mgmt_managed_applications": "0.17.2",
|
||||
"azure_mgmt_mariadb": "0.17.1",
|
||||
"azure_mgmt_marketplace_ordering": "0.17.2",
|
||||
"azure_mgmt_marketplace_ordering": "0.17.3",
|
||||
"azure_mgmt_media_services": "0.18.1",
|
||||
"azure_mgmt_mixedreality": "0.17.1",
|
||||
"azure_mgmt_monitor": "0.17.2",
|
||||
"azure_mgmt_monitor": "0.17.3",
|
||||
"azure_mgmt_msi": "0.17.1",
|
||||
"azure_mgmt_netapp": "0.17.1",
|
||||
"azure_mgmt_network": "0.18.5",
|
||||
|
|
|
@ -1,4 +1,21 @@
|
|||
{
|
||||
"azure_mgmt_advisor": {
|
||||
"azure_mgmt_advisor_2017_04_19": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/advisor/resource-manager/readme.md",
|
||||
"namespace": "Azure::Advisor::Mgmt::V2017_04_19",
|
||||
"tag": "package-2017-04"
|
||||
},
|
||||
"azure_mgmt_advisor_2017_03_31": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/advisor/resource-manager/readme.md",
|
||||
"namespace": "Azure::Advisor::Mgmt::V2017_03_31",
|
||||
"tag": "package-2017-03"
|
||||
},
|
||||
"azure_mgmt_advisor_2016_07_12_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/advisor/resource-manager/readme.md",
|
||||
"namespace": "Azure::Advisor::Mgmt::V2016_07_12_preview",
|
||||
"tag": "package-2016-07-preview"
|
||||
}
|
||||
},
|
||||
"azure_mgmt_analysis_services": {
|
||||
"azure_mgmt_analysis_services_2017_08_01": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/analysisservices/resource-manager/readme.md",
|
||||
|
@ -498,33 +515,38 @@
|
|||
}
|
||||
},
|
||||
"azure_mgmt_event_grid": {
|
||||
"azure_mgmt_event_grid_2019_02_01_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2019_02_01_preview",
|
||||
"tag": "package-2019-02-preview"
|
||||
},
|
||||
"azure_mgmt_event_grid_2019_01_01": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/eventgrid/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2019_01_01",
|
||||
"tag": "package-2019-01"
|
||||
},
|
||||
"azure_mgmt_event_grid_2018_09_15_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/eventgrid/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2018_09_15_preview",
|
||||
"tag": "package-2018-09-preview"
|
||||
},
|
||||
"azure_mgmt_event_grid_2018_05_01_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/eventgrid/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2018_05_01_preview",
|
||||
"tag": "package-2018-05-preview"
|
||||
},
|
||||
"azure_mgmt_event_grid_2018_01_01": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/eventgrid/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2018_01_01",
|
||||
"tag": "package-2018-01"
|
||||
},
|
||||
"azure_mgmt_event_grid_2017_09_15_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/eventgrid/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2017_09_15_preview",
|
||||
"tag": "package-2017-09-preview"
|
||||
},
|
||||
"azure_mgmt_event_grid_2017_06_15_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b980271c6202dd77735373cd172a89fad1d244d7/specification/eventgrid/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/eventgrid/resource-manager/readme.md",
|
||||
"namespace": "Azure::EventGrid::Mgmt::V2017_06_15_preview",
|
||||
"tag": "package-2017-06-preview"
|
||||
}
|
||||
|
@ -735,7 +757,7 @@
|
|||
},
|
||||
"azure_mgmt_marketplace_ordering": {
|
||||
"azure_mgmt_marketplace_ordering_2015_06_01": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/marketplaceordering/resource-manager/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/marketplaceordering/resource-manager/readme.md",
|
||||
"namespace": "Azure::MarketplaceOrdering::Mgmt::V2015_06_01",
|
||||
"tag": "package-2015-06-01"
|
||||
}
|
||||
|
@ -769,6 +791,37 @@
|
|||
}
|
||||
},
|
||||
"azure_mgmt_monitor": {
|
||||
"azure_mgmt_monitor_2019_03_01": {
|
||||
"input-file": [
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/actionGroups_API.json"
|
||||
],
|
||||
"namespace": "Azure::Monitor::Mgmt::V2019_03_01",
|
||||
"title": "MonitorClient"
|
||||
},
|
||||
"azure_mgmt_monitor_2018_09_01": {
|
||||
"input-file": [
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-09-01/actionGroups_API.json",
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-09-01/baseline_API.json",
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-09-01/calculateBaseline_API.json"
|
||||
],
|
||||
"namespace": "Azure::Monitor::Mgmt::V2018_09_01",
|
||||
"title": "MonitorClient"
|
||||
},
|
||||
"azure_mgmt_monitor_2018_11_27_preview": {
|
||||
"input-file": [
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json"
|
||||
],
|
||||
"namespace": "Azure::Monitor::Mgmt::V2018_11_27_preview",
|
||||
"title": "MonitorClient"
|
||||
},
|
||||
"azure_mgmt_monitor_2018_06_01_preview": {
|
||||
"input-file": [
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-06-01-preview/guestDiagnosticSettingsAssociation_API.json",
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-06-01-preview/guestDiagnosticSettings_API.json"
|
||||
],
|
||||
"namespace": "Azure::Monitor::Mgmt::V2018_06_01_preview",
|
||||
"title": "MonitorClient"
|
||||
},
|
||||
"azure_mgmt_monitor_2018_04_16": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/monitor/resource-manager/readme.md",
|
||||
"namespace": "Azure::Monitor::Mgmt::V2018_04_16",
|
||||
|
@ -787,6 +840,13 @@
|
|||
"title": "MonitorClient",
|
||||
"tag": "package-2018-01-01-only"
|
||||
},
|
||||
"azure_mgmt_monitor_2017_12_01_preview": {
|
||||
"input-file": [
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json"
|
||||
],
|
||||
"namespace": "Azure::Monitor::Mgmt::V2017_12_01_preview",
|
||||
"title": "MonitorClient"
|
||||
},
|
||||
"azure_mgmt_monitor_2017_11_01_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/monitor/resource-manager/readme.md",
|
||||
"namespace": "Azure::Monitor::Mgmt::V2017_11_01_preview",
|
||||
|
@ -1651,14 +1711,14 @@
|
|||
},
|
||||
"azure_cognitiveservices_computervision":{
|
||||
"azure_cognitiveservices_computervision_v2.0": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/cognitiveservices/data-plane/ComputerVision/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/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/6f4cee5d63793225c9f93f7952b02f619a46dd5d/specification/cognitiveservices/data-plane/ComputerVision/stable/v1.0/ComputerVision.json"
|
||||
"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/cognitiveservices/data-plane/ComputerVision/stable/v1.0/ComputerVision.json"
|
||||
],
|
||||
"namespace": "Azure::CognitiveServices::ComputerVision::V1_0",
|
||||
"title": "ComputerVisionClient"
|
||||
|
@ -1783,15 +1843,21 @@
|
|||
},
|
||||
"azure_cognitiveservices_textanalytics":{
|
||||
"azure_cognitiveservices_textanalytics_v2.0": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3869689cbdb70abe1804d639b6a6acce47232612/specification/cognitiveservices/data-plane/TextAnalytics/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/cognitiveservices/data-plane/TextAnalytics/readme.md",
|
||||
"namespace": "Azure::CognitiveServices::TextAnalytics::V2_0",
|
||||
"title": "TextAnalyticsClient",
|
||||
"tag": "release_2_0"
|
||||
},
|
||||
"azure_cognitiveservices_textanalytics_v2.1_preview": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3869689cbdb70abe1804d639b6a6acce47232612/specification/cognitiveservices/data-plane/TextAnalytics/readme.md",
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/cognitiveservices/data-plane/TextAnalytics/readme.md",
|
||||
"namespace": "Azure::CognitiveServices::TextAnalytics::V2_1_preview",
|
||||
"title": "TextAnalyticsClient",
|
||||
"tag": "release_2_1_preview"
|
||||
},
|
||||
"azure_cognitiveservices_textanalytics_v2.1": {
|
||||
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5a3fb7cc7cb3adb16f9da603e91c1c55048129d1/specification/cognitiveservices/data-plane/TextAnalytics/readme.md",
|
||||
"namespace": "Azure::CognitiveServices::TextAnalytics::V2_1",
|
||||
"title": "TextAnalyticsClient",
|
||||
"tag": "release_2_1"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
{
|
||||
"Microsoft.Advisor": {
|
||||
"management": {
|
||||
"path": "management/azure_mgmt_advisor",
|
||||
"namespace": "Azure::Advisor::Mgmt",
|
||||
"module_require": "azure_mgmt_advisor"
|
||||
}
|
||||
},
|
||||
"Microsoft.AnalysisServices": {
|
||||
"management": {
|
||||
"path": "management/azure_mgmt_analysis_services",
|
||||
|
|
|
@ -141,6 +141,11 @@
|
|||
{
|
||||
"name": "Latest",
|
||||
"resourceTypes": {
|
||||
"Microsoft.Advisor": {
|
||||
"management": {
|
||||
"2017-04-19": ["*"]
|
||||
}
|
||||
},
|
||||
"Microsoft.AnalysisServices": {
|
||||
"management": {
|
||||
"2017-08-01": ["*"]
|
||||
|
@ -262,7 +267,7 @@
|
|||
},
|
||||
"Microsoft.EventGrid": {
|
||||
"management": {
|
||||
"2019-01-01": ["*"]
|
||||
"2019-02-01-preview": ["*"]
|
||||
},
|
||||
"data": {
|
||||
"2018-01-01": ["*"]
|
||||
|
@ -373,9 +378,12 @@
|
|||
"2017-04-01": ["*"],
|
||||
"2017-05-01-preview": ["*"],
|
||||
"2017-11-01-preview": ["*"],
|
||||
"2017-12-01-preview": ["*"],
|
||||
"2018-01-01": ["*"],
|
||||
"2018-03-01": ["*"],
|
||||
"2018-04-16": ["*"]
|
||||
"2018-04-16": ["*"],
|
||||
"2018-11-27-preview": ["*"],
|
||||
"2019-03-01": ["*"]
|
||||
}
|
||||
},
|
||||
"Microsoft.ManagedServiceIdentity": {
|
||||
|
@ -623,7 +631,7 @@
|
|||
},
|
||||
"Microsoft.CognitiveServices.TextAnalytics": {
|
||||
"data": {
|
||||
"v2.1-preview": ["*"]
|
||||
"v2.1": ["*"]
|
||||
}
|
||||
},
|
||||
"Microsoft.CognitiveServices.VideoSearch": {
|
||||
|
@ -647,6 +655,20 @@
|
|||
]
|
||||
},
|
||||
"management" : {
|
||||
"azure_mgmt_advisor": [
|
||||
{
|
||||
"name": "Latest",
|
||||
"resourceTypes": {
|
||||
"Microsoft.Advisor": {
|
||||
"management": {
|
||||
"2017-04-19": ["*"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"output_dir": "management/azure_mgmt_advisor/lib/profiles",
|
||||
"individual_gem_profile": true
|
||||
}
|
||||
],
|
||||
"azure_mgmt_analysis_services": [
|
||||
{
|
||||
"name": "Latest",
|
||||
|
@ -1043,7 +1065,7 @@
|
|||
"resourceTypes": {
|
||||
"Microsoft.EventGrid" : {
|
||||
"management": {
|
||||
"2019-01-01": ["*"]
|
||||
"2019-02-01-preview": ["*"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1385,7 +1407,13 @@
|
|||
"2016-03-01": ["*"],
|
||||
"2017-04-01": ["*"],
|
||||
"2017-05-01-preview": ["*"],
|
||||
"2017-11-01-preview": ["*"]
|
||||
"2017-11-01-preview": ["*"],
|
||||
"2017-12-01-preview": ["*"],
|
||||
"2018-01-01": ["*"],
|
||||
"2018-03-01": ["*"],
|
||||
"2018-04-16": ["*"],
|
||||
"2018-11-27-preview": ["*"],
|
||||
"2019-03-01": ["*"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -2204,7 +2232,7 @@
|
|||
"resourceTypes": {
|
||||
"Microsoft.CognitiveServices.TextAnalytics" : {
|
||||
"data": {
|
||||
"v2.1-preview": ["*"]
|
||||
"v2.1": ["*"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2254,7 +2254,7 @@ module Azure::CognitiveServices::ComputerVision::V1_0
|
|||
#
|
||||
def add_telemetry
|
||||
sdk_information = 'azure_cognitiveservices_computervision'
|
||||
sdk_information = "#{sdk_information}/0.18.1"
|
||||
sdk_information = "#{sdk_information}/0.19.0"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -40,27 +40,31 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
autoload :OcrResult, '2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.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 :LandmarkResults, '2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.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 :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 :AreaOfInterestResult, '2.0/generated/azure_cognitiveservices_computervision/models/area_of_interest_result.rb'
|
||||
autoload :ImageDescription, '2.0/generated/azure_cognitiveservices_computervision/models/image_description.rb'
|
||||
autoload :ImageUrl, '2.0/generated/azure_cognitiveservices_computervision/models/image_url.rb'
|
||||
autoload :CategoryDetail, '2.0/generated/azure_cognitiveservices_computervision/models/category_detail.rb'
|
||||
autoload :ComputerVisionError, '2.0/generated/azure_cognitiveservices_computervision/models/computer_vision_error.rb'
|
||||
autoload :ImageType, '2.0/generated/azure_cognitiveservices_computervision/models/image_type.rb'
|
||||
autoload :LandmarkResults, '2.0/generated/azure_cognitiveservices_computervision/models/landmark_results.rb'
|
||||
autoload :FaceDescription, '2.0/generated/azure_cognitiveservices_computervision/models/face_description.rb'
|
||||
autoload :CelebrityResults, '2.0/generated/azure_cognitiveservices_computervision/models/celebrity_results.rb'
|
||||
autoload :DetectedBrand, '2.0/generated/azure_cognitiveservices_computervision/models/detected_brand.rb'
|
||||
autoload :Word, '2.0/generated/azure_cognitiveservices_computervision/models/word.rb'
|
||||
autoload :CelebritiesModel, '2.0/generated/azure_cognitiveservices_computervision/models/celebrities_model.rb'
|
||||
autoload :Line, '2.0/generated/azure_cognitiveservices_computervision/models/line.rb'
|
||||
autoload :ImageCaption, '2.0/generated/azure_cognitiveservices_computervision/models/image_caption.rb'
|
||||
autoload :TextRecognitionResult, '2.0/generated/azure_cognitiveservices_computervision/models/text_recognition_result.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 :ObjectHierarchy, '2.0/generated/azure_cognitiveservices_computervision/models/object_hierarchy.rb'
|
||||
autoload :ReadOperationResult, '2.0/generated/azure_cognitiveservices_computervision/models/read_operation_result.rb'
|
||||
autoload :AdultInfo, '2.0/generated/azure_cognitiveservices_computervision/models/adult_info.rb'
|
||||
autoload :Gender, '2.0/generated/azure_cognitiveservices_computervision/models/gender.rb'
|
||||
autoload :TextOperationStatusCodes, '2.0/generated/azure_cognitiveservices_computervision/models/text_operation_status_codes.rb'
|
||||
autoload :TextRecognitionResultDimensionUnit, '2.0/generated/azure_cognitiveservices_computervision/models/text_recognition_result_dimension_unit.rb'
|
||||
autoload :TextRecognitionResultConfidenceClass, '2.0/generated/azure_cognitiveservices_computervision/models/text_recognition_result_confidence_class.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'
|
||||
|
|
|
@ -136,7 +136,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# - 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.
|
||||
# Objects argument is only available in English. Brands - detects various
|
||||
# brands within an image, including the approximate location. The Brands
|
||||
# argument is only available in English.
|
||||
# @param details [Array<Details>] 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
|
||||
|
@ -180,7 +182,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# - 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.
|
||||
# Objects argument is only available in English. Brands - detects various
|
||||
# brands within an image, including the approximate location. The Brands
|
||||
# argument is only available in English.
|
||||
# @param details [Array<Details>] 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
|
||||
|
@ -223,7 +227,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# - 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.
|
||||
# Objects argument is only available in English. Brands - detects various
|
||||
# brands within an image, including the approximate location. The Brands
|
||||
# argument is only available in English.
|
||||
# @param details [Array<Details>] 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
|
||||
|
@ -1566,6 +1572,211 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# Use this interface to get the result of a Read operation, employing the
|
||||
# state-of-the-art Optical Character Recognition (OCR) algorithms optimized for
|
||||
# text-heavy documents. When you use the Read File interface, the response
|
||||
# contains a field called "Operation-Location". The "Operation-Location" field
|
||||
# contains the URL that you must use for your "Read Operation Result" operation
|
||||
# to access OCR results.
|
||||
#
|
||||
# @param mode [TextRecognitionMode] Type of text to recognize. Possible values
|
||||
# include: 'Handwritten', 'Printed'
|
||||
# @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.
|
||||
#
|
||||
#
|
||||
def batch_read_file(url, mode, custom_headers:nil)
|
||||
response = batch_read_file_async(url, mode, custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Use this interface to get the result of a Read operation, employing the
|
||||
# state-of-the-art Optical Character Recognition (OCR) algorithms optimized for
|
||||
# text-heavy documents. When you use the Read File interface, the response
|
||||
# contains a field called "Operation-Location". The "Operation-Location" field
|
||||
# contains the URL that you must use for your "Read Operation Result" operation
|
||||
# to access OCR results.
|
||||
#
|
||||
# @param mode [TextRecognitionMode] Type of text to recognize. Possible values
|
||||
# include: 'Handwritten', 'Printed'
|
||||
# @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 batch_read_file_with_http_info(url, mode, custom_headers:nil)
|
||||
batch_read_file_async(url, mode, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Use this interface to get the result of a Read operation, employing the
|
||||
# state-of-the-art Optical Character Recognition (OCR) algorithms optimized for
|
||||
# text-heavy documents. When you use the Read File interface, the response
|
||||
# contains a field called "Operation-Location". The "Operation-Location" field
|
||||
# contains the URL that you must use for your "Read Operation Result" operation
|
||||
# to access OCR results.
|
||||
#
|
||||
# @param mode [TextRecognitionMode] Type of text to recognize. Possible values
|
||||
# include: 'Handwritten', 'Printed'
|
||||
# @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 batch_read_file_async(url, mode, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
||||
fail ArgumentError, 'mode is nil' if mode.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 = 'read/core/asyncBatchAnalyze'
|
||||
|
||||
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: {'mode' => mode},
|
||||
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 == 202
|
||||
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?
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# This interface is used for getting OCR results of Read operation. The URL to
|
||||
# this interface should be retrieved from "Operation-Location" field returned
|
||||
# from Batch Read File interface.
|
||||
#
|
||||
# @param operation_id [String] Id of read operation returned in the response of
|
||||
# the "Batch Read File" interface.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ReadOperationResult] operation results.
|
||||
#
|
||||
def get_read_operation_result(operation_id, custom_headers:nil)
|
||||
response = get_read_operation_result_async(operation_id, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# This interface is used for getting OCR results of Read operation. The URL to
|
||||
# this interface should be retrieved from "Operation-Location" field returned
|
||||
# from Batch Read File interface.
|
||||
#
|
||||
# @param operation_id [String] Id of read operation returned in the response of
|
||||
# the "Batch Read File" interface.
|
||||
# @param custom_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_read_operation_result_with_http_info(operation_id, custom_headers:nil)
|
||||
get_read_operation_result_async(operation_id, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# This interface is used for getting OCR results of Read operation. The URL to
|
||||
# this interface should be retrieved from "Operation-Location" field returned
|
||||
# from Batch Read File interface.
|
||||
#
|
||||
# @param operation_id [String] Id of read operation returned in the response of
|
||||
# the "Batch Read File" interface.
|
||||
# @param [Hash{String => String}] 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_read_operation_result_async(operation_id, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
||||
fail ArgumentError, 'operation_id is nil' if operation_id.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'] = accept_language unless accept_language.nil?
|
||||
path_template = 'read/operations/{operationId}'
|
||||
|
||||
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: {'operationId' => operation_id},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = self.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 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::ReadOperationResult.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 extracts a rich set of visual features based on the image
|
||||
# content.
|
||||
|
@ -1590,7 +1801,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# - 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.
|
||||
# Objects argument is only available in English. Brands - detects various
|
||||
# brands within an image, including the approximate location. The Brands
|
||||
# argument is only available in English.
|
||||
# @param details [Array<Details>] 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
|
||||
|
@ -1634,7 +1847,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# - 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.
|
||||
# Objects argument is only available in English. Brands - detects various
|
||||
# brands within an image, including the approximate location. The Brands
|
||||
# argument is only available in English.
|
||||
# @param details [Array<Details>] 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
|
||||
|
@ -1677,7 +1892,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# - 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.
|
||||
# Objects argument is only available in English. Brands - detects various
|
||||
# brands within an image, including the approximate location. The Brands
|
||||
# argument is only available in English.
|
||||
# @param details [Array<Details>] 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
|
||||
|
@ -2845,6 +3062,117 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# Use this interface to get the result of a Read Document operation, employing
|
||||
# the state-of-the-art Optical Character Recognition (OCR) algorithms optimized
|
||||
# for text-heavy documents. When you use the Read Document interface, the
|
||||
# response contains a field called "Operation-Location". The
|
||||
# "Operation-Location" field contains the URL that you must use for your "Get
|
||||
# Read Result operation" to access OCR results.
|
||||
#
|
||||
# @param image An image stream.
|
||||
# @param mode [TextRecognitionMode] Type of text to recognize. Possible values
|
||||
# include: 'Handwritten', 'Printed'
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def batch_read_file_in_stream(image, mode, custom_headers:nil)
|
||||
response = batch_read_file_in_stream_async(image, mode, custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Use this interface to get the result of a Read Document operation, employing
|
||||
# the state-of-the-art Optical Character Recognition (OCR) algorithms optimized
|
||||
# for text-heavy documents. When you use the Read Document interface, the
|
||||
# response contains a field called "Operation-Location". The
|
||||
# "Operation-Location" field contains the URL that you must use for your "Get
|
||||
# Read Result operation" to access OCR results.
|
||||
#
|
||||
# @param image An image stream.
|
||||
# @param mode [TextRecognitionMode] Type of text to recognize. Possible values
|
||||
# include: 'Handwritten', 'Printed'
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
||||
#
|
||||
def batch_read_file_in_stream_with_http_info(image, mode, custom_headers:nil)
|
||||
batch_read_file_in_stream_async(image, mode, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Use this interface to get the result of a Read Document operation, employing
|
||||
# the state-of-the-art Optical Character Recognition (OCR) algorithms optimized
|
||||
# for text-heavy documents. When you use the Read Document interface, the
|
||||
# response contains a field called "Operation-Location". The
|
||||
# "Operation-Location" field contains the URL that you must use for your "Get
|
||||
# Read Result operation" to access OCR results.
|
||||
#
|
||||
# @param image An image stream.
|
||||
# @param mode [TextRecognitionMode] Type of text to recognize. Possible values
|
||||
# include: 'Handwritten', 'Printed'
|
||||
# @param [Hash{String => String}] A hash of custom headers that will be added
|
||||
# to the HTTP request.
|
||||
#
|
||||
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
||||
#
|
||||
def batch_read_file_in_stream_async(image, mode, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
||||
fail ArgumentError, 'image is nil' if image.nil?
|
||||
fail ArgumentError, 'mode is nil' if mode.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 = 'read/core/asyncBatchAnalyze'
|
||||
|
||||
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: {'mode' => mode},
|
||||
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 == 202
|
||||
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?
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
promise.execute
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
#
|
||||
|
@ -2852,7 +3180,7 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
#
|
||||
def add_telemetry
|
||||
sdk_information = 'azure_cognitiveservices_computervision'
|
||||
sdk_information = "#{sdk_information}/0.18.1"
|
||||
sdk_information = "#{sdk_information}/0.19.0"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
#
|
||||
# A brand detected in an image.
|
||||
#
|
||||
class DetectedBrand
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Label for the brand.
|
||||
attr_accessor :name
|
||||
|
||||
# @return [Float] Confidence score of having observed the brand in the
|
||||
# image, as a value ranging from 0 to 1.
|
||||
attr_accessor :confidence
|
||||
|
||||
# @return [BoundingRect] Approximate location of the detected brand.
|
||||
attr_accessor :rectangle
|
||||
|
||||
|
||||
#
|
||||
# Mapper for DetectedBrand class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'DetectedBrand',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DetectedBrand',
|
||||
model_properties: {
|
||||
name: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'name',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
confidence: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'confidence',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
rectangle: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'rectangle',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'BoundingRect'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -42,6 +42,9 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# detected in the image.
|
||||
attr_accessor :objects
|
||||
|
||||
# @return [Array<DetectedBrand>] Array of brands detected in the image.
|
||||
attr_accessor :brands
|
||||
|
||||
# @return [String] Id of the REST API request.
|
||||
attr_accessor :request_id
|
||||
|
||||
|
@ -166,6 +169,23 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
}
|
||||
}
|
||||
},
|
||||
brands: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'brands',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'DetectedBrandElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DetectedBrand'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
request_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
|
|
|
@ -6,20 +6,19 @@
|
|||
module Azure::CognitiveServices::ComputerVision::V2_0
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
# Json object representing a recognized text line.
|
||||
#
|
||||
class Line
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<Integer>]
|
||||
# @return [Array<Integer>] Bounding box of a recognized line.
|
||||
attr_accessor :bounding_box
|
||||
|
||||
# @return [String]
|
||||
# @return [String] The text content of the line.
|
||||
attr_accessor :text
|
||||
|
||||
# @return [Array<Word>]
|
||||
# @return [Array<Word>] List of words in the text line.
|
||||
attr_accessor :words
|
||||
|
||||
|
||||
|
|
|
@ -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::CognitiveServices::ComputerVision::V2_0
|
||||
module Models
|
||||
#
|
||||
# OCR result of the read operation.
|
||||
#
|
||||
class ReadOperationResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [TextOperationStatusCodes] Status of the read operation.
|
||||
# Possible values include: 'Not Started', 'Running', 'Failed',
|
||||
# 'Succeeded'
|
||||
attr_accessor :status
|
||||
|
||||
# @return [Array<TextRecognitionResult>] A array of text recognition
|
||||
# result of the read operation.
|
||||
attr_accessor :recognition_results
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ReadOperationResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ReadOperationResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ReadOperationResult',
|
||||
model_properties: {
|
||||
status: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'status',
|
||||
type: {
|
||||
name: 'Enum',
|
||||
module: 'TextOperationStatusCodes'
|
||||
}
|
||||
},
|
||||
recognition_results: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'recognitionResults',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'TextRecognitionResultElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'TextRecognitionResult'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -6,8 +6,7 @@
|
|||
module Azure::CognitiveServices::ComputerVision::V2_0
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
# Result of recognition text operation.
|
||||
#
|
||||
class TextOperationResult
|
||||
|
||||
|
@ -18,7 +17,8 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
# 'Succeeded'
|
||||
attr_accessor :status
|
||||
|
||||
# @return [RecognitionResult]
|
||||
# @return [TextRecognitionResult] Text recognition result of the text
|
||||
# operation.
|
||||
attr_accessor :recognition_result
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
serialized_name: 'recognitionResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RecognitionResult'
|
||||
class_name: 'TextRecognitionResult'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
# encoding: utf-8
|
||||
# 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
|
||||
#
|
||||
# Json object representing a recognized text region
|
||||
#
|
||||
class TextRecognitionResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Integer] The 1-based page number of the recognition result.
|
||||
attr_accessor :page
|
||||
|
||||
# @return [Float] The orientation of the image in degrees in the
|
||||
# clockwise direction. Range between [0, 360).
|
||||
attr_accessor :clockwise_orientation
|
||||
|
||||
# @return [Float] The width of the image in pixels or the PDF in inches.
|
||||
attr_accessor :width
|
||||
|
||||
# @return [Float] The height of the image in pixels or the PDF in inches.
|
||||
attr_accessor :height
|
||||
|
||||
# @return [TextRecognitionResultDimensionUnit] The unit used in the
|
||||
# Width, Height and BoundingBox. For images, the unit is "pixel". For
|
||||
# PDF, the unit is "inch". Possible values include: 'pixel', 'inch'
|
||||
attr_accessor :unit
|
||||
|
||||
# @return [Array<Line>] A list of recognized text lines.
|
||||
attr_accessor :lines
|
||||
|
||||
|
||||
#
|
||||
# Mapper for TextRecognitionResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'TextRecognitionResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'TextRecognitionResult',
|
||||
model_properties: {
|
||||
page: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'page',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
},
|
||||
clockwise_orientation: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'clockwiseOrientation',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
width: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'width',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
height: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'height',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
unit: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'unit',
|
||||
type: {
|
||||
name: 'Enum',
|
||||
module: 'TextRecognitionResultDimensionUnit'
|
||||
}
|
||||
},
|
||||
lines: {
|
||||
client_side_validation: true,
|
||||
required: true,
|
||||
serialized_name: 'lines',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'LineElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'Line'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::ComputerVision::V2_0
|
||||
module Models
|
||||
#
|
||||
# Defines values for TextRecognitionResultConfidenceClass
|
||||
#
|
||||
module TextRecognitionResultConfidenceClass
|
||||
High = "High"
|
||||
Low = "Low"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::ComputerVision::V2_0
|
||||
module Models
|
||||
#
|
||||
# Defines values for TextRecognitionResultDimensionUnit
|
||||
#
|
||||
module TextRecognitionResultDimensionUnit
|
||||
Pixel = "pixel"
|
||||
Inch = "inch"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -17,6 +17,7 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
Tags = "Tags"
|
||||
Description = "Description"
|
||||
Objects = "Objects"
|
||||
Brands = "Brands"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,19 +6,22 @@
|
|||
module Azure::CognitiveServices::ComputerVision::V2_0
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
# Json object representing a recognized word.
|
||||
#
|
||||
class Word
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<Integer>]
|
||||
# @return [Array<Integer>] Bounding box of a recognized word.
|
||||
attr_accessor :bounding_box
|
||||
|
||||
# @return [String]
|
||||
# @return [String] The text content of the word.
|
||||
attr_accessor :text
|
||||
|
||||
# @return [TextRecognitionResultConfidenceClass] Qualitative confidence
|
||||
# measure. Possible values include: 'High', 'Low'
|
||||
attr_accessor :confidence
|
||||
|
||||
|
||||
#
|
||||
# Mapper for Word class as Ruby Hash.
|
||||
|
@ -35,7 +38,7 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
model_properties: {
|
||||
bounding_box: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
required: true,
|
||||
serialized_name: 'boundingBox',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
|
@ -51,11 +54,20 @@ module Azure::CognitiveServices::ComputerVision::V2_0
|
|||
},
|
||||
text: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
required: true,
|
||||
serialized_name: 'text',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
confidence: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'confidence',
|
||||
type: {
|
||||
name: 'Enum',
|
||||
module: 'TextRecognitionResultConfidenceClass'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,27 +24,31 @@ module Azure::ComputerVision::Profiles::Latest
|
|||
OcrResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult
|
||||
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
|
||||
LandmarkResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults
|
||||
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
|
||||
FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult
|
||||
AreaOfInterestResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult
|
||||
ImageDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription
|
||||
ImageUrl = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl
|
||||
CategoryDetail = Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail
|
||||
ComputerVisionError = Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError
|
||||
ImageType = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType
|
||||
LandmarkResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults
|
||||
FaceDescription = Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
CelebrityResults = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults
|
||||
DetectedBrand = Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedBrand
|
||||
Word = Azure::CognitiveServices::ComputerVision::V2_0::Models::Word
|
||||
CelebritiesModel = Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel
|
||||
Line = Azure::CognitiveServices::ComputerVision::V2_0::Models::Line
|
||||
ImageCaption = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption
|
||||
TextRecognitionResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResult
|
||||
ImageAnalysis = Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis
|
||||
TextOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult
|
||||
ObjectHierarchy = Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy
|
||||
ReadOperationResult = Azure::CognitiveServices::ComputerVision::V2_0::Models::ReadOperationResult
|
||||
AdultInfo = Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo
|
||||
Gender = Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender
|
||||
TextOperationStatusCodes = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes
|
||||
TextRecognitionResultDimensionUnit = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultDimensionUnit
|
||||
TextRecognitionResultConfidenceClass = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultConfidenceClass
|
||||
OcrLanguages = Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages
|
||||
VisualFeatureTypes = Azure::CognitiveServices::ComputerVision::V2_0::Models::VisualFeatureTypes
|
||||
TextRecognitionMode = Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionMode
|
||||
|
@ -146,62 +150,68 @@ module Azure::ComputerVision::Profiles::Latest
|
|||
def tag_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TagResult
|
||||
end
|
||||
def image_analysis
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis
|
||||
def image_metadata
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata
|
||||
end
|
||||
def area_of_interest_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::AreaOfInterestResult
|
||||
end
|
||||
def celebrities_model
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel
|
||||
def image_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription
|
||||
end
|
||||
def image_url
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageUrl
|
||||
end
|
||||
def adult_info
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo
|
||||
def category_detail
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail
|
||||
end
|
||||
def computer_vision_error
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ComputerVisionError
|
||||
end
|
||||
def image_caption
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption
|
||||
def image_type
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType
|
||||
end
|
||||
def landmark_results
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::LandmarkResults
|
||||
end
|
||||
def object_hierarchy
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy
|
||||
def face_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
end
|
||||
def celebrity_results
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebrityResults
|
||||
end
|
||||
def image_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageDescription
|
||||
def detected_brand
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::DetectedBrand
|
||||
end
|
||||
def word
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::Word
|
||||
end
|
||||
def image_type
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageType
|
||||
def celebrities_model
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CelebritiesModel
|
||||
end
|
||||
def line
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::Line
|
||||
end
|
||||
def image_metadata
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageMetadata
|
||||
def image_caption
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageCaption
|
||||
end
|
||||
def recognition_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::RecognitionResult
|
||||
def text_recognition_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResult
|
||||
end
|
||||
def face_description
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::FaceDescription
|
||||
def image_analysis
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ImageAnalysis
|
||||
end
|
||||
def text_operation_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationResult
|
||||
end
|
||||
def category_detail
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::CategoryDetail
|
||||
def object_hierarchy
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ObjectHierarchy
|
||||
end
|
||||
def read_operation_result
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::ReadOperationResult
|
||||
end
|
||||
def adult_info
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::AdultInfo
|
||||
end
|
||||
def gender
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::Gender
|
||||
|
@ -209,6 +219,12 @@ module Azure::ComputerVision::Profiles::Latest
|
|||
def text_operation_status_codes
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextOperationStatusCodes
|
||||
end
|
||||
def text_recognition_result_dimension_unit
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultDimensionUnit
|
||||
end
|
||||
def text_recognition_result_confidence_class
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::TextRecognitionResultConfidenceClass
|
||||
end
|
||||
def ocr_languages
|
||||
Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrLanguages
|
||||
end
|
||||
|
|
|
@ -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.18.1'
|
||||
VERSION = '0.19.0'
|
||||
end
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
require 'v2.0/generated/azure_cognitiveservices_textanalytics'
|
||||
require 'v2.1/generated/azure_cognitiveservices_textanalytics'
|
||||
require 'v2.1-preview/generated/azure_cognitiveservices_textanalytics'
|
||||
require 'profiles/latest/textanalytics_latest_profile_client'
|
||||
|
|
|
@ -7,24 +7,26 @@ require 'azure_cognitiveservices_textanalytics'
|
|||
module Azure::TextAnalytics::Profiles::Latest
|
||||
|
||||
module Models
|
||||
DetectedLanguage = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::DetectedLanguage
|
||||
MultiLanguageInput = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageInput
|
||||
LanguageBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResultItem
|
||||
KeyPhraseBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResultItem
|
||||
LanguageBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResult
|
||||
KeyPhraseBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResult
|
||||
SentimentBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResultItem
|
||||
ErrorResponse = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorResponse
|
||||
SentimentBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResult
|
||||
BatchInput = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::BatchInput
|
||||
MatchRecordV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MatchRecordV2dot1
|
||||
ErrorRecord = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorRecord
|
||||
EntityRecordV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntityRecordV2dot1
|
||||
Input = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::Input
|
||||
EntitiesBatchResultItemV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultItemV2dot1
|
||||
InternalError = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::InternalError
|
||||
EntitiesBatchResultV2dot1 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultV2dot1
|
||||
MultiLanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageBatchInput
|
||||
ErrorResponse = Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorResponse
|
||||
MultiLanguageInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageInput
|
||||
KeyPhraseBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResultItem
|
||||
MatchRecord = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MatchRecord
|
||||
KeyPhraseBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResult
|
||||
DocumentStatistics = Azure::CognitiveServices::TextAnalytics::V2_1::Models::DocumentStatistics
|
||||
LanguageInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageInput
|
||||
ErrorRecord = Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorRecord
|
||||
LanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchInput
|
||||
EntitiesBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResult
|
||||
DetectedLanguage = Azure::CognitiveServices::TextAnalytics::V2_1::Models::DetectedLanguage
|
||||
MultiLanguageBatchInput = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput
|
||||
LanguageBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResultItem
|
||||
EntitiesBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResultItem
|
||||
LanguageBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResult
|
||||
InternalError = Azure::CognitiveServices::TextAnalytics::V2_1::Models::InternalError
|
||||
SentimentBatchResultItem = Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResultItem
|
||||
RequestStatistics = Azure::CognitiveServices::TextAnalytics::V2_1::Models::RequestStatistics
|
||||
SentimentBatchResult = Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResult
|
||||
EntityRecord = Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntityRecord
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -46,7 +48,7 @@ module Azure::TextAnalytics::Profiles::Latest
|
|||
@base_url = options[:base_url].nil? ? nil:options[:base_url]
|
||||
@options = options[:options].nil? ? nil:options[:options]
|
||||
|
||||
@client_0 = Azure::CognitiveServices::TextAnalytics::V2_1_preview::TextAnalyticsClient.new(configurable.credentials, options)
|
||||
@client_0 = Azure::CognitiveServices::TextAnalytics::V2_1::TextAnalyticsClient.new(configurable.credentials, options)
|
||||
if(@client_0.respond_to?(:subscription_id))
|
||||
@client_0.subscription_id = configurable.subscription_id
|
||||
end
|
||||
|
@ -71,59 +73,65 @@ module Azure::TextAnalytics::Profiles::Latest
|
|||
end
|
||||
|
||||
class ModelClasses
|
||||
def detected_language
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::DetectedLanguage
|
||||
def error_response
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorResponse
|
||||
end
|
||||
def multi_language_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageInput
|
||||
end
|
||||
def language_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResultItem
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageInput
|
||||
end
|
||||
def key_phrase_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResultItem
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResultItem
|
||||
end
|
||||
def language_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::LanguageBatchResult
|
||||
def match_record
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::MatchRecord
|
||||
end
|
||||
def key_phrase_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::KeyPhraseBatchResult
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::KeyPhraseBatchResult
|
||||
end
|
||||
def sentiment_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResultItem
|
||||
def document_statistics
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::DocumentStatistics
|
||||
end
|
||||
def error_response
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorResponse
|
||||
end
|
||||
def sentiment_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::SentimentBatchResult
|
||||
end
|
||||
def batch_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::BatchInput
|
||||
end
|
||||
def match_record_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MatchRecordV2dot1
|
||||
def language_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageInput
|
||||
end
|
||||
def error_record
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::ErrorRecord
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorRecord
|
||||
end
|
||||
def entity_record_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntityRecordV2dot1
|
||||
def language_batch_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchInput
|
||||
end
|
||||
def input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::Input
|
||||
def entities_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResult
|
||||
end
|
||||
def entities_batch_result_item_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultItemV2dot1
|
||||
end
|
||||
def internal_error
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::InternalError
|
||||
end
|
||||
def entities_batch_result_v2dot1
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::EntitiesBatchResultV2dot1
|
||||
def detected_language
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::DetectedLanguage
|
||||
end
|
||||
def multi_language_batch_input
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1_preview::Models::MultiLanguageBatchInput
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput
|
||||
end
|
||||
def language_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResultItem
|
||||
end
|
||||
def entities_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntitiesBatchResultItem
|
||||
end
|
||||
def language_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchResult
|
||||
end
|
||||
def internal_error
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::InternalError
|
||||
end
|
||||
def sentiment_batch_result_item
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResultItem
|
||||
end
|
||||
def request_statistics
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::RequestStatistics
|
||||
end
|
||||
def sentiment_batch_result
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResult
|
||||
end
|
||||
def entity_record
|
||||
Azure::CognitiveServices::TextAnalytics::V2_1::Models::EntityRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -561,7 +561,7 @@ module Azure::CognitiveServices::TextAnalytics::V2_0
|
|||
#
|
||||
def add_telemetry
|
||||
sdk_information = 'azure_cognitiveservices_textanalytics'
|
||||
sdk_information = "#{sdk_information}/0.17.2"
|
||||
sdk_information = "#{sdk_information}/0.17.3"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -597,7 +597,7 @@ module Azure::CognitiveServices::TextAnalytics::V2_1_preview
|
|||
#
|
||||
def add_telemetry
|
||||
sdk_information = 'azure_cognitiveservices_textanalytics'
|
||||
sdk_information = "#{sdk_information}/0.17.2"
|
||||
sdk_information = "#{sdk_information}/0.17.3"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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.
|
||||
|
||||
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 'v2.1/generated/azure_cognitiveservices_textanalytics/module_definition'
|
||||
require 'ms_rest_azure'
|
||||
|
||||
module Azure::CognitiveServices::TextAnalytics::V2_1
|
||||
autoload :TextAnalyticsClient, 'v2.1/generated/azure_cognitiveservices_textanalytics/text_analytics_client.rb'
|
||||
|
||||
module Models
|
||||
autoload :ErrorResponse, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/error_response.rb'
|
||||
autoload :MultiLanguageInput, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/multi_language_input.rb'
|
||||
autoload :KeyPhraseBatchResultItem, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result_item.rb'
|
||||
autoload :MatchRecord, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/match_record.rb'
|
||||
autoload :KeyPhraseBatchResult, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/key_phrase_batch_result.rb'
|
||||
autoload :DocumentStatistics, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/document_statistics.rb'
|
||||
autoload :LanguageInput, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/language_input.rb'
|
||||
autoload :ErrorRecord, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/error_record.rb'
|
||||
autoload :LanguageBatchInput, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/language_batch_input.rb'
|
||||
autoload :EntitiesBatchResult, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/entities_batch_result.rb'
|
||||
autoload :DetectedLanguage, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/detected_language.rb'
|
||||
autoload :MultiLanguageBatchInput, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/multi_language_batch_input.rb'
|
||||
autoload :LanguageBatchResultItem, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/language_batch_result_item.rb'
|
||||
autoload :EntitiesBatchResultItem, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/entities_batch_result_item.rb'
|
||||
autoload :LanguageBatchResult, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/language_batch_result.rb'
|
||||
autoload :InternalError, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/internal_error.rb'
|
||||
autoload :SentimentBatchResultItem, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/sentiment_batch_result_item.rb'
|
||||
autoload :RequestStatistics, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/request_statistics.rb'
|
||||
autoload :SentimentBatchResult, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/sentiment_batch_result.rb'
|
||||
autoload :EntityRecord, 'v2.1/generated/azure_cognitiveservices_textanalytics/models/entity_record.rb'
|
||||
end
|
||||
end
|
|
@ -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::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class DetectedLanguage
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Long name of a detected language (e.g. English,
|
||||
# French).
|
||||
attr_accessor :name
|
||||
|
||||
# @return [String] A two letter representation of the detected language
|
||||
# according to the ISO 639-1 standard (e.g. en, fr).
|
||||
attr_accessor :iso6391name
|
||||
|
||||
# @return [Float] A confidence score between 0 and 1. Scores close to 1
|
||||
# indicate 100% certainty that the identified language is true.
|
||||
attr_accessor :score
|
||||
|
||||
|
||||
#
|
||||
# Mapper for DetectedLanguage class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'DetectedLanguage',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DetectedLanguage',
|
||||
model_properties: {
|
||||
name: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'name',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
iso6391name: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'iso6391Name',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
score: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'score',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class DocumentStatistics
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Integer] Number of text elements recognized in the document.
|
||||
attr_accessor :characters_count
|
||||
|
||||
# @return [Integer] Number of transactions for the document.
|
||||
attr_accessor :transactions_count
|
||||
|
||||
|
||||
#
|
||||
# Mapper for DocumentStatistics class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'DocumentStatistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DocumentStatistics',
|
||||
model_properties: {
|
||||
characters_count: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'charactersCount',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
},
|
||||
transactions_count: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'transactionsCount',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class EntitiesBatchResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<EntitiesBatchResultItem>] Response by document
|
||||
attr_accessor :documents
|
||||
|
||||
# @return [Array<ErrorRecord>] Errors and Warnings by document
|
||||
attr_accessor :errors
|
||||
|
||||
# @return [RequestStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the request
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for EntitiesBatchResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'EntitiesBatchResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'EntitiesBatchResult',
|
||||
model_properties: {
|
||||
documents: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'documents',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'EntitiesBatchResultItemElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'EntitiesBatchResultItem'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
errors: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'errors',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ErrorRecordElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ErrorRecord'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RequestStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class EntitiesBatchResultItem
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Unique, non-empty document identifier.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [Array<EntityRecord>] Recognized entities in the document.
|
||||
attr_accessor :entities
|
||||
|
||||
# @return [DocumentStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the document
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for EntitiesBatchResultItem class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'EntitiesBatchResultItem',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'EntitiesBatchResultItem',
|
||||
model_properties: {
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
entities: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'entities',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'EntityRecordElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'EntityRecord'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DocumentStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,138 @@
|
|||
# encoding: utf-8
|
||||
# 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::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class EntityRecord
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Entity formal name.
|
||||
attr_accessor :name
|
||||
|
||||
# @return [Array<MatchRecord>] List of instances this entity appears in
|
||||
# the text.
|
||||
attr_accessor :matches
|
||||
|
||||
# @return [String] Wikipedia language for which the WikipediaId and
|
||||
# WikipediaUrl refers to.
|
||||
attr_accessor :wikipedia_language
|
||||
|
||||
# @return [String] Wikipedia unique identifier of the recognized entity.
|
||||
attr_accessor :wikipedia_id
|
||||
|
||||
# @return [String] URL for the entity's Wikipedia page.
|
||||
attr_accessor :wikipedia_url
|
||||
|
||||
# @return [String] Bing unique identifier of the recognized entity. Use
|
||||
# in conjunction with the Bing Entity Search API to fetch additional
|
||||
# relevant information.
|
||||
attr_accessor :bing_id
|
||||
|
||||
# @return [String] Entity type from Named Entity Recognition model
|
||||
attr_accessor :type
|
||||
|
||||
# @return [String] Entity sub type from Named Entity Recognition model
|
||||
attr_accessor :sub_type
|
||||
|
||||
|
||||
#
|
||||
# Mapper for EntityRecord class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'EntityRecord',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'EntityRecord',
|
||||
model_properties: {
|
||||
name: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'name',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
matches: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'matches',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'MatchRecordElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'MatchRecord'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
wikipedia_language: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'wikipediaLanguage',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
wikipedia_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'wikipediaId',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
wikipedia_url: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'wikipediaUrl',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
bing_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'bingId',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
type: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'type',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
sub_type: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'subType',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class ErrorRecord
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Input document unique identifier the error refers to.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [String] Error message.
|
||||
attr_accessor :message
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ErrorRecord class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ErrorRecord',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ErrorRecord',
|
||||
model_properties: {
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
message: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'message',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,81 @@
|
|||
# encoding: utf-8
|
||||
# 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::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class ErrorResponse
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :code
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :message
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :target
|
||||
|
||||
# @return [InternalError]
|
||||
attr_accessor :inner_error
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ErrorResponse class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ErrorResponse',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ErrorResponse',
|
||||
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'
|
||||
}
|
||||
},
|
||||
target: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'target',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
inner_error: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'innerError',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'InternalError'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class InternalError
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :code
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :message
|
||||
|
||||
# @return [InternalError]
|
||||
attr_accessor :inner_error
|
||||
|
||||
|
||||
#
|
||||
# Mapper for InternalError class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'InternalError',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'InternalError',
|
||||
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'
|
||||
}
|
||||
},
|
||||
inner_error: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'innerError',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'InternalError'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class KeyPhraseBatchResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<KeyPhraseBatchResultItem>] Response by document
|
||||
attr_accessor :documents
|
||||
|
||||
# @return [Array<ErrorRecord>] Errors and Warnings by document
|
||||
attr_accessor :errors
|
||||
|
||||
# @return [RequestStatistics] =(Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the request
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for KeyPhraseBatchResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'KeyPhraseBatchResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'KeyPhraseBatchResult',
|
||||
model_properties: {
|
||||
documents: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'documents',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'KeyPhraseBatchResultItemElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'KeyPhraseBatchResultItem'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
errors: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'errors',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ErrorRecordElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ErrorRecord'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RequestStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class KeyPhraseBatchResultItem
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Unique, non-empty document identifier.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [Array<String>] A list of representative words or phrases. The
|
||||
# number of key phrases returned is proportional to the number of words
|
||||
# in the input document.
|
||||
attr_accessor :key_phrases
|
||||
|
||||
# @return [DocumentStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the document
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for KeyPhraseBatchResultItem class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'KeyPhraseBatchResultItem',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'KeyPhraseBatchResultItem',
|
||||
model_properties: {
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
key_phrases: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'keyPhrases',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'StringElementType',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DocumentStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -3,46 +3,46 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::CognitiveServices::ComputerVision::V2_0
|
||||
module Azure::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class RecognitionResult
|
||||
class LanguageBatchInput
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<Line>]
|
||||
attr_accessor :lines
|
||||
# @return [Array<LanguageInput>]
|
||||
attr_accessor :documents
|
||||
|
||||
|
||||
#
|
||||
# Mapper for RecognitionResult class as Ruby Hash.
|
||||
# Mapper for LanguageBatchInput class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'RecognitionResult',
|
||||
serialized_name: 'LanguageBatchInput',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RecognitionResult',
|
||||
class_name: 'LanguageBatchInput',
|
||||
model_properties: {
|
||||
lines: {
|
||||
documents: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'lines',
|
||||
serialized_name: 'documents',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'LineElementType',
|
||||
serialized_name: 'LanguageInputElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'Line'
|
||||
class_name: 'LanguageInput'
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class LanguageBatchResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<LanguageBatchResultItem>] Response by document
|
||||
attr_accessor :documents
|
||||
|
||||
# @return [Array<ErrorRecord>] Errors and Warnings by document
|
||||
attr_accessor :errors
|
||||
|
||||
# @return [RequestStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the request
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for LanguageBatchResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'LanguageBatchResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'LanguageBatchResult',
|
||||
model_properties: {
|
||||
documents: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'documents',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'LanguageBatchResultItemElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'LanguageBatchResultItem'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
errors: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'errors',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ErrorRecordElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ErrorRecord'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RequestStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,81 @@
|
|||
# encoding: utf-8
|
||||
# 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::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class LanguageBatchResultItem
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Unique, non-empty document identifier.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [Array<DetectedLanguage>] A list of extracted languages.
|
||||
attr_accessor :detected_languages
|
||||
|
||||
# @return [DocumentStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the document
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for LanguageBatchResultItem class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'LanguageBatchResultItem',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'LanguageBatchResultItem',
|
||||
model_properties: {
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
detected_languages: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'detectedLanguages',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'DetectedLanguageElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DetectedLanguage'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DocumentStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class LanguageInput
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :country_hint
|
||||
|
||||
# @return [String] Unique, non-empty document identifier.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :text
|
||||
|
||||
|
||||
#
|
||||
# Mapper for LanguageInput class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'LanguageInput',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'LanguageInput',
|
||||
model_properties: {
|
||||
country_hint: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'countryHint',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
text: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'text',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class MatchRecord
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Float] (optional) If a well-known item with Wikipedia link is
|
||||
# recognized, a decimal number denoting the confidence level of the
|
||||
# Wikipedia info will be returned.
|
||||
attr_accessor :wikipedia_score
|
||||
|
||||
# @return [Float] (optional) If an entity type is recognized, a decimal
|
||||
# number denoting the confidence level of the entity type will be
|
||||
# returned.
|
||||
attr_accessor :entity_type_score
|
||||
|
||||
# @return [String] Entity text as appears in the request.
|
||||
attr_accessor :text
|
||||
|
||||
# @return [Integer] Start position (in Unicode characters) for the entity
|
||||
# match text.
|
||||
attr_accessor :offset
|
||||
|
||||
# @return [Integer] Length (in Unicode characters) for the entity match
|
||||
# text.
|
||||
attr_accessor :length
|
||||
|
||||
|
||||
#
|
||||
# Mapper for MatchRecord class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'MatchRecord',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'MatchRecord',
|
||||
model_properties: {
|
||||
wikipedia_score: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'wikipediaScore',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
entity_type_score: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'entityTypeScore',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
text: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'text',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
offset: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'offset',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
},
|
||||
length: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'length',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class MultiLanguageBatchInput
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<MultiLanguageInput>]
|
||||
attr_accessor :documents
|
||||
|
||||
|
||||
#
|
||||
# Mapper for MultiLanguageBatchInput class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'MultiLanguageBatchInput',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'MultiLanguageBatchInput',
|
||||
model_properties: {
|
||||
documents: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'documents',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'MultiLanguageInputElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'MultiLanguageInput'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class MultiLanguageInput
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] This is the 2 letter ISO 639-1 representation of a
|
||||
# language. For example, use "en" for English; "es" for Spanish etc.,
|
||||
attr_accessor :language
|
||||
|
||||
# @return [String] Unique, non-empty document identifier.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [String]
|
||||
attr_accessor :text
|
||||
|
||||
|
||||
#
|
||||
# Mapper for MultiLanguageInput class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'MultiLanguageInput',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'MultiLanguageInput',
|
||||
model_properties: {
|
||||
language: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'language',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
text: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'text',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class RequestStatistics
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Integer] Number of documents submitted in the request.
|
||||
attr_accessor :documents_count
|
||||
|
||||
# @return [Integer] Number of valid documents. This excludes empty,
|
||||
# over-size limit or non-supported languages documents.
|
||||
attr_accessor :valid_documents_count
|
||||
|
||||
# @return [Integer] Number of invalid documents. This includes empty,
|
||||
# over-size limit or non-supported languages documents.
|
||||
attr_accessor :erroneous_documents_count
|
||||
|
||||
# @return [Integer] Number of transactions for the request.
|
||||
attr_accessor :transactions_count
|
||||
|
||||
|
||||
#
|
||||
# Mapper for RequestStatistics class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'RequestStatistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RequestStatistics',
|
||||
model_properties: {
|
||||
documents_count: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'documentsCount',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
},
|
||||
valid_documents_count: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'validDocumentsCount',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
},
|
||||
erroneous_documents_count: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'erroneousDocumentsCount',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
},
|
||||
transactions_count: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'transactionsCount',
|
||||
type: {
|
||||
name: 'Number'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class SentimentBatchResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Array<SentimentBatchResultItem>] Response by document
|
||||
attr_accessor :documents
|
||||
|
||||
# @return [Array<ErrorRecord>] Errors and Warnings by document
|
||||
attr_accessor :errors
|
||||
|
||||
# @return [RequestStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the request
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for SentimentBatchResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SentimentBatchResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SentimentBatchResult',
|
||||
model_properties: {
|
||||
documents: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'documents',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SentimentBatchResultItemElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SentimentBatchResultItem'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
errors: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'errors',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ErrorRecordElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ErrorRecord'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
read_only: true,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'RequestStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices::TextAnalytics::V2_1
|
||||
module Models
|
||||
#
|
||||
# Model object.
|
||||
#
|
||||
#
|
||||
class SentimentBatchResultItem
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Unique, non-empty document identifier.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [Float] A decimal number between 0 and 1 denoting the sentiment
|
||||
# of the document. A score above 0.7 usually refers to a positive
|
||||
# document while a score below 0.3 normally has a negative connotation.
|
||||
# Mid values refer to neutral text.
|
||||
attr_accessor :score
|
||||
|
||||
# @return [DocumentStatistics] (Optional) if showStats=true was specified
|
||||
# in the request this field will contain information about the document
|
||||
# payload.
|
||||
attr_accessor :statistics
|
||||
|
||||
|
||||
#
|
||||
# Mapper for SentimentBatchResultItem class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SentimentBatchResultItem',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SentimentBatchResultItem',
|
||||
model_properties: {
|
||||
id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'id',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
score: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'score',
|
||||
type: {
|
||||
name: 'Double'
|
||||
}
|
||||
},
|
||||
statistics: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'statistics',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'DocumentStatistics'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::CognitiveServices end
|
||||
module Azure::CognitiveServices::TextAnalytics end
|
||||
module Azure::CognitiveServices::TextAnalytics::V2_1 end
|
|
@ -0,0 +1,614 @@
|
|||
# encoding: utf-8
|
||||
# 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::TextAnalytics::V2_1
|
||||
#
|
||||
# A service client - single point of access to the REST API.
|
||||
#
|
||||
class TextAnalyticsClient < MsRestAzure::AzureServiceClient
|
||||
include MsRestAzure
|
||||
include MsRestAzure::Serialization
|
||||
|
||||
# @return [String] the base URI of the service.
|
||||
attr_reader :base_url
|
||||
|
||||
# @return Credentials needed for the client to connect to Azure.
|
||||
attr_reader :credentials1
|
||||
|
||||
# @return [String] Supported Cognitive Services endpoints (protocol and
|
||||
# hostname, for example: https://westus.api.cognitive.microsoft.com).
|
||||
attr_accessor :endpoint
|
||||
|
||||
# @return Subscription credentials which uniquely identify client
|
||||
# subscription.
|
||||
attr_accessor :credentials
|
||||
|
||||
# @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
|
||||
|
||||
#
|
||||
# Creates initializes a new instance of the TextAnalyticsClient class.
|
||||
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
||||
# @param options [Array] filters to be applied to the HTTP requests.
|
||||
#
|
||||
def initialize(credentials = nil, options = nil)
|
||||
super(credentials, options)
|
||||
@base_url = '{Endpoint}/text/analytics/v2.1'
|
||||
|
||||
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
||||
@credentials = credentials
|
||||
|
||||
@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
|
||||
|
||||
#
|
||||
# The API returns the detected language and a numeric score between 0 and 1.
|
||||
#
|
||||
# Scores close to 1 indicate 100% certainty that the identified language is
|
||||
# true. A total of 120 languages are supported.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param language_batch_input [LanguageBatchInput] Collection of documents to
|
||||
# analyze.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [LanguageBatchResult] operation results.
|
||||
#
|
||||
def detect_language(show_stats:nil, language_batch_input:nil, custom_headers:nil)
|
||||
response = detect_language_async(show_stats:show_stats, language_batch_input:language_batch_input, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns the detected language and a numeric score between 0 and 1.
|
||||
#
|
||||
# Scores close to 1 indicate 100% certainty that the identified language is
|
||||
# true. A total of 120 languages are supported.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param language_batch_input [LanguageBatchInput] Collection of documents to
|
||||
# analyze.
|
||||
# @param custom_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_language_with_http_info(show_stats:nil, language_batch_input:nil, custom_headers:nil)
|
||||
detect_language_async(show_stats:show_stats, language_batch_input:language_batch_input, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns the detected language and a numeric score between 0 and 1.
|
||||
#
|
||||
# Scores close to 1 indicate 100% certainty that the identified language is
|
||||
# true. A total of 120 languages are supported.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param language_batch_input [LanguageBatchInput] Collection of documents to
|
||||
# analyze.
|
||||
# @param [Hash{String => String}] 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_language_async(show_stats:nil, language_batch_input:nil, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.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'] = accept_language unless accept_language.nil?
|
||||
|
||||
# Serialize Request
|
||||
request_mapper = Azure::CognitiveServices::TextAnalytics::V2_1::Models::LanguageBatchInput.mapper()
|
||||
request_content = self.serialize(request_mapper, language_batch_input)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = 'languages'
|
||||
|
||||
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: {'showStats' => show_stats},
|
||||
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::TextAnalytics::V2_1::Models::LanguageBatchResult.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
|
||||
|
||||
#
|
||||
# The API returns a list of recognized entities in a given document.
|
||||
#
|
||||
# To get even more information on each recognized entity we recommend using the
|
||||
# Bing Entity Search API by querying for the recognized entities names. See the
|
||||
# <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
|
||||
# languages in Text Analytics API</a> for the list of enabled languages.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [EntitiesBatchResult] operation results.
|
||||
#
|
||||
def entities(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
response = entities_async(show_stats:show_stats, multi_language_batch_input:multi_language_batch_input, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns a list of recognized entities in a given document.
|
||||
#
|
||||
# To get even more information on each recognized entity we recommend using the
|
||||
# Bing Entity Search API by querying for the recognized entities names. See the
|
||||
# <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
|
||||
# languages in Text Analytics API</a> for the list of enabled languages.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
||||
#
|
||||
def entities_with_http_info(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
entities_async(show_stats:show_stats, multi_language_batch_input:multi_language_batch_input, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns a list of recognized entities in a given document.
|
||||
#
|
||||
# To get even more information on each recognized entity we recommend using the
|
||||
# Bing Entity Search API by querying for the recognized entities names. See the
|
||||
# <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported
|
||||
# languages in Text Analytics API</a> for the list of enabled languages.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze.
|
||||
# @param [Hash{String => String}] A hash of custom headers that will be added
|
||||
# to the HTTP request.
|
||||
#
|
||||
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
||||
#
|
||||
def entities_async(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.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'] = accept_language unless accept_language.nil?
|
||||
|
||||
# Serialize Request
|
||||
request_mapper = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput.mapper()
|
||||
request_content = self.serialize(request_mapper, multi_language_batch_input)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = 'entities'
|
||||
|
||||
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: {'showStats' => show_stats},
|
||||
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::TextAnalytics::V2_1::Models::EntitiesBatchResult.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
|
||||
|
||||
#
|
||||
# The API returns a list of strings denoting the key talking points in the
|
||||
# input text.
|
||||
#
|
||||
# See the <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
|
||||
# Analytics Documentation</a> for details about the languages that are
|
||||
# supported by key phrase extraction.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze. Documents can now contain a language field to indicate
|
||||
# the text language
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [KeyPhraseBatchResult] operation results.
|
||||
#
|
||||
def key_phrases(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
response = key_phrases_async(show_stats:show_stats, multi_language_batch_input:multi_language_batch_input, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns a list of strings denoting the key talking points in the
|
||||
# input text.
|
||||
#
|
||||
# See the <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
|
||||
# Analytics Documentation</a> for details about the languages that are
|
||||
# supported by key phrase extraction.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze. Documents can now contain a language field to indicate
|
||||
# the text language
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
||||
#
|
||||
def key_phrases_with_http_info(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
key_phrases_async(show_stats:show_stats, multi_language_batch_input:multi_language_batch_input, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns a list of strings denoting the key talking points in the
|
||||
# input text.
|
||||
#
|
||||
# See the <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
|
||||
# Analytics Documentation</a> for details about the languages that are
|
||||
# supported by key phrase extraction.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze. Documents can now contain a language field to indicate
|
||||
# the text language
|
||||
# @param [Hash{String => String}] A hash of custom headers that will be added
|
||||
# to the HTTP request.
|
||||
#
|
||||
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
||||
#
|
||||
def key_phrases_async(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.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'] = accept_language unless accept_language.nil?
|
||||
|
||||
# Serialize Request
|
||||
request_mapper = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput.mapper()
|
||||
request_content = self.serialize(request_mapper, multi_language_batch_input)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = 'keyPhrases'
|
||||
|
||||
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: {'showStats' => show_stats},
|
||||
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::TextAnalytics::V2_1::Models::KeyPhraseBatchResult.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
|
||||
|
||||
#
|
||||
# The API returns a numeric score between 0 and 1.
|
||||
#
|
||||
# Scores close to 1 indicate positive sentiment, while scores close to 0
|
||||
# indicate negative sentiment. A score of 0.5 indicates the lack of sentiment
|
||||
# (e.g. a factoid statement). See the <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
|
||||
# Analytics Documentation</a> for details about the languages that are
|
||||
# supported by sentiment analysis.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [Object] operation results.
|
||||
#
|
||||
def sentiment(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
response = sentiment_async(show_stats:show_stats, multi_language_batch_input:multi_language_batch_input, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns a numeric score between 0 and 1.
|
||||
#
|
||||
# Scores close to 1 indicate positive sentiment, while scores close to 0
|
||||
# indicate negative sentiment. A score of 0.5 indicates the lack of sentiment
|
||||
# (e.g. a factoid statement). See the <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
|
||||
# Analytics Documentation</a> for details about the languages that are
|
||||
# supported by sentiment analysis.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
||||
#
|
||||
def sentiment_with_http_info(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
sentiment_async(show_stats:show_stats, multi_language_batch_input:multi_language_batch_input, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# The API returns a numeric score between 0 and 1.
|
||||
#
|
||||
# Scores close to 1 indicate positive sentiment, while scores close to 0
|
||||
# indicate negative sentiment. A score of 0.5 indicates the lack of sentiment
|
||||
# (e.g. a factoid statement). See the <a
|
||||
# href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text
|
||||
# Analytics Documentation</a> for details about the languages that are
|
||||
# supported by sentiment analysis.
|
||||
#
|
||||
# @param show_stats [Boolean] (optional) if set to true, response will contain
|
||||
# input and document level statistics.
|
||||
# @param multi_language_batch_input [MultiLanguageBatchInput] Collection of
|
||||
# documents to analyze.
|
||||
# @param [Hash{String => String}] A hash of custom headers that will be added
|
||||
# to the HTTP request.
|
||||
#
|
||||
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
||||
#
|
||||
def sentiment_async(show_stats:nil, multi_language_batch_input:nil, custom_headers:nil)
|
||||
fail ArgumentError, 'endpoint is nil' if endpoint.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'] = accept_language unless accept_language.nil?
|
||||
|
||||
# Serialize Request
|
||||
request_mapper = Azure::CognitiveServices::TextAnalytics::V2_1::Models::MultiLanguageBatchInput.mapper()
|
||||
request_content = self.serialize(request_mapper, multi_language_batch_input)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = 'sentiment'
|
||||
|
||||
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: {'showStats' => show_stats},
|
||||
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 || status_code == 500
|
||||
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::CognitiveServices::TextAnalytics::V2_1::Models::SentimentBatchResult.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
|
||||
# Deserialize Response
|
||||
if status_code == 500
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = Azure::CognitiveServices::TextAnalytics::V2_1::Models::ErrorResponse.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
|
||||
|
||||
|
||||
private
|
||||
#
|
||||
# Adds telemetry information.
|
||||
#
|
||||
def add_telemetry
|
||||
sdk_information = 'azure_cognitiveservices_textanalytics'
|
||||
sdk_information = "#{sdk_information}/0.17.3"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -3,5 +3,5 @@
|
|||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
module Azure::CognitiveServices::TextAnalytics
|
||||
VERSION = '0.17.2'
|
||||
VERSION = '0.17.3'
|
||||
end
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
--require spec_helper
|
||||
--color
|
||||
--format documentation
|
|
@ -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.
|
|
@ -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"
|
|
@ -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_advisor/lib/module_definition'
|
||||
require '../azure_mgmt_advisor/lib/version'
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = 'azure_mgmt_advisor'
|
||||
spec.version = Azure::Advisor::Mgmt::VERSION
|
||||
spec.authors = 'Microsoft Corporation'
|
||||
spec.email = 'azrubyteam@microsoft.com'
|
||||
spec.description = 'Microsoft Azure Advisor Services Library for Ruby'
|
||||
spec.summary = 'Official Ruby client library to consume Microsoft Azure Advisor services.'
|
||||
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_advisor'
|
||||
}
|
||||
|
||||
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
|
|
@ -0,0 +1,41 @@
|
|||
# encoding: 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 '2016-07-12-preview/generated/azure_mgmt_advisor/module_definition'
|
||||
require 'ms_rest_azure'
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
autoload :Recommendations, '2016-07-12-preview/generated/azure_mgmt_advisor/recommendations.rb'
|
||||
autoload :Operations, '2016-07-12-preview/generated/azure_mgmt_advisor/operations.rb'
|
||||
autoload :Suppressions, '2016-07-12-preview/generated/azure_mgmt_advisor/suppressions.rb'
|
||||
autoload :AdvisorManagementClient, '2016-07-12-preview/generated/azure_mgmt_advisor/advisor_management_client.rb'
|
||||
|
||||
module Models
|
||||
autoload :OperationDisplayInfo, '2016-07-12-preview/generated/azure_mgmt_advisor/models/operation_display_info.rb'
|
||||
autoload :ShortDescription, '2016-07-12-preview/generated/azure_mgmt_advisor/models/short_description.rb'
|
||||
autoload :OperationEntity, '2016-07-12-preview/generated/azure_mgmt_advisor/models/operation_entity.rb'
|
||||
autoload :ResourceRecommendationBaseListResult, '2016-07-12-preview/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb'
|
||||
autoload :OperationEntityListResult, '2016-07-12-preview/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb'
|
||||
autoload :ResourceRecommendationBase, '2016-07-12-preview/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb'
|
||||
autoload :Resource, '2016-07-12-preview/generated/azure_mgmt_advisor/models/resource.rb'
|
||||
autoload :SuppressionContract, '2016-07-12-preview/generated/azure_mgmt_advisor/models/suppression_contract.rb'
|
||||
autoload :Category, '2016-07-12-preview/generated/azure_mgmt_advisor/models/category.rb'
|
||||
autoload :Impact, '2016-07-12-preview/generated/azure_mgmt_advisor/models/impact.rb'
|
||||
autoload :Risk, '2016-07-12-preview/generated/azure_mgmt_advisor/models/risk.rb'
|
||||
end
|
||||
end
|
|
@ -0,0 +1,140 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
#
|
||||
# A service client - single point of access to the REST API.
|
||||
#
|
||||
class AdvisorManagementClient < MsRestAzure::AzureServiceClient
|
||||
include MsRestAzure
|
||||
include MsRestAzure::Serialization
|
||||
|
||||
# @return [String] the base URI of the service.
|
||||
attr_accessor :base_url
|
||||
|
||||
# @return Credentials needed for the client to connect to Azure.
|
||||
attr_reader :credentials
|
||||
|
||||
# @return [String] The Azure subscription ID.
|
||||
attr_accessor :subscription_id
|
||||
|
||||
# @return [String] The version of the API to be used with the client
|
||||
# request.
|
||||
attr_reader :api_version
|
||||
|
||||
# @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 [Recommendations] recommendations
|
||||
attr_reader :recommendations
|
||||
|
||||
# @return [Operations] operations
|
||||
attr_reader :operations
|
||||
|
||||
# @return [Suppressions] suppressions
|
||||
attr_reader :suppressions
|
||||
|
||||
#
|
||||
# Creates initializes a new instance of the AdvisorManagementClient 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
|
||||
|
||||
@recommendations = Recommendations.new(self)
|
||||
@operations = Operations.new(self)
|
||||
@suppressions = Suppressions.new(self)
|
||||
@api_version = '2016-07-12-preview'
|
||||
@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_advisor'
|
||||
sdk_information = "#{sdk_information}/0.17.0"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# Defines values for Category
|
||||
#
|
||||
module Category
|
||||
HighAvailability = "HighAvailability"
|
||||
Security = "Security"
|
||||
Performance = "Performance"
|
||||
Cost = "Cost"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# Defines values for Impact
|
||||
#
|
||||
module Impact
|
||||
High = "High"
|
||||
Medium = "Medium"
|
||||
Low = "Low"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# The operation supported by Advisor.
|
||||
#
|
||||
class OperationDisplayInfo
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The description of the operation.
|
||||
attr_accessor :description
|
||||
|
||||
# @return [String] The action that users can perform, based on their
|
||||
# permission level.
|
||||
attr_accessor :operation
|
||||
|
||||
# @return [String] Service provider: Microsoft Advisor.
|
||||
attr_accessor :provider
|
||||
|
||||
# @return [String] Resource on which the operation is performed.
|
||||
attr_accessor :resource
|
||||
|
||||
|
||||
#
|
||||
# Mapper for OperationDisplayInfo class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationDisplayInfo',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationDisplayInfo',
|
||||
model_properties: {
|
||||
description: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'description',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
operation: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'operation',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# The operation supported by Advisor.
|
||||
#
|
||||
class OperationEntity
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Operation name: {provider}/{resource}/{operation}.
|
||||
attr_accessor :name
|
||||
|
||||
# @return [OperationDisplayInfo] The operation supported by Advisor.
|
||||
attr_accessor :display
|
||||
|
||||
|
||||
#
|
||||
# Mapper for OperationEntity class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationEntity',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationEntity',
|
||||
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: 'OperationDisplayInfo'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# The list of Advisor operations.
|
||||
#
|
||||
class OperationEntityListResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
include MsRest::JSONable
|
||||
# @return [String] The link used to get the next page of operations.
|
||||
attr_accessor :next_link
|
||||
|
||||
# @return [Array<OperationEntity>] The list of operations.
|
||||
attr_accessor :value
|
||||
|
||||
# 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<OperationEntity>] operation results.
|
||||
#
|
||||
def get_all_items
|
||||
items = @value
|
||||
page = self
|
||||
while page.next_link != nil && !page.next_link.strip.empty? do
|
||||
page = page.get_next_page
|
||||
items.concat(page.value)
|
||||
end
|
||||
items
|
||||
end
|
||||
|
||||
#
|
||||
# Gets the next page of results.
|
||||
#
|
||||
# @return [OperationEntityListResult] 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 OperationEntityListResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationEntityListResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationEntityListResult',
|
||||
model_properties: {
|
||||
next_link: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'nextLink',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'value',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationEntityElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationEntity'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# An Azure resource.
|
||||
#
|
||||
class Resource
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The resource ID.
|
||||
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. This cannot be changed
|
||||
# after the resource is created.
|
||||
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
|
|
@ -0,0 +1,201 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# Advisor Recommendation.
|
||||
#
|
||||
class ResourceRecommendationBase
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The fully qualified recommendation ID, for example
|
||||
# /subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.ClassicCompute/virtualMachines/vm1/providers/Microsoft.Advisor/recommendations/recommendationGUID.
|
||||
attr_accessor :id
|
||||
|
||||
# @return [String] The name of recommendation.
|
||||
attr_accessor :name
|
||||
|
||||
# @return [Category] The category of the recommendation. Possible values
|
||||
# include: 'HighAvailability', 'Security', 'Performance', 'Cost'
|
||||
attr_accessor :category
|
||||
|
||||
# @return [Impact] The business impact of the recommendation. Possible
|
||||
# values include: 'High', 'Medium', 'Low'
|
||||
attr_accessor :impact
|
||||
|
||||
# @return [String] The resource type identified by Advisor.
|
||||
attr_accessor :impacted_field
|
||||
|
||||
# @return [String] The resource identified by Advisor.
|
||||
attr_accessor :impacted_value
|
||||
|
||||
# @return [DateTime] The most recent time that Advisor checked the
|
||||
# validity of the recommendation.
|
||||
attr_accessor :last_updated
|
||||
|
||||
# @return The recommendation metadata.
|
||||
attr_accessor :metadata
|
||||
|
||||
# @return [String] The recommendation-type GUID.
|
||||
attr_accessor :recommendation_type_id
|
||||
|
||||
# @return [Risk] The potential risk of not implementing the
|
||||
# recommendation. Possible values include: 'Error', 'Warning', 'None'
|
||||
attr_accessor :risk
|
||||
|
||||
# @return [ShortDescription] A summary of the recommendation.
|
||||
attr_accessor :short_description
|
||||
|
||||
# @return The list of snoozed and dismissed rules for the recommendation.
|
||||
attr_accessor :suppression_ids
|
||||
|
||||
# @return [String] The recommendation type:
|
||||
# Microsoft.Advisor/recommendations.
|
||||
attr_accessor :type
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ResourceRecommendationBase class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ResourceRecommendationBase',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ResourceRecommendationBase',
|
||||
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'
|
||||
}
|
||||
},
|
||||
category: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.category',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
impact: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.impact',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
impacted_field: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.impactedField',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
impacted_value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.impactedValue',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
last_updated: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.lastUpdated',
|
||||
type: {
|
||||
name: 'DateTime'
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.metadata',
|
||||
type: {
|
||||
name: 'Dictionary',
|
||||
value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ObjectElementType',
|
||||
type: {
|
||||
name: 'Object'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
recommendation_type_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.recommendationTypeId',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
risk: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.risk',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
short_description: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.shortDescription',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ShortDescription'
|
||||
}
|
||||
},
|
||||
suppression_ids: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'suppressionIds',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'UuidElementType',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
type: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'type',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,99 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# The list of Advisor recommendations.
|
||||
#
|
||||
class ResourceRecommendationBaseListResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
include MsRest::JSONable
|
||||
# @return [String] The link used to get the next page of recommendations.
|
||||
attr_accessor :next_link
|
||||
|
||||
# @return [Array<ResourceRecommendationBase>] The list of
|
||||
# recommendations.
|
||||
attr_accessor :value
|
||||
|
||||
# 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<ResourceRecommendationBase>] operation results.
|
||||
#
|
||||
def get_all_items
|
||||
items = @value
|
||||
page = self
|
||||
while page.next_link != nil && !page.next_link.strip.empty? do
|
||||
page = page.get_next_page
|
||||
items.concat(page.value)
|
||||
end
|
||||
items
|
||||
end
|
||||
|
||||
#
|
||||
# Gets the next page of results.
|
||||
#
|
||||
# @return [ResourceRecommendationBaseListResult] 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 ResourceRecommendationBaseListResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ResourceRecommendationBaseListResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ResourceRecommendationBaseListResult',
|
||||
model_properties: {
|
||||
next_link: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'nextLink',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'value',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ResourceRecommendationBaseElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ResourceRecommendationBase'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# Defines values for Risk
|
||||
#
|
||||
module Risk
|
||||
Error = "Error"
|
||||
Warning = "Warning"
|
||||
None = "None"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# A summary of the recommendation.
|
||||
#
|
||||
class ShortDescription
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The issue or opportunity identified by the
|
||||
# recommendation.
|
||||
attr_accessor :problem
|
||||
|
||||
# @return [String] The remediation action suggested by the
|
||||
# recommendation.
|
||||
attr_accessor :solution
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ShortDescription class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ShortDescription',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ShortDescription',
|
||||
model_properties: {
|
||||
problem: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'problem',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
solution: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'solution',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
module Models
|
||||
#
|
||||
# The details of the snoozed or dismissed rule; for example, the duration,
|
||||
# name, and GUID associated with the rule.
|
||||
#
|
||||
class SuppressionContract < Resource
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The GUID of the suppression.
|
||||
attr_accessor :suppression_id
|
||||
|
||||
# @return [String] The duration for which the suppression is valid.
|
||||
attr_accessor :ttl
|
||||
|
||||
|
||||
#
|
||||
# Mapper for SuppressionContract class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SuppressionContract',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SuppressionContract',
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
suppression_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'suppressionId',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
ttl: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ttl',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor end
|
||||
module Azure::Advisor::Mgmt end
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview end
|
|
@ -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::Advisor::Mgmt::V2016_07_12_preview
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
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 [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Lists all the available Advisor REST API operations.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [Array<OperationEntity>] operation results.
|
||||
#
|
||||
def list(custom_headers:nil)
|
||||
first_page = list_as_lazy(custom_headers:custom_headers)
|
||||
first_page.get_all_items
|
||||
end
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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.Advisor/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::Advisor::Mgmt::V2016_07_12_preview::Models::OperationEntityListResult.mapper()
|
||||
result.body = @client.deserialize(result_mapper, parsed_response)
|
||||
rescue Exception => e
|
||||
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
||||
end
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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 [OperationEntityListResult] 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
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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::Advisor::Mgmt::V2016_07_12_preview::Models::OperationEntityListResult.mapper()
|
||||
result.body = @client.deserialize(result_mapper, parsed_response)
|
||||
rescue Exception => e
|
||||
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
||||
end
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# Lists all the available Advisor REST API operations.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [OperationEntityListResult] 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
|
|
@ -0,0 +1,503 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
class Recommendations
|
||||
include MsRestAzure
|
||||
|
||||
#
|
||||
# Creates and initializes a new instance of the Recommendations class.
|
||||
# @param client service class for accessing basic functionality.
|
||||
#
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
# @return [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Initiates the recommendation generation or computation process for a
|
||||
# subscription. This operation is asynchronous. The generated recommendations
|
||||
# are stored in a cache in the Advisor service.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def generate(custom_headers:nil)
|
||||
response = generate_async(custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Initiates the recommendation generation or computation process for a
|
||||
# subscription. This operation is asynchronous. The generated recommendations
|
||||
# are stored in a cache in the Advisor service.
|
||||
#
|
||||
# @param custom_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_with_http_info(custom_headers:nil)
|
||||
generate_async(custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Initiates the recommendation generation or computation process for a
|
||||
# subscription. This operation is asynchronous. The generated recommendations
|
||||
# are stored in a cache in the Advisor service.
|
||||
#
|
||||
# @param [Hash{String => String}] 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_async(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.Advisor/generateRecommendations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(: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 == 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
|
||||
|
||||
#
|
||||
# Retrieves the status of the recommendation computation or generation process.
|
||||
# Invoke this API after calling the generation recommendation. The URI of this
|
||||
# API is returned in the Location field of the response header.
|
||||
#
|
||||
# @param operation_id The operation ID, which can be found from the Location
|
||||
# field in the generate recommendation response header.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def get_generate_recommendations_status(operation_id, custom_headers:nil)
|
||||
response = get_generate_recommendations_status_async(operation_id, custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the status of the recommendation computation or generation process.
|
||||
# Invoke this API after calling the generation recommendation. The URI of this
|
||||
# API is returned in the Location field of the response header.
|
||||
#
|
||||
# @param operation_id The operation ID, which can be found from the Location
|
||||
# field in the generate recommendation response header.
|
||||
# @param custom_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_generate_recommendations_status_with_http_info(operation_id, custom_headers:nil)
|
||||
get_generate_recommendations_status_async(operation_id, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the status of the recommendation computation or generation process.
|
||||
# Invoke this API after calling the generation recommendation. The URI of this
|
||||
# API is returned in the Location field of the response header.
|
||||
#
|
||||
# @param operation_id The operation ID, which can be found from the Location
|
||||
# field in the generate recommendation response header.
|
||||
# @param [Hash{String => String}] 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_generate_recommendations_status_async(operation_id, custom_headers:nil)
|
||||
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
||||
fail ArgumentError, 'operation_id is nil' if operation_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.Advisor/generateRecommendations/{operationId}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id,'operationId' => operation_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [Array<ResourceRecommendationBase>] operation results.
|
||||
#
|
||||
def list(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
|
||||
first_page = list_as_lazy(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
|
||||
first_page.get_all_items
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param custom_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(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
|
||||
list_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param [Hash{String => String}] 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(filter:nil, top:nil, skip_token: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.Advisor/recommendations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
|
||||
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::Advisor::Mgmt::V2016_07_12_preview::Models::ResourceRecommendationBaseListResult.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
|
||||
|
||||
#
|
||||
# Obtains details of a cached recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ResourceRecommendationBase] operation results.
|
||||
#
|
||||
def get(resource_uri, recommendation_id, custom_headers:nil)
|
||||
response = get_async(resource_uri, recommendation_id, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains details of a cached recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param custom_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_uri, recommendation_id, custom_headers:nil)
|
||||
get_async(resource_uri, recommendation_id, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains details of a cached recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param [Hash{String => String}] 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_uri, recommendation_id, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_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 = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 200
|
||||
error_model = JSON.load(response_content)
|
||||
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
||||
end
|
||||
|
||||
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
||||
# Deserialize Response
|
||||
if status_code == 200
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = Azure::Advisor::Mgmt::V2016_07_12_preview::Models::ResourceRecommendationBase.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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @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 [ResourceRecommendationBaseListResult] 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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @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::Advisor::Mgmt::V2016_07_12_preview::Models::ResourceRecommendationBaseListResult.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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ResourceRecommendationBaseListResult] which provide lazy access to
|
||||
# pages of the response.
|
||||
#
|
||||
def list_as_lazy(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
|
||||
response = list_async(filter:filter, top:top, skip_token:skip_token, 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
|
|
@ -0,0 +1,437 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2016_07_12_preview
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
class Suppressions
|
||||
include MsRestAzure
|
||||
|
||||
#
|
||||
# Creates and initializes a new instance of the Suppressions class.
|
||||
# @param client service class for accessing basic functionality.
|
||||
#
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
# @return [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Obtains the details of a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [SuppressionContract] operation results.
|
||||
#
|
||||
def get(resource_uri, recommendation_id, name, custom_headers:nil)
|
||||
response = get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains the details of a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_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_uri, recommendation_id, name, custom_headers:nil)
|
||||
get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains the details of a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param [Hash{String => String}] 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_uri, recommendation_id, name, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_id.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 = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'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::Advisor::Mgmt::V2016_07_12_preview::Models::SuppressionContract.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
|
||||
|
||||
#
|
||||
# Enables the snoozed or dismissed attribute of a recommendation. The snoozed
|
||||
# or dismissed attribute is referred to as a suppression. Use this API to
|
||||
# create or update the snoozed or dismissed status of a recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param suppression_contract [SuppressionContract] The snoozed or dismissed
|
||||
# attribute; for example, the snooze duration.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [SuppressionContract] operation results.
|
||||
#
|
||||
def create(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
|
||||
response = create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the snoozed or dismissed attribute of a recommendation. The snoozed
|
||||
# or dismissed attribute is referred to as a suppression. Use this API to
|
||||
# create or update the snoozed or dismissed status of a recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param suppression_contract [SuppressionContract] The snoozed or dismissed
|
||||
# attribute; for example, the snooze duration.
|
||||
# @param custom_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_with_http_info(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
|
||||
create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the snoozed or dismissed attribute of a recommendation. The snoozed
|
||||
# or dismissed attribute is referred to as a suppression. Use this API to
|
||||
# create or update the snoozed or dismissed status of a recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param suppression_contract [SuppressionContract] The snoozed or dismissed
|
||||
# attribute; for example, the snooze duration.
|
||||
# @param [Hash{String => String}] 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_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_id.nil?
|
||||
fail ArgumentError, 'name is nil' if name.nil?
|
||||
fail ArgumentError, 'suppression_contract is nil' if suppression_contract.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::Advisor::Mgmt::V2016_07_12_preview::Models::SuppressionContract.mapper()
|
||||
request_content = @client.serialize(request_mapper, suppression_contract)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'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
|
||||
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::Advisor::Mgmt::V2016_07_12_preview::Models::SuppressionContract.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
|
||||
|
||||
#
|
||||
# Enables the activation of a snoozed or dismissed recommendation. The snoozed
|
||||
# or dismissed attribute of a recommendation is referred to as a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def delete(resource_uri, recommendation_id, name, custom_headers:nil)
|
||||
response = delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the activation of a snoozed or dismissed recommendation. The snoozed
|
||||
# or dismissed attribute of a recommendation is referred to as a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_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_uri, recommendation_id, name, custom_headers:nil)
|
||||
delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the activation of a snoozed or dismissed recommendation. The snoozed
|
||||
# or dismissed attribute of a recommendation is referred to as a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param [Hash{String => String}] 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_uri, recommendation_id, name, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_id.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 = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'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 == 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
|
||||
|
||||
#
|
||||
# Retrieves the list of snoozed or dismissed suppressions for a subscription.
|
||||
# The snoozed or dismissed attribute of a recommendation is referred to as a
|
||||
# suppression.
|
||||
#
|
||||
# @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)
|
||||
response = list_async(custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the list of snoozed or dismissed suppressions for a subscription.
|
||||
# The snoozed or dismissed attribute of a recommendation is referred to as a
|
||||
# suppression.
|
||||
#
|
||||
# @param custom_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
|
||||
|
||||
#
|
||||
# Retrieves the list of snoozed or dismissed suppressions for a subscription.
|
||||
# The snoozed or dismissed attribute of a recommendation is referred to as a
|
||||
# suppression.
|
||||
#
|
||||
# @param [Hash{String => String}] 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.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.Advisor/suppressions'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 200
|
||||
error_model = JSON.load(response_content)
|
||||
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
||||
end
|
||||
|
||||
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
||||
# Deserialize Response
|
||||
if status_code == 200
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'parsed_response',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SuppressionContractElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SuppressionContract'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
|
@ -0,0 +1,41 @@
|
|||
# encoding: 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 '2017-03-31/generated/azure_mgmt_advisor/module_definition'
|
||||
require 'ms_rest_azure'
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
autoload :Recommendations, '2017-03-31/generated/azure_mgmt_advisor/recommendations.rb'
|
||||
autoload :Operations, '2017-03-31/generated/azure_mgmt_advisor/operations.rb'
|
||||
autoload :Suppressions, '2017-03-31/generated/azure_mgmt_advisor/suppressions.rb'
|
||||
autoload :AdvisorManagementClient, '2017-03-31/generated/azure_mgmt_advisor/advisor_management_client.rb'
|
||||
|
||||
module Models
|
||||
autoload :OperationDisplayInfo, '2017-03-31/generated/azure_mgmt_advisor/models/operation_display_info.rb'
|
||||
autoload :ShortDescription, '2017-03-31/generated/azure_mgmt_advisor/models/short_description.rb'
|
||||
autoload :OperationEntity, '2017-03-31/generated/azure_mgmt_advisor/models/operation_entity.rb'
|
||||
autoload :ResourceRecommendationBaseListResult, '2017-03-31/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb'
|
||||
autoload :OperationEntityListResult, '2017-03-31/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb'
|
||||
autoload :Resource, '2017-03-31/generated/azure_mgmt_advisor/models/resource.rb'
|
||||
autoload :ResourceRecommendationBase, '2017-03-31/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb'
|
||||
autoload :SuppressionContract, '2017-03-31/generated/azure_mgmt_advisor/models/suppression_contract.rb'
|
||||
autoload :Category, '2017-03-31/generated/azure_mgmt_advisor/models/category.rb'
|
||||
autoload :Impact, '2017-03-31/generated/azure_mgmt_advisor/models/impact.rb'
|
||||
autoload :Risk, '2017-03-31/generated/azure_mgmt_advisor/models/risk.rb'
|
||||
end
|
||||
end
|
|
@ -0,0 +1,140 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
#
|
||||
# A service client - single point of access to the REST API.
|
||||
#
|
||||
class AdvisorManagementClient < MsRestAzure::AzureServiceClient
|
||||
include MsRestAzure
|
||||
include MsRestAzure::Serialization
|
||||
|
||||
# @return [String] the base URI of the service.
|
||||
attr_accessor :base_url
|
||||
|
||||
# @return Credentials needed for the client to connect to Azure.
|
||||
attr_reader :credentials
|
||||
|
||||
# @return [String] The Azure subscription ID.
|
||||
attr_accessor :subscription_id
|
||||
|
||||
# @return [String] The version of the API to be used with the client
|
||||
# request.
|
||||
attr_reader :api_version
|
||||
|
||||
# @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 [Recommendations] recommendations
|
||||
attr_reader :recommendations
|
||||
|
||||
# @return [Operations] operations
|
||||
attr_reader :operations
|
||||
|
||||
# @return [Suppressions] suppressions
|
||||
attr_reader :suppressions
|
||||
|
||||
#
|
||||
# Creates initializes a new instance of the AdvisorManagementClient 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
|
||||
|
||||
@recommendations = Recommendations.new(self)
|
||||
@operations = Operations.new(self)
|
||||
@suppressions = Suppressions.new(self)
|
||||
@api_version = '2017-03-31'
|
||||
@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_advisor'
|
||||
sdk_information = "#{sdk_information}/0.17.0"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# Defines values for Category
|
||||
#
|
||||
module Category
|
||||
HighAvailability = "HighAvailability"
|
||||
Security = "Security"
|
||||
Performance = "Performance"
|
||||
Cost = "Cost"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# Defines values for Impact
|
||||
#
|
||||
module Impact
|
||||
High = "High"
|
||||
Medium = "Medium"
|
||||
Low = "Low"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# The operation supported by Advisor.
|
||||
#
|
||||
class OperationDisplayInfo
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The description of the operation.
|
||||
attr_accessor :description
|
||||
|
||||
# @return [String] The action that users can perform, based on their
|
||||
# permission level.
|
||||
attr_accessor :operation
|
||||
|
||||
# @return [String] Service provider: Microsoft Advisor.
|
||||
attr_accessor :provider
|
||||
|
||||
# @return [String] Resource on which the operation is performed.
|
||||
attr_accessor :resource
|
||||
|
||||
|
||||
#
|
||||
# Mapper for OperationDisplayInfo class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationDisplayInfo',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationDisplayInfo',
|
||||
model_properties: {
|
||||
description: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'description',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
operation: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'operation',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# The operation supported by Advisor.
|
||||
#
|
||||
class OperationEntity
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Operation name: {provider}/{resource}/{operation}.
|
||||
attr_accessor :name
|
||||
|
||||
# @return [OperationDisplayInfo] The operation supported by Advisor.
|
||||
attr_accessor :display
|
||||
|
||||
|
||||
#
|
||||
# Mapper for OperationEntity class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationEntity',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationEntity',
|
||||
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: 'OperationDisplayInfo'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# The list of Advisor operations.
|
||||
#
|
||||
class OperationEntityListResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
include MsRest::JSONable
|
||||
# @return [String] The link used to get the next page of operations.
|
||||
attr_accessor :next_link
|
||||
|
||||
# @return [Array<OperationEntity>] The list of operations.
|
||||
attr_accessor :value
|
||||
|
||||
# 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<OperationEntity>] operation results.
|
||||
#
|
||||
def get_all_items
|
||||
items = @value
|
||||
page = self
|
||||
while page.next_link != nil && !page.next_link.strip.empty? do
|
||||
page = page.get_next_page
|
||||
items.concat(page.value)
|
||||
end
|
||||
items
|
||||
end
|
||||
|
||||
#
|
||||
# Gets the next page of results.
|
||||
#
|
||||
# @return [OperationEntityListResult] 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 OperationEntityListResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationEntityListResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationEntityListResult',
|
||||
model_properties: {
|
||||
next_link: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'nextLink',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'value',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'OperationEntityElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'OperationEntity'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# An Azure resource.
|
||||
#
|
||||
class Resource
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The resource ID.
|
||||
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 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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,193 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# Advisor Recommendation.
|
||||
#
|
||||
class ResourceRecommendationBase < Resource
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [Category] The category of the recommendation. Possible values
|
||||
# include: 'HighAvailability', 'Security', 'Performance', 'Cost'
|
||||
attr_accessor :category
|
||||
|
||||
# @return [Impact] The business impact of the recommendation. Possible
|
||||
# values include: 'High', 'Medium', 'Low'
|
||||
attr_accessor :impact
|
||||
|
||||
# @return [String] The resource type identified by Advisor.
|
||||
attr_accessor :impacted_field
|
||||
|
||||
# @return [String] The resource identified by Advisor.
|
||||
attr_accessor :impacted_value
|
||||
|
||||
# @return [DateTime] The most recent time that Advisor checked the
|
||||
# validity of the recommendation.
|
||||
attr_accessor :last_updated
|
||||
|
||||
# @return The recommendation metadata.
|
||||
attr_accessor :metadata
|
||||
|
||||
# @return [String] The recommendation-type GUID.
|
||||
attr_accessor :recommendation_type_id
|
||||
|
||||
# @return [Risk] The potential risk of not implementing the
|
||||
# recommendation. Possible values include: 'Error', 'Warning', 'None'
|
||||
attr_accessor :risk
|
||||
|
||||
# @return [ShortDescription] A summary of the recommendation.
|
||||
attr_accessor :short_description
|
||||
|
||||
# @return The list of snoozed and dismissed rules for the recommendation.
|
||||
attr_accessor :suppression_ids
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ResourceRecommendationBase class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ResourceRecommendationBase',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ResourceRecommendationBase',
|
||||
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'
|
||||
}
|
||||
},
|
||||
category: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.category',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
impact: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.impact',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
impacted_field: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.impactedField',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
impacted_value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.impactedValue',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
last_updated: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.lastUpdated',
|
||||
type: {
|
||||
name: 'DateTime'
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.metadata',
|
||||
type: {
|
||||
name: 'Dictionary',
|
||||
value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ObjectElementType',
|
||||
type: {
|
||||
name: 'Object'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
recommendation_type_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.recommendationTypeId',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
risk: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.risk',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
short_description: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.shortDescription',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ShortDescription'
|
||||
}
|
||||
},
|
||||
suppression_ids: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.suppressionIds',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'UuidElementType',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,99 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# The list of Advisor recommendations.
|
||||
#
|
||||
class ResourceRecommendationBaseListResult
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
include MsRest::JSONable
|
||||
# @return [String] The link used to get the next page of recommendations.
|
||||
attr_accessor :next_link
|
||||
|
||||
# @return [Array<ResourceRecommendationBase>] The list of
|
||||
# recommendations.
|
||||
attr_accessor :value
|
||||
|
||||
# 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<ResourceRecommendationBase>] operation results.
|
||||
#
|
||||
def get_all_items
|
||||
items = @value
|
||||
page = self
|
||||
while page.next_link != nil && !page.next_link.strip.empty? do
|
||||
page = page.get_next_page
|
||||
items.concat(page.value)
|
||||
end
|
||||
items
|
||||
end
|
||||
|
||||
#
|
||||
# Gets the next page of results.
|
||||
#
|
||||
# @return [ResourceRecommendationBaseListResult] 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 ResourceRecommendationBaseListResult class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ResourceRecommendationBaseListResult',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ResourceRecommendationBaseListResult',
|
||||
model_properties: {
|
||||
next_link: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'nextLink',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
value: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'value',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ResourceRecommendationBaseElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ResourceRecommendationBase'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# Defines values for Risk
|
||||
#
|
||||
module Risk
|
||||
Error = "Error"
|
||||
Warning = "Warning"
|
||||
None = "None"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# A summary of the recommendation.
|
||||
#
|
||||
class ShortDescription
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The issue or opportunity identified by the
|
||||
# recommendation.
|
||||
attr_accessor :problem
|
||||
|
||||
# @return [String] The remediation action suggested by the
|
||||
# recommendation.
|
||||
attr_accessor :solution
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ShortDescription class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ShortDescription',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ShortDescription',
|
||||
model_properties: {
|
||||
problem: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'problem',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
solution: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'solution',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,85 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
module Models
|
||||
#
|
||||
# The details of the snoozed or dismissed rule; for example, the duration,
|
||||
# name, and GUID associated with the rule.
|
||||
#
|
||||
class SuppressionContract < Resource
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] The GUID of the suppression.
|
||||
attr_accessor :suppression_id
|
||||
|
||||
# @return [String] The duration for which the suppression is valid.
|
||||
attr_accessor :ttl
|
||||
|
||||
|
||||
#
|
||||
# Mapper for SuppressionContract class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SuppressionContract',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SuppressionContract',
|
||||
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'
|
||||
}
|
||||
},
|
||||
suppression_id: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.suppressionId',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
ttl: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'properties.ttl',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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::Advisor end
|
||||
module Azure::Advisor::Mgmt end
|
||||
module Azure::Advisor::Mgmt::V2017_03_31 end
|
|
@ -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::Advisor::Mgmt::V2017_03_31
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
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 [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Lists all the available Advisor REST API operations.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [Array<OperationEntity>] operation results.
|
||||
#
|
||||
def list(custom_headers:nil)
|
||||
first_page = list_as_lazy(custom_headers:custom_headers)
|
||||
first_page.get_all_items
|
||||
end
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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.Advisor/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::Advisor::Mgmt::V2017_03_31::Models::OperationEntityListResult.mapper()
|
||||
result.body = @client.deserialize(result_mapper, parsed_response)
|
||||
rescue Exception => e
|
||||
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
||||
end
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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 [OperationEntityListResult] 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
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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
|
||||
|
||||
#
|
||||
# Lists all the available Advisor 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::Advisor::Mgmt::V2017_03_31::Models::OperationEntityListResult.mapper()
|
||||
result.body = @client.deserialize(result_mapper, parsed_response)
|
||||
rescue Exception => e
|
||||
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
||||
end
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
promise.execute
|
||||
end
|
||||
|
||||
#
|
||||
# Lists all the available Advisor REST API operations.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [OperationEntityListResult] 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
|
|
@ -0,0 +1,503 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
class Recommendations
|
||||
include MsRestAzure
|
||||
|
||||
#
|
||||
# Creates and initializes a new instance of the Recommendations class.
|
||||
# @param client service class for accessing basic functionality.
|
||||
#
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
# @return [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Initiates the recommendation generation or computation process for a
|
||||
# subscription. This operation is asynchronous. The generated recommendations
|
||||
# are stored in a cache in the Advisor service.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def generate(custom_headers:nil)
|
||||
response = generate_async(custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Initiates the recommendation generation or computation process for a
|
||||
# subscription. This operation is asynchronous. The generated recommendations
|
||||
# are stored in a cache in the Advisor service.
|
||||
#
|
||||
# @param custom_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_with_http_info(custom_headers:nil)
|
||||
generate_async(custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Initiates the recommendation generation or computation process for a
|
||||
# subscription. This operation is asynchronous. The generated recommendations
|
||||
# are stored in a cache in the Advisor service.
|
||||
#
|
||||
# @param [Hash{String => String}] 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_async(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.Advisor/generateRecommendations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(: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 == 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
|
||||
|
||||
#
|
||||
# Retrieves the status of the recommendation computation or generation process.
|
||||
# Invoke this API after calling the generation recommendation. The URI of this
|
||||
# API is returned in the Location field of the response header.
|
||||
#
|
||||
# @param operation_id The operation ID, which can be found from the Location
|
||||
# field in the generate recommendation response header.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def get_generate_status(operation_id, custom_headers:nil)
|
||||
response = get_generate_status_async(operation_id, custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the status of the recommendation computation or generation process.
|
||||
# Invoke this API after calling the generation recommendation. The URI of this
|
||||
# API is returned in the Location field of the response header.
|
||||
#
|
||||
# @param operation_id The operation ID, which can be found from the Location
|
||||
# field in the generate recommendation response header.
|
||||
# @param custom_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_generate_status_with_http_info(operation_id, custom_headers:nil)
|
||||
get_generate_status_async(operation_id, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the status of the recommendation computation or generation process.
|
||||
# Invoke this API after calling the generation recommendation. The URI of this
|
||||
# API is returned in the Location field of the response header.
|
||||
#
|
||||
# @param operation_id The operation ID, which can be found from the Location
|
||||
# field in the generate recommendation response header.
|
||||
# @param [Hash{String => String}] 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_generate_status_async(operation_id, custom_headers:nil)
|
||||
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
||||
fail ArgumentError, 'operation_id is nil' if operation_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.Advisor/generateRecommendations/{operationId}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id,'operationId' => operation_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [Array<ResourceRecommendationBase>] operation results.
|
||||
#
|
||||
def list(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
|
||||
first_page = list_as_lazy(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
|
||||
first_page.get_all_items
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param custom_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(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
|
||||
list_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param [Hash{String => String}] 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(filter:nil, top:nil, skip_token: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.Advisor/recommendations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
|
||||
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::Advisor::Mgmt::V2017_03_31::Models::ResourceRecommendationBaseListResult.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
|
||||
|
||||
#
|
||||
# Obtains details of a cached recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ResourceRecommendationBase] operation results.
|
||||
#
|
||||
def get(resource_uri, recommendation_id, custom_headers:nil)
|
||||
response = get_async(resource_uri, recommendation_id, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains details of a cached recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param custom_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_uri, recommendation_id, custom_headers:nil)
|
||||
get_async(resource_uri, recommendation_id, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains details of a cached recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param [Hash{String => String}] 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_uri, recommendation_id, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_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 = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 200
|
||||
error_model = JSON.load(response_content)
|
||||
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
||||
end
|
||||
|
||||
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
||||
# Deserialize Response
|
||||
if status_code == 200
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = Azure::Advisor::Mgmt::V2017_03_31::Models::ResourceRecommendationBase.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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @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 [ResourceRecommendationBaseListResult] 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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @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::Advisor::Mgmt::V2017_03_31::Models::ResourceRecommendationBaseListResult.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
|
||||
|
||||
#
|
||||
# Obtains cached recommendations for a subscription. The recommendations are
|
||||
# generated or computed by invoking generateRecommendations.
|
||||
#
|
||||
# @param filter [String] The filter to apply to the recommendations.
|
||||
# @param top [Integer] The number of recommendations per page if a paged
|
||||
# version of this API is being used.
|
||||
# @param skip_token [String] The page-continuation token to use with a paged
|
||||
# version of this API.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ResourceRecommendationBaseListResult] which provide lazy access to
|
||||
# pages of the response.
|
||||
#
|
||||
def list_as_lazy(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
|
||||
response = list_async(filter:filter, top:top, skip_token:skip_token, 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
|
|
@ -0,0 +1,437 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_03_31
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
class Suppressions
|
||||
include MsRestAzure
|
||||
|
||||
#
|
||||
# Creates and initializes a new instance of the Suppressions class.
|
||||
# @param client service class for accessing basic functionality.
|
||||
#
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
# @return [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Obtains the details of a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [SuppressionContract] operation results.
|
||||
#
|
||||
def get(resource_uri, recommendation_id, name, custom_headers:nil)
|
||||
response = get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains the details of a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_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_uri, recommendation_id, name, custom_headers:nil)
|
||||
get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Obtains the details of a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param [Hash{String => String}] 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_uri, recommendation_id, name, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_id.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 = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'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::Advisor::Mgmt::V2017_03_31::Models::SuppressionContract.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
|
||||
|
||||
#
|
||||
# Enables the snoozed or dismissed attribute of a recommendation. The snoozed
|
||||
# or dismissed attribute is referred to as a suppression. Use this API to
|
||||
# create or update the snoozed or dismissed status of a recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param suppression_contract [SuppressionContract] The snoozed or dismissed
|
||||
# attribute; for example, the snooze duration.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [SuppressionContract] operation results.
|
||||
#
|
||||
def create(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
|
||||
response = create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the snoozed or dismissed attribute of a recommendation. The snoozed
|
||||
# or dismissed attribute is referred to as a suppression. Use this API to
|
||||
# create or update the snoozed or dismissed status of a recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param suppression_contract [SuppressionContract] The snoozed or dismissed
|
||||
# attribute; for example, the snooze duration.
|
||||
# @param custom_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_with_http_info(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
|
||||
create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the snoozed or dismissed attribute of a recommendation. The snoozed
|
||||
# or dismissed attribute is referred to as a suppression. Use this API to
|
||||
# create or update the snoozed or dismissed status of a recommendation.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param suppression_contract [SuppressionContract] The snoozed or dismissed
|
||||
# attribute; for example, the snooze duration.
|
||||
# @param [Hash{String => String}] 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_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_id.nil?
|
||||
fail ArgumentError, 'name is nil' if name.nil?
|
||||
fail ArgumentError, 'suppression_contract is nil' if suppression_contract.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::Advisor::Mgmt::V2017_03_31::Models::SuppressionContract.mapper()
|
||||
request_content = @client.serialize(request_mapper, suppression_contract)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'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
|
||||
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::Advisor::Mgmt::V2017_03_31::Models::SuppressionContract.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
|
||||
|
||||
#
|
||||
# Enables the activation of a snoozed or dismissed recommendation. The snoozed
|
||||
# or dismissed attribute of a recommendation is referred to as a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
#
|
||||
def delete(resource_uri, recommendation_id, name, custom_headers:nil)
|
||||
response = delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
nil
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the activation of a snoozed or dismissed recommendation. The snoozed
|
||||
# or dismissed attribute of a recommendation is referred to as a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param custom_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_uri, recommendation_id, name, custom_headers:nil)
|
||||
delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Enables the activation of a snoozed or dismissed recommendation. The snoozed
|
||||
# or dismissed attribute of a recommendation is referred to as a suppression.
|
||||
#
|
||||
# @param resource_uri [String] The fully qualified Azure Resource Manager
|
||||
# identifier of the resource to which the recommendation applies.
|
||||
# @param recommendation_id [String] The recommendation ID.
|
||||
# @param name [String] The name of the suppression.
|
||||
# @param [Hash{String => String}] 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_uri, recommendation_id, name, custom_headers:nil)
|
||||
fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
|
||||
fail ArgumentError, 'recommendation_id is nil' if recommendation_id.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 = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'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 == 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
|
||||
|
||||
#
|
||||
# Retrieves the list of snoozed or dismissed suppressions for a subscription.
|
||||
# The snoozed or dismissed attribute of a recommendation is referred to as a
|
||||
# suppression.
|
||||
#
|
||||
# @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)
|
||||
response = list_async(custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieves the list of snoozed or dismissed suppressions for a subscription.
|
||||
# The snoozed or dismissed attribute of a recommendation is referred to as a
|
||||
# suppression.
|
||||
#
|
||||
# @param custom_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
|
||||
|
||||
#
|
||||
# Retrieves the list of snoozed or dismissed suppressions for a subscription.
|
||||
# The snoozed or dismissed attribute of a recommendation is referred to as a
|
||||
# suppression.
|
||||
#
|
||||
# @param [Hash{String => String}] 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.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.Advisor/suppressions'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 200
|
||||
error_model = JSON.load(response_content)
|
||||
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
||||
end
|
||||
|
||||
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
||||
# Deserialize Response
|
||||
if status_code == 200
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'parsed_response',
|
||||
type: {
|
||||
name: 'Sequence',
|
||||
element: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'SuppressionContractElementType',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'SuppressionContract'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
|
@ -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.
|
||||
|
||||
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 '2017-04-19/generated/azure_mgmt_advisor/module_definition'
|
||||
require 'ms_rest_azure'
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_04_19
|
||||
autoload :Configurations, '2017-04-19/generated/azure_mgmt_advisor/configurations.rb'
|
||||
autoload :Recommendations, '2017-04-19/generated/azure_mgmt_advisor/recommendations.rb'
|
||||
autoload :Operations, '2017-04-19/generated/azure_mgmt_advisor/operations.rb'
|
||||
autoload :Suppressions, '2017-04-19/generated/azure_mgmt_advisor/suppressions.rb'
|
||||
autoload :AdvisorManagementClient, '2017-04-19/generated/azure_mgmt_advisor/advisor_management_client.rb'
|
||||
|
||||
module Models
|
||||
autoload :ResourceRecommendationBaseListResult, '2017-04-19/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb'
|
||||
autoload :Resource, '2017-04-19/generated/azure_mgmt_advisor/models/resource.rb'
|
||||
autoload :ConfigData, '2017-04-19/generated/azure_mgmt_advisor/models/config_data.rb'
|
||||
autoload :OperationDisplayInfo, '2017-04-19/generated/azure_mgmt_advisor/models/operation_display_info.rb'
|
||||
autoload :ARMErrorResponseBody, '2017-04-19/generated/azure_mgmt_advisor/models/armerror_response_body.rb'
|
||||
autoload :OperationEntity, '2017-04-19/generated/azure_mgmt_advisor/models/operation_entity.rb'
|
||||
autoload :ShortDescription, '2017-04-19/generated/azure_mgmt_advisor/models/short_description.rb'
|
||||
autoload :ConfigurationListResult, '2017-04-19/generated/azure_mgmt_advisor/models/configuration_list_result.rb'
|
||||
autoload :OperationEntityListResult, '2017-04-19/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb'
|
||||
autoload :ConfigDataProperties, '2017-04-19/generated/azure_mgmt_advisor/models/config_data_properties.rb'
|
||||
autoload :SuppressionContractListResult, '2017-04-19/generated/azure_mgmt_advisor/models/suppression_contract_list_result.rb'
|
||||
autoload :ResourceRecommendationBase, '2017-04-19/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb'
|
||||
autoload :SuppressionContract, '2017-04-19/generated/azure_mgmt_advisor/models/suppression_contract.rb'
|
||||
autoload :Category, '2017-04-19/generated/azure_mgmt_advisor/models/category.rb'
|
||||
autoload :Impact, '2017-04-19/generated/azure_mgmt_advisor/models/impact.rb'
|
||||
autoload :Risk, '2017-04-19/generated/azure_mgmt_advisor/models/risk.rb'
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_04_19
|
||||
#
|
||||
# A service client - single point of access to the REST API.
|
||||
#
|
||||
class AdvisorManagementClient < MsRestAzure::AzureServiceClient
|
||||
include MsRestAzure
|
||||
include MsRestAzure::Serialization
|
||||
|
||||
# @return [String] the base URI of the service.
|
||||
attr_accessor :base_url
|
||||
|
||||
# @return Credentials needed for the client to connect to Azure.
|
||||
attr_reader :credentials
|
||||
|
||||
# @return [String] The Azure subscription ID.
|
||||
attr_accessor :subscription_id
|
||||
|
||||
# @return [String] The version of the API to be used with the client
|
||||
# request.
|
||||
attr_reader :api_version
|
||||
|
||||
# @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 [Configurations] configurations
|
||||
attr_reader :configurations
|
||||
|
||||
# @return [Recommendations] recommendations
|
||||
attr_reader :recommendations
|
||||
|
||||
# @return [Operations] operations
|
||||
attr_reader :operations
|
||||
|
||||
# @return [Suppressions] suppressions
|
||||
attr_reader :suppressions
|
||||
|
||||
#
|
||||
# Creates initializes a new instance of the AdvisorManagementClient 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
|
||||
|
||||
@configurations = Configurations.new(self)
|
||||
@recommendations = Recommendations.new(self)
|
||||
@operations = Operations.new(self)
|
||||
@suppressions = Suppressions.new(self)
|
||||
@api_version = '2017-04-19'
|
||||
@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_advisor'
|
||||
sdk_information = "#{sdk_information}/0.17.0"
|
||||
add_user_agent_information(sdk_information)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,535 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_04_19
|
||||
#
|
||||
# REST APIs for Azure Advisor
|
||||
#
|
||||
class Configurations
|
||||
include MsRestAzure
|
||||
|
||||
#
|
||||
# Creates and initializes a new instance of the Configurations class.
|
||||
# @param client service class for accessing basic functionality.
|
||||
#
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
# @return [AdvisorManagementClient] reference to the AdvisorManagementClient
|
||||
attr_reader :client
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [Array<ConfigData>] operation results.
|
||||
#
|
||||
def list_by_subscription(custom_headers:nil)
|
||||
first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
|
||||
first_page.get_all_items
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @param custom_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(custom_headers:nil)
|
||||
list_by_subscription_async(custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @param [Hash{String => String}] 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(custom_headers:nil)
|
||||
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
||||
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
||||
|
||||
|
||||
request_headers = {}
|
||||
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.Advisor/configurations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(:get, path_template, options)
|
||||
|
||||
promise = promise.then do |result|
|
||||
http_response = result.response
|
||||
status_code = http_response.status
|
||||
response_content = http_response.body
|
||||
unless status_code == 200
|
||||
error_model = JSON.load(response_content)
|
||||
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
||||
end
|
||||
|
||||
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
||||
# Deserialize Response
|
||||
if status_code == 200
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = Azure::Advisor::Mgmt::V2017_04_19::Models::ConfigurationListResult.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/Overwrite Azure Advisor configuration.
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration and also delete all
|
||||
# configurations of contained resource groups.
|
||||
#
|
||||
# @param config_contract [ConfigData] The Azure Advisor configuration data
|
||||
# structure.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ARMErrorResponseBody] operation results.
|
||||
#
|
||||
def create_in_subscription(config_contract, custom_headers:nil)
|
||||
response = create_in_subscription_async(config_contract, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration.
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration and also delete all
|
||||
# configurations of contained resource groups.
|
||||
#
|
||||
# @param config_contract [ConfigData] The Azure Advisor configuration data
|
||||
# structure.
|
||||
# @param custom_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_in_subscription_with_http_info(config_contract, custom_headers:nil)
|
||||
create_in_subscription_async(config_contract, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration.
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration and also delete all
|
||||
# configurations of contained resource groups.
|
||||
#
|
||||
# @param config_contract [ConfigData] The Azure Advisor configuration data
|
||||
# structure.
|
||||
# @param [Hash{String => String}] 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_in_subscription_async(config_contract, custom_headers:nil)
|
||||
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
||||
fail ArgumentError, 'config_contract is nil' if config_contract.nil?
|
||||
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::Advisor::Mgmt::V2017_04_19::Models::ConfigData.mapper()
|
||||
request_content = @client.serialize(request_mapper, config_contract)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id},
|
||||
query_params: {'api-version' => @client.api_version},
|
||||
body: request_content,
|
||||
headers: request_headers.merge(custom_headers || {}),
|
||||
base_url: request_url
|
||||
}
|
||||
promise = @client.make_request_async(: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 == 204 || status_code == 400
|
||||
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 == 400
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = Azure::Advisor::Mgmt::V2017_04_19::Models::ARMErrorResponseBody.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
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# @param resource_group [String] The name of the Azure resource group.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ConfigurationListResult] operation results.
|
||||
#
|
||||
def list_by_resource_group(resource_group, custom_headers:nil)
|
||||
response = list_by_resource_group_async(resource_group, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# @param resource_group [String] The name of the Azure resource group.
|
||||
# @param custom_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, custom_headers:nil)
|
||||
list_by_resource_group_async(resource_group, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# @param resource_group [String] The name of the Azure resource group.
|
||||
# @param [Hash{String => String}] 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, custom_headers:nil)
|
||||
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
||||
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
||||
fail ArgumentError, 'resource_group is nil' if resource_group.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/{resourceGroup}/providers/Microsoft.Advisor/configurations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroup' => resource_group},
|
||||
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::Advisor::Mgmt::V2017_04_19::Models::ConfigurationListResult.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/Overwrite Azure Advisor configuration.
|
||||
#
|
||||
# @param config_contract [ConfigData] The Azure Advisor configuration data
|
||||
# structure.
|
||||
# @param resource_group [String] The name of the Azure resource group.
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ARMErrorResponseBody] operation results.
|
||||
#
|
||||
def create_in_resource_group(config_contract, resource_group, custom_headers:nil)
|
||||
response = create_in_resource_group_async(config_contract, resource_group, custom_headers:custom_headers).value!
|
||||
response.body unless response.nil?
|
||||
end
|
||||
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration.
|
||||
#
|
||||
# @param config_contract [ConfigData] The Azure Advisor configuration data
|
||||
# structure.
|
||||
# @param resource_group [String] The name of the Azure resource group.
|
||||
# @param custom_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_in_resource_group_with_http_info(config_contract, resource_group, custom_headers:nil)
|
||||
create_in_resource_group_async(config_contract, resource_group, custom_headers:custom_headers).value!
|
||||
end
|
||||
|
||||
#
|
||||
# Create/Overwrite Azure Advisor configuration.
|
||||
#
|
||||
# @param config_contract [ConfigData] The Azure Advisor configuration data
|
||||
# structure.
|
||||
# @param resource_group [String] The name of the Azure resource group.
|
||||
# @param [Hash{String => String}] 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_in_resource_group_async(config_contract, resource_group, custom_headers:nil)
|
||||
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
||||
fail ArgumentError, 'config_contract is nil' if config_contract.nil?
|
||||
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
||||
fail ArgumentError, 'resource_group is nil' if resource_group.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::Advisor::Mgmt::V2017_04_19::Models::ConfigData.mapper()
|
||||
request_content = @client.serialize(request_mapper, config_contract)
|
||||
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
||||
|
||||
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'
|
||||
|
||||
request_url = @base_url || @client.base_url
|
||||
|
||||
options = {
|
||||
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
||||
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroup' => resource_group},
|
||||
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 == 204 || status_code == 400
|
||||
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 == 400
|
||||
begin
|
||||
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
||||
result_mapper = Azure::Advisor::Mgmt::V2017_04_19::Models::ARMErrorResponseBody.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
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @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 [ConfigurationListResult] 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
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @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
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @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::Advisor::Mgmt::V2017_04_19::Models::ConfigurationListResult.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
|
||||
|
||||
#
|
||||
# Retrieve Azure Advisor configurations.
|
||||
#
|
||||
# Retrieve Azure Advisor configurations and also retrieve configurations of
|
||||
# contained resource groups.
|
||||
#
|
||||
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
||||
# will be added to the HTTP request.
|
||||
#
|
||||
# @return [ConfigurationListResult] which provide lazy access to pages of the
|
||||
# response.
|
||||
#
|
||||
def list_by_subscription_as_lazy(custom_headers:nil)
|
||||
response = list_by_subscription_async(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
|
||||
|
||||
end
|
||||
end
|
|
@ -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::Advisor::Mgmt::V2017_04_19
|
||||
module Models
|
||||
#
|
||||
# ARM error response body.
|
||||
#
|
||||
class ARMErrorResponseBody
|
||||
|
||||
include MsRestAzure
|
||||
|
||||
# @return [String] Gets or sets the string that describes the error in
|
||||
# detail and provides debugging information.
|
||||
attr_accessor :message
|
||||
|
||||
# @return [String] Gets or sets the string that can be used to
|
||||
# programmatically identify the error.
|
||||
attr_accessor :code
|
||||
|
||||
|
||||
#
|
||||
# Mapper for ARMErrorResponseBody class as Ruby Hash.
|
||||
# This will be used for serialization/deserialization.
|
||||
#
|
||||
def self.mapper()
|
||||
{
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'ARMErrorResponseBody',
|
||||
type: {
|
||||
name: 'Composite',
|
||||
class_name: 'ARMErrorResponseBody',
|
||||
model_properties: {
|
||||
message: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'message',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
},
|
||||
code: {
|
||||
client_side_validation: true,
|
||||
required: false,
|
||||
serialized_name: 'code',
|
||||
type: {
|
||||
name: 'String'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,18 @@
|
|||
# encoding: utf-8
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is
|
||||
# regenerated.
|
||||
|
||||
module Azure::Advisor::Mgmt::V2017_04_19
|
||||
module Models
|
||||
#
|
||||
# Defines values for Category
|
||||
#
|
||||
module Category
|
||||
HighAvailability = "HighAvailability"
|
||||
Security = "Security"
|
||||
Performance = "Performance"
|
||||
Cost = "Cost"
|
||||
end
|
||||
end
|
||||
end
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче