bjerkio/crayon-api-go

View on GitHub
client/customer_tenants/get_customer_tenants_parameters.go

Summary

Maintainability
D
2 days
Test Coverage
// Code generated by go-swagger; DO NOT EDIT.

package customer_tenants

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

import (
    "context"
    "net/http"
    "time"

    "github.com/go-openapi/errors"
    "github.com/go-openapi/runtime"
    cr "github.com/go-openapi/runtime/client"
    "github.com/go-openapi/strfmt"
    "github.com/go-openapi/swag"
)

// NewGetCustomerTenantsParams creates a new GetCustomerTenantsParams object
// with the default values initialized.
func NewGetCustomerTenantsParams() *GetCustomerTenantsParams {
    var ()
    return &GetCustomerTenantsParams{

        timeout: cr.DefaultTimeout,
    }
}

// NewGetCustomerTenantsParamsWithTimeout creates a new GetCustomerTenantsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetCustomerTenantsParamsWithTimeout(timeout time.Duration) *GetCustomerTenantsParams {
    var ()
    return &GetCustomerTenantsParams{

        timeout: timeout,
    }
}

// NewGetCustomerTenantsParamsWithContext creates a new GetCustomerTenantsParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetCustomerTenantsParamsWithContext(ctx context.Context) *GetCustomerTenantsParams {
    var ()
    return &GetCustomerTenantsParams{

        Context: ctx,
    }
}

// NewGetCustomerTenantsParamsWithHTTPClient creates a new GetCustomerTenantsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetCustomerTenantsParamsWithHTTPClient(client *http.Client) *GetCustomerTenantsParams {
    var ()
    return &GetCustomerTenantsParams{
        HTTPClient: client,
    }
}

/*GetCustomerTenantsParams contains all the parameters to send to the API endpoint
for the get customer tenants operation typically these are written to a http.Request
*/
type GetCustomerTenantsParams struct {

    /*ConsumerID*/
    ConsumerID *int32
    /*CustomerTenantType*/
    CustomerTenantType *string
    /*Domain*/
    Domain *string
    /*DomainPrefix*/
    DomainPrefix *string
    /*InvoiceProfileID*/
    InvoiceProfileID *int32
    /*OrganizationID*/
    OrganizationID *int32
    /*Page*/
    Page *int32
    /*PageSize*/
    PageSize *int32
    /*ProgramID*/
    ProgramID *int32
    /*PublisherID*/
    PublisherID *int32
    /*Search*/
    Search *string

    timeout    time.Duration
    Context    context.Context
    HTTPClient *http.Client
}

// WithTimeout adds the timeout to the get customer tenants params
func (o *GetCustomerTenantsParams) WithTimeout(timeout time.Duration) *GetCustomerTenantsParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the get customer tenants params
func (o *GetCustomerTenantsParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the get customer tenants params
func (o *GetCustomerTenantsParams) WithContext(ctx context.Context) *GetCustomerTenantsParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the get customer tenants params
func (o *GetCustomerTenantsParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get customer tenants params
func (o *GetCustomerTenantsParams) WithHTTPClient(client *http.Client) *GetCustomerTenantsParams {
    o.SetHTTPClient(client)
    return o
}

// SetHTTPClient adds the HTTPClient to the get customer tenants params
func (o *GetCustomerTenantsParams) SetHTTPClient(client *http.Client) {
    o.HTTPClient = client
}

// WithConsumerID adds the consumerID to the get customer tenants params
func (o *GetCustomerTenantsParams) WithConsumerID(consumerID *int32) *GetCustomerTenantsParams {
    o.SetConsumerID(consumerID)
    return o
}

// SetConsumerID adds the consumerId to the get customer tenants params
func (o *GetCustomerTenantsParams) SetConsumerID(consumerID *int32) {
    o.ConsumerID = consumerID
}

// WithCustomerTenantType adds the customerTenantType to the get customer tenants params
func (o *GetCustomerTenantsParams) WithCustomerTenantType(customerTenantType *string) *GetCustomerTenantsParams {
    o.SetCustomerTenantType(customerTenantType)
    return o
}

// SetCustomerTenantType adds the customerTenantType to the get customer tenants params
func (o *GetCustomerTenantsParams) SetCustomerTenantType(customerTenantType *string) {
    o.CustomerTenantType = customerTenantType
}

// WithDomain adds the domain to the get customer tenants params
func (o *GetCustomerTenantsParams) WithDomain(domain *string) *GetCustomerTenantsParams {
    o.SetDomain(domain)
    return o
}

// SetDomain adds the domain to the get customer tenants params
func (o *GetCustomerTenantsParams) SetDomain(domain *string) {
    o.Domain = domain
}

// WithDomainPrefix adds the domainPrefix to the get customer tenants params
func (o *GetCustomerTenantsParams) WithDomainPrefix(domainPrefix *string) *GetCustomerTenantsParams {
    o.SetDomainPrefix(domainPrefix)
    return o
}

// SetDomainPrefix adds the domainPrefix to the get customer tenants params
func (o *GetCustomerTenantsParams) SetDomainPrefix(domainPrefix *string) {
    o.DomainPrefix = domainPrefix
}

// WithInvoiceProfileID adds the invoiceProfileID to the get customer tenants params
func (o *GetCustomerTenantsParams) WithInvoiceProfileID(invoiceProfileID *int32) *GetCustomerTenantsParams {
    o.SetInvoiceProfileID(invoiceProfileID)
    return o
}

// SetInvoiceProfileID adds the invoiceProfileId to the get customer tenants params
func (o *GetCustomerTenantsParams) SetInvoiceProfileID(invoiceProfileID *int32) {
    o.InvoiceProfileID = invoiceProfileID
}

// WithOrganizationID adds the organizationID to the get customer tenants params
func (o *GetCustomerTenantsParams) WithOrganizationID(organizationID *int32) *GetCustomerTenantsParams {
    o.SetOrganizationID(organizationID)
    return o
}

// SetOrganizationID adds the organizationId to the get customer tenants params
func (o *GetCustomerTenantsParams) SetOrganizationID(organizationID *int32) {
    o.OrganizationID = organizationID
}

// WithPage adds the page to the get customer tenants params
func (o *GetCustomerTenantsParams) WithPage(page *int32) *GetCustomerTenantsParams {
    o.SetPage(page)
    return o
}

// SetPage adds the page to the get customer tenants params
func (o *GetCustomerTenantsParams) SetPage(page *int32) {
    o.Page = page
}

// WithPageSize adds the pageSize to the get customer tenants params
func (o *GetCustomerTenantsParams) WithPageSize(pageSize *int32) *GetCustomerTenantsParams {
    o.SetPageSize(pageSize)
    return o
}

// SetPageSize adds the pageSize to the get customer tenants params
func (o *GetCustomerTenantsParams) SetPageSize(pageSize *int32) {
    o.PageSize = pageSize
}

// WithProgramID adds the programID to the get customer tenants params
func (o *GetCustomerTenantsParams) WithProgramID(programID *int32) *GetCustomerTenantsParams {
    o.SetProgramID(programID)
    return o
}

// SetProgramID adds the programId to the get customer tenants params
func (o *GetCustomerTenantsParams) SetProgramID(programID *int32) {
    o.ProgramID = programID
}

// WithPublisherID adds the publisherID to the get customer tenants params
func (o *GetCustomerTenantsParams) WithPublisherID(publisherID *int32) *GetCustomerTenantsParams {
    o.SetPublisherID(publisherID)
    return o
}

// SetPublisherID adds the publisherId to the get customer tenants params
func (o *GetCustomerTenantsParams) SetPublisherID(publisherID *int32) {
    o.PublisherID = publisherID
}

// WithSearch adds the search to the get customer tenants params
func (o *GetCustomerTenantsParams) WithSearch(search *string) *GetCustomerTenantsParams {
    o.SetSearch(search)
    return o
}

// SetSearch adds the search to the get customer tenants params
func (o *GetCustomerTenantsParams) SetSearch(search *string) {
    o.Search = search
}

// WriteToRequest writes these params to a swagger request
func (o *GetCustomerTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

    if err := r.SetTimeout(o.timeout); err != nil {
        return err
    }
    var res []error

    if o.ConsumerID != nil {

        // query param ConsumerId
        var qrConsumerID int32
        if o.ConsumerID != nil {
            qrConsumerID = *o.ConsumerID
        }
        qConsumerID := swag.FormatInt32(qrConsumerID)
        if qConsumerID != "" {
            if err := r.SetQueryParam("ConsumerId", qConsumerID); err != nil {
                return err
            }
        }

    }

    if o.CustomerTenantType != nil {

        // query param CustomerTenantType
        var qrCustomerTenantType string
        if o.CustomerTenantType != nil {
            qrCustomerTenantType = *o.CustomerTenantType
        }
        qCustomerTenantType := qrCustomerTenantType
        if qCustomerTenantType != "" {
            if err := r.SetQueryParam("CustomerTenantType", qCustomerTenantType); err != nil {
                return err
            }
        }

    }

    if o.Domain != nil {

        // query param Domain
        var qrDomain string
        if o.Domain != nil {
            qrDomain = *o.Domain
        }
        qDomain := qrDomain
        if qDomain != "" {
            if err := r.SetQueryParam("Domain", qDomain); err != nil {
                return err
            }
        }

    }

    if o.DomainPrefix != nil {

        // query param DomainPrefix
        var qrDomainPrefix string
        if o.DomainPrefix != nil {
            qrDomainPrefix = *o.DomainPrefix
        }
        qDomainPrefix := qrDomainPrefix
        if qDomainPrefix != "" {
            if err := r.SetQueryParam("DomainPrefix", qDomainPrefix); err != nil {
                return err
            }
        }

    }

    if o.InvoiceProfileID != nil {

        // query param InvoiceProfileId
        var qrInvoiceProfileID int32
        if o.InvoiceProfileID != nil {
            qrInvoiceProfileID = *o.InvoiceProfileID
        }
        qInvoiceProfileID := swag.FormatInt32(qrInvoiceProfileID)
        if qInvoiceProfileID != "" {
            if err := r.SetQueryParam("InvoiceProfileId", qInvoiceProfileID); err != nil {
                return err
            }
        }

    }

    if o.OrganizationID != nil {

        // query param OrganizationId
        var qrOrganizationID int32
        if o.OrganizationID != nil {
            qrOrganizationID = *o.OrganizationID
        }
        qOrganizationID := swag.FormatInt32(qrOrganizationID)
        if qOrganizationID != "" {
            if err := r.SetQueryParam("OrganizationId", qOrganizationID); err != nil {
                return err
            }
        }

    }

    if o.Page != nil {

        // query param Page
        var qrPage int32
        if o.Page != nil {
            qrPage = *o.Page
        }
        qPage := swag.FormatInt32(qrPage)
        if qPage != "" {
            if err := r.SetQueryParam("Page", qPage); err != nil {
                return err
            }
        }

    }

    if o.PageSize != nil {

        // query param PageSize
        var qrPageSize int32
        if o.PageSize != nil {
            qrPageSize = *o.PageSize
        }
        qPageSize := swag.FormatInt32(qrPageSize)
        if qPageSize != "" {
            if err := r.SetQueryParam("PageSize", qPageSize); err != nil {
                return err
            }
        }

    }

    if o.ProgramID != nil {

        // query param ProgramId
        var qrProgramID int32
        if o.ProgramID != nil {
            qrProgramID = *o.ProgramID
        }
        qProgramID := swag.FormatInt32(qrProgramID)
        if qProgramID != "" {
            if err := r.SetQueryParam("ProgramId", qProgramID); err != nil {
                return err
            }
        }

    }

    if o.PublisherID != nil {

        // query param PublisherId
        var qrPublisherID int32
        if o.PublisherID != nil {
            qrPublisherID = *o.PublisherID
        }
        qPublisherID := swag.FormatInt32(qrPublisherID)
        if qPublisherID != "" {
            if err := r.SetQueryParam("PublisherId", qPublisherID); err != nil {
                return err
            }
        }

    }

    if o.Search != nil {

        // query param Search
        var qrSearch string
        if o.Search != nil {
            qrSearch = *o.Search
        }
        qSearch := qrSearch
        if qSearch != "" {
            if err := r.SetQueryParam("Search", qSearch); err != nil {
                return err
            }
        }

    }

    if len(res) > 0 {
        return errors.CompositeValidationError(res...)
    }
    return nil
}