jkawamoto/roadie

View on GitHub
cloud/azure/resource/client/providers/providers_client.go

Summary

Maintainability
A
0 mins
Test Coverage
package providers

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
    "github.com/go-openapi/runtime"

    strfmt "github.com/go-openapi/strfmt"
)

// New creates a new providers API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
    return &Client{transport: transport, formats: formats}
}

/*
Client for providers API
*/
type Client struct {
    transport runtime.ClientTransport
    formats   strfmt.Registry
}

/*
ProvidersGet Gets the specified resource provider.
*/
func (a *Client) ProvidersGet(params *ProvidersGetParams, authInfo runtime.ClientAuthInfoWriter) (*ProvidersGetOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewProvidersGetParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "Providers_Get",
        Method:             "GET",
        PathPattern:        "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ProvidersGetReader{formats: a.formats},
        AuthInfo:           authInfo,
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ProvidersGetOK), nil

}

/*
ProvidersList Gets all resource providers for a subscription.
*/
func (a *Client) ProvidersList(params *ProvidersListParams, authInfo runtime.ClientAuthInfoWriter) (*ProvidersListOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewProvidersListParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "Providers_List",
        Method:             "GET",
        PathPattern:        "/subscriptions/{subscriptionId}/providers",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ProvidersListReader{formats: a.formats},
        AuthInfo:           authInfo,
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ProvidersListOK), nil

}

/*
ProvidersRegister Registers a subscription with a resource provider.
*/
func (a *Client) ProvidersRegister(params *ProvidersRegisterParams, authInfo runtime.ClientAuthInfoWriter) (*ProvidersRegisterOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewProvidersRegisterParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "Providers_Register",
        Method:             "POST",
        PathPattern:        "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ProvidersRegisterReader{formats: a.formats},
        AuthInfo:           authInfo,
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ProvidersRegisterOK), nil

}

/*
ProvidersUnregister Unregisters a subscription from a resource provider.
*/
func (a *Client) ProvidersUnregister(params *ProvidersUnregisterParams, authInfo runtime.ClientAuthInfoWriter) (*ProvidersUnregisterOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewProvidersUnregisterParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "Providers_Unregister",
        Method:             "POST",
        PathPattern:        "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ProvidersUnregisterReader{formats: a.formats},
        AuthInfo:           authInfo,
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ProvidersUnregisterOK), nil

}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
    a.transport = transport
}