Sha256: e4223471d63e35b7187e6d6f489bdfd00d5cdc72231a2ae965137d18eefa47c2

Contents?: true

Size: 1.77 KB

Versions: 35

Compression:

Stored size: 1.77 KB

Contents

module ApiStub
  module Requests
    module Resources
      # Mock class for Tag Requests
      class AzureResource
        def self.azure_resource_response(client)
          body = '{
            "id": "/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}",
            "name": "your-resource-name",
                "type": "providernamespace/resourcetype",
                "location": "westus",
                "tags": {
                "tag_name": "tag_value"
            },
                "plan": {
                "name": "free"
            }
          }'
          result_mapper = Azure::ARM::Resources::Models::GenericResource.mapper
          client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
        end

        def self.list_tagged_resources_response(client)
          body = '{
            "value": [ {
              "id": "/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}",
              "name": "your-resource-name",
              "type": "providernamespace/resourcetype",
              "location": "westus",
              "tags": {
              "tag_name": "tag_value"
          },
              "plan": {
              "name": "free"
          }
          } ],
            "nextLink": "https://management.azure.com/subscriptions/########-####-####-####-############/resourcegroups?api-version=2015-01-01&$skiptoken=######"
          }'
          result_mapper = Azure::ARM::Resources::Models::ResourceListResult.mapper
          client.deserialize(result_mapper, Fog::JSON.decode(body), 'result.body')
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.6 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.4.5 test/api_stub/requests/resources/resource.rb
fog-azure-rm-temp-0.0.5 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.4.4 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.4.3 test/api_stub/requests/resources/resource.rb
far-gem-0.5.1 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.4.2 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.4.1 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.4.0 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.9 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.8 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.7 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.6 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.5 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.4 test/api_stub/requests/resources/resource.rb
fog-azure-rm-temp-0.0.4 test/api_stub/requests/resources/resource.rb
fog-azure-rm-temp-0.0.3 test/api_stub/requests/resources/resource.rb
fog-azure-rm-0.3.3 test/api_stub/requests/resources/resource.rb
fog-azure-rm-temp-0.0.2 test/api_stub/requests/resources/resource.rb
fog-azure-rm-temp-0.0.1 test/api_stub/requests/resources/resource.rb