Sha256: 728e6e5f7708832b1235f3507dcc6e9d9c69a6e02c1a3a7b3016e5c4217c0dc9

Contents?: true

Size: 1.92 KB

Versions: 28

Compression:

Stored size: 1.92 KB

Contents

module ApiStub
  module Requests
    module Resources
      # Mock class for Resource Group Requests
      class ResourceGroup
        def self.create_resource_group_response(client)
          body = '{
            "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg",
            "name": "fog-test-rg",
            "location": "westus",
            "tags": {
              "tagkey1": "tagvalue1"
            },
            "properties": {
              "provisioning_state": "Succeeded"
            }
          }'
          result_mapper = Azure::ARM::Resources::Models::ResourceGroup.mapper
          client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
        end

        def self.list_resource_group_response(client)
          body = '{
            "value": [ {
              "id": "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg",
              "name": "fog-test-rg",
              "location": "westus",
              "tags": {
                "tagname1": "tagvalue1"
              },
              "properties": {
                "provisioning_state": "Succeeded"
              }
            } ],
            "nextLink": "https://management.azure.com/subscriptions/########-####-####-####-############/resourcegroups?api-version=2015-01-01&$skiptoken=######"
          }'
          result_mapper = Azure::ARM::Resources::Models::ResourceGroupListResult.mapper
          client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
        end

        def self.list_resource_groups_for_zones
          resource_group = ::Azure::ARM::Resources::Models::ResourceGroup.new
          resource_group.id = '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-resource-group'
          resource_group.name = 'fog-test-resource-group'
          resource_group.location = 'West US'
          [resource_group]
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
fog-azure-rm-0.6.0 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.5.3 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.5.2 test/api_stub/requests/resources/resource_group.rb
far-gem-0.5.6 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.5.1 test/api_stub/requests/resources/resource_group.rb
far-gem-0.5.5 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.5.0 test/api_stub/requests/resources/resource_group.rb
far-gem-0.5.4 test/api_stub/requests/resources/resource_group.rb
far-gem-0.5.3 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.9 test/api_stub/requests/resources/resource_group.rb
far-gem-0.5.2 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.8 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.7 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.6 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.5 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-temp-0.0.5 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.4 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.3 test/api_stub/requests/resources/resource_group.rb
far-gem-0.5.1 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.4.2 test/api_stub/requests/resources/resource_group.rb