Sha256: 70c6a1bbbced0120c8fb9874fce03ba6c6886f53fecc590bdbbfb7f69480e18e

Contents?: true

Size: 1.96 KB

Versions: 5

Compression:

Stored size: 1.96 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": {
              "tagname1": "tagvalue1"
            },
            "properties": {
              "provisioning_state": "Succeeded"
            }
          }'
          result_mapper = Azure::ARM::Resources::Models::ResourceGroup.mapper
          client.deserialize(result_mapper, JSON.load(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, JSON.load(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

5 entries across 5 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.0.9 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.0.8 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.0.6 test/api_stub/requests/resources/resource_group.rb
fog-azure-rm-0.0.5 test/api_stub/requests/resources/resource_group.rb