Sha256: 70be93dd905ce7ee8f489d2a87664730d02c9761747d547a30134b21dd865249

Contents?: true

Size: 1.99 KB

Versions: 4

Compression:

Stored size: 1.99 KB

Contents

# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::Monitor::Mgmt::V2017_10_01_preview
  module Models
    #
    # An Azure resource.
    #
    class Resource

      include MsRestAzure

      # @return [String] Azure resource Id.
      attr_accessor :id

      # @return [String] Azure resource name.
      attr_accessor :name

      # @return [String] Azure resource type.
      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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
azure_mgmt_monitor-0.19.0 lib/2017-10-01-preview/generated/azure_mgmt_monitor/models/resource.rb
azure_mgmt_monitor-0.18.0 lib/2017-10-01-preview/generated/azure_mgmt_monitor/models/resource.rb
azure_mgmt_monitor-0.17.6 lib/2017-10-01-preview/generated/azure_mgmt_monitor/models/resource.rb
azure_mgmt_monitor-0.17.5 lib/2017-10-01-preview/generated/azure_mgmt_monitor/models/resource.rb