class Azure::Search::Mgmt::V2015_08_19::Models::Resource

Base type for all Azure resources.

Attributes

id[RW]

@return [String] The ID of the resource. This can be used with the Azure Resource Manager to link resources together.

identity[RW]

@return [Identity] The identity of the resource.

location[RW]

@return [String] The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource.

name[RW]

@return [String] The name of the resource.

tags[RW]

@return [Hash{String => String}] Tags to help categorize the resource in the Azure portal.

type[RW]

@return [String] The resource type.

Private Class Methods

mapper() click to toggle source

Mapper for Resource class as Ruby Hash. This will be used for serialization/deserialization.

# File lib/2015-08-19/generated/azure_mgmt_search/models/resource.rb, line 52
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'
                }
            }
          }
        },
        identity: {
          client_side_validation: true,
          required: false,
          serialized_name: 'identity',
          type: {
            name: 'Composite',
            class_name: 'Identity'
          }
        }
      }
    }
  }
end

Private Instance Methods

resource_group() click to toggle source

@return [String] the name of the resource group of the resource.

# File lib/2015-08-19/generated/azure_mgmt_search/models/resource.rb, line 40
def resource_group
  unless self.id.nil?
    groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/)
    groups.captures[0].strip if groups
  end
end