From 2bf940ce8800633056caf534042b3cd37551824b Mon Sep 17 00:00:00 2001 From: "Simen A. W. Olsen" Date: Mon, 28 Sep 2020 13:56:18 +0200 Subject: [PATCH] feat: Add missing methods --- Makefile | 7 +- client/activity_logs/activity_logs_client.go | 73 + .../get_activity_logs_parameters.go | 342 + .../get_activity_logs_responses.go | 69 + client/addresses/addresses_client.go | 73 + client/addresses/get_addresses_parameters.go | 162 + client/addresses/get_addresses_responses.go | 69 + .../agreement_products_client.go | 37 + .../get_agreement_products_parameters.go | 1270 + .../get_agreement_products_responses.go | 69 + .../agreement_reports_client.go | 37 + .../get_agreement_reports_parameters.go | 133 + .../get_agreement_reports_responses.go | 69 + client/agreements/agreements_client.go | 73 + .../agreements/get_agreements_parameters.go | 575 + client/agreements/get_agreements_responses.go | 69 + client/assets/assets_client.go | 37 + client/assets/get_assets_parameters.go | 397 + client/assets/get_assets_responses.go | 69 + client/aws_accounts/aws_accounts_client.go | 37 + .../put_aws_accounts_parameters.go | 154 + .../put_aws_accounts_responses.go | 69 + client/azure_plans/azure_plans_client.go | 37 - client/clients/clients_client.go | 184 + client/clients/delete_clients_parameters.go | 132 + client/clients/delete_clients_responses.go | 65 + client/clients/get_clients_parameters.go | 202 + client/clients/get_clients_responses.go | 69 + client/clients/post_clients_parameters.go | 135 + client/clients/post_clients_responses.go | 69 + client/clients/put_clients_parameters.go | 153 + client/clients/put_clients_responses.go | 69 + client/consumers/consumers_client.go | 37 + client/consumers/get_consumers_parameters.go | 231 + client/consumers/get_consumers_responses.go | 69 + .../crayon_accounts/crayon_accounts_client.go | 74 + .../post_crayon_accounts_parameters.go | 135 + .../post_crayon_accounts_responses.go | 69 + .../put_crayon_accounts_parameters.go | 154 + .../put_crayon_accounts_responses.go | 69 + client/crayon_group_customer_api_client.go | 50 + .../customer_tenant_agreements_client.go | 37 + ...t_customer_tenant_agreements_parameters.go | 162 + ...et_customer_tenant_agreements_responses.go | 69 + .../customer_tenants_client.go | 111 + .../get_customer_tenants_parameters.go | 434 + .../get_customer_tenants_responses.go | 69 + .../post_customer_tenants_parameters.go | 135 + .../post_customer_tenants_responses.go | 69 + .../put_customer_tenants_parameters.go | 154 + .../put_customer_tenants_responses.go | 69 + .../customer_token/customer_token_client.go | 73 + .../post_customer_token_parameters.go | 112 + .../post_customer_token_responses.go | 69 + .../groupings/delete_groupings_parameters.go | 133 + .../groupings/delete_groupings_responses.go | 54 + client/groupings/get_groupings_parameters.go | 260 + client/groupings/get_groupings_responses.go | 69 + client/groupings/groupings_client.go | 184 + client/groupings/post_groupings_parameters.go | 135 + client/groupings/post_groupings_responses.go | 69 + client/groupings/put_groupings_parameters.go | 154 + client/groupings/put_groupings_responses.go | 69 + .../delete_invoice_profiles_parameters.go | 133 + .../delete_invoice_profiles_responses.go | 65 + .../get_invoice_profiles_parameters.go | 231 + .../get_invoice_profiles_responses.go | 69 + .../invoice_profiles_client.go | 184 + .../post_invoice_profiles_parameters.go | 135 + .../post_invoice_profiles_responses.go | 69 + .../put_invoice_profiles_parameters.go | 154 + .../put_invoice_profiles_responses.go | 69 + .../get_management_links_parameters.go | 221 + .../get_management_links_responses.go | 69 + .../management_links_client.go | 37 + client/me/get_me_parameters.go | 112 + client/me/get_me_responses.go | 69 + client/me/me_client.go | 73 + .../get_organization_access_responses.go | 2 +- .../organization_access_client.go | 39 +- .../put_organization_access_parameters.go | 135 + .../put_organization_access_responses.go | 67 + .../get_organizations_parameters.go | 202 + .../get_organizations_responses.go | 69 + client/organizations/organizations_client.go | 37 + client/ping/get_ping_parameters.go | 112 + client/ping/get_ping_responses.go | 54 + client/ping/ping_client.go | 73 + .../get_product_containers_parameters.go | 579 + .../get_product_containers_responses.go | 69 + .../product_containers_client.go | 74 + .../put_product_containers_parameters.go | 195 + .../put_product_containers_responses.go | 69 + client/programs/get_programs_parameters.go | 289 + client/programs/get_programs_responses.go | 69 + client/programs/programs_client.go | 73 + .../publishers/get_publishers_parameters.go | 252 + client/publishers/get_publishers_responses.go | 69 + client/publishers/publishers_client.go | 37 + client/regions/get_regions_parameters.go | 260 + client/regions/get_regions_responses.go | 69 + client/regions/regions_client.go | 37 + client/secrets/delete_secrets_parameters.go | 173 + client/secrets/delete_secrets_responses.go | 65 + client/secrets/post_secrets_parameters.go | 135 + client/secrets/post_secrets_responses.go | 69 + client/secrets/secrets_client.go | 53 +- .../get_subscriptions_parameters.go | 405 + .../get_subscriptions_responses.go | 69 + .../post_subscriptions_parameters.go | 135 + .../post_subscriptions_responses.go | 69 + .../put_subscriptions_parameters.go | 154 + .../put_subscriptions_responses.go | 69 + client/subscriptions/subscriptions_client.go | 73 +- client/users/get_users_parameters.go | 260 + client/users/get_users_responses.go | 69 + client/users/users_client.go | 52 +- go.mod | 1 + go.sum | 5 + internal/cmd/convert-swagger/main.go | 63 + log.txt | 12 + swagger.json | 21544 ++++++++-------- tools.go | 1 + 123 files changed, 25519 insertions(+), 11161 deletions(-) create mode 100644 client/activity_logs/activity_logs_client.go create mode 100644 client/activity_logs/get_activity_logs_parameters.go create mode 100644 client/activity_logs/get_activity_logs_responses.go create mode 100644 client/addresses/addresses_client.go create mode 100644 client/addresses/get_addresses_parameters.go create mode 100644 client/addresses/get_addresses_responses.go create mode 100644 client/agreement_products/get_agreement_products_parameters.go create mode 100644 client/agreement_products/get_agreement_products_responses.go create mode 100644 client/agreement_reports/get_agreement_reports_parameters.go create mode 100644 client/agreement_reports/get_agreement_reports_responses.go create mode 100644 client/agreements/agreements_client.go create mode 100644 client/agreements/get_agreements_parameters.go create mode 100644 client/agreements/get_agreements_responses.go create mode 100644 client/assets/get_assets_parameters.go create mode 100644 client/assets/get_assets_responses.go create mode 100644 client/aws_accounts/put_aws_accounts_parameters.go create mode 100644 client/aws_accounts/put_aws_accounts_responses.go create mode 100644 client/clients/clients_client.go create mode 100644 client/clients/delete_clients_parameters.go create mode 100644 client/clients/delete_clients_responses.go create mode 100644 client/clients/get_clients_parameters.go create mode 100644 client/clients/get_clients_responses.go create mode 100644 client/clients/post_clients_parameters.go create mode 100644 client/clients/post_clients_responses.go create mode 100644 client/clients/put_clients_parameters.go create mode 100644 client/clients/put_clients_responses.go create mode 100644 client/consumers/get_consumers_parameters.go create mode 100644 client/consumers/get_consumers_responses.go create mode 100644 client/crayon_accounts/post_crayon_accounts_parameters.go create mode 100644 client/crayon_accounts/post_crayon_accounts_responses.go create mode 100644 client/crayon_accounts/put_crayon_accounts_parameters.go create mode 100644 client/crayon_accounts/put_crayon_accounts_responses.go create mode 100644 client/customer_tenant_agreements/get_customer_tenant_agreements_parameters.go create mode 100644 client/customer_tenant_agreements/get_customer_tenant_agreements_responses.go create mode 100644 client/customer_tenants/get_customer_tenants_parameters.go create mode 100644 client/customer_tenants/get_customer_tenants_responses.go create mode 100644 client/customer_tenants/post_customer_tenants_parameters.go create mode 100644 client/customer_tenants/post_customer_tenants_responses.go create mode 100644 client/customer_tenants/put_customer_tenants_parameters.go create mode 100644 client/customer_tenants/put_customer_tenants_responses.go create mode 100644 client/customer_token/customer_token_client.go create mode 100644 client/customer_token/post_customer_token_parameters.go create mode 100644 client/customer_token/post_customer_token_responses.go create mode 100644 client/groupings/delete_groupings_parameters.go create mode 100644 client/groupings/delete_groupings_responses.go create mode 100644 client/groupings/get_groupings_parameters.go create mode 100644 client/groupings/get_groupings_responses.go create mode 100644 client/groupings/groupings_client.go create mode 100644 client/groupings/post_groupings_parameters.go create mode 100644 client/groupings/post_groupings_responses.go create mode 100644 client/groupings/put_groupings_parameters.go create mode 100644 client/groupings/put_groupings_responses.go create mode 100644 client/invoice_profiles/delete_invoice_profiles_parameters.go create mode 100644 client/invoice_profiles/delete_invoice_profiles_responses.go create mode 100644 client/invoice_profiles/get_invoice_profiles_parameters.go create mode 100644 client/invoice_profiles/get_invoice_profiles_responses.go create mode 100644 client/invoice_profiles/invoice_profiles_client.go create mode 100644 client/invoice_profiles/post_invoice_profiles_parameters.go create mode 100644 client/invoice_profiles/post_invoice_profiles_responses.go create mode 100644 client/invoice_profiles/put_invoice_profiles_parameters.go create mode 100644 client/invoice_profiles/put_invoice_profiles_responses.go create mode 100644 client/management_links/get_management_links_parameters.go create mode 100644 client/management_links/get_management_links_responses.go create mode 100644 client/me/get_me_parameters.go create mode 100644 client/me/get_me_responses.go create mode 100644 client/me/me_client.go create mode 100644 client/organization_access/put_organization_access_parameters.go create mode 100644 client/organization_access/put_organization_access_responses.go create mode 100644 client/organizations/get_organizations_parameters.go create mode 100644 client/organizations/get_organizations_responses.go create mode 100644 client/ping/get_ping_parameters.go create mode 100644 client/ping/get_ping_responses.go create mode 100644 client/ping/ping_client.go create mode 100644 client/product_containers/get_product_containers_parameters.go create mode 100644 client/product_containers/get_product_containers_responses.go create mode 100644 client/product_containers/put_product_containers_parameters.go create mode 100644 client/product_containers/put_product_containers_responses.go create mode 100644 client/programs/get_programs_parameters.go create mode 100644 client/programs/get_programs_responses.go create mode 100644 client/programs/programs_client.go create mode 100644 client/publishers/get_publishers_parameters.go create mode 100644 client/publishers/get_publishers_responses.go create mode 100644 client/regions/get_regions_parameters.go create mode 100644 client/regions/get_regions_responses.go create mode 100644 client/secrets/delete_secrets_parameters.go create mode 100644 client/secrets/delete_secrets_responses.go create mode 100644 client/secrets/post_secrets_parameters.go create mode 100644 client/secrets/post_secrets_responses.go create mode 100644 client/subscriptions/get_subscriptions_parameters.go create mode 100644 client/subscriptions/get_subscriptions_responses.go create mode 100644 client/subscriptions/post_subscriptions_parameters.go create mode 100644 client/subscriptions/post_subscriptions_responses.go create mode 100644 client/subscriptions/put_subscriptions_parameters.go create mode 100644 client/subscriptions/put_subscriptions_responses.go create mode 100644 client/users/get_users_parameters.go create mode 100644 client/users/get_users_responses.go create mode 100644 internal/cmd/convert-swagger/main.go create mode 100644 log.txt diff --git a/Makefile b/Makefile index 306cb70..d5abb36 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,10 @@ -all: install_deps download_swagger generate +all: install_deps generate .PHONY: install_deps install_deps: - # go get -u github.com/google/addlicense docker pull quay.io/goswagger/swagger go generate ./tools.go -.PHONY: download_swagger -download_swagger: - curl -o ./swagger.json https://api.crayon.com/swagger/v1/swagger.json - .PHONY: generate generate: alias swagger="docker run --rm -it -e GOPATH=$$HOME/go:/go -v $$HOME:$$HOME -w $$(pwd) quay.io/goswagger/swagger" diff --git a/client/activity_logs/activity_logs_client.go b/client/activity_logs/activity_logs_client.go new file mode 100644 index 0000000..a664a0e --- /dev/null +++ b/client/activity_logs/activity_logs_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package activity_logs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new activity logs API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for activity logs API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetActivityLogs(params *GetActivityLogsParams, authInfo runtime.ClientAuthInfoWriter) (*GetActivityLogsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetActivityLogs get activity logs API +*/ +func (a *Client) GetActivityLogs(params *GetActivityLogsParams, authInfo runtime.ClientAuthInfoWriter) (*GetActivityLogsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetActivityLogsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetActivityLogs", + Method: "GET", + PathPattern: "/api/v1/ActivityLogs", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetActivityLogsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetActivityLogsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetActivityLogs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/activity_logs/get_activity_logs_parameters.go b/client/activity_logs/get_activity_logs_parameters.go new file mode 100644 index 0000000..314b5fb --- /dev/null +++ b/client/activity_logs/get_activity_logs_parameters.go @@ -0,0 +1,342 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package activity_logs + +// 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" +) + +// NewGetActivityLogsParams creates a new GetActivityLogsParams object +// with the default values initialized. +func NewGetActivityLogsParams() *GetActivityLogsParams { + var () + return &GetActivityLogsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetActivityLogsParamsWithTimeout creates a new GetActivityLogsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetActivityLogsParamsWithTimeout(timeout time.Duration) *GetActivityLogsParams { + var () + return &GetActivityLogsParams{ + + timeout: timeout, + } +} + +// NewGetActivityLogsParamsWithContext creates a new GetActivityLogsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetActivityLogsParamsWithContext(ctx context.Context) *GetActivityLogsParams { + var () + return &GetActivityLogsParams{ + + Context: ctx, + } +} + +// NewGetActivityLogsParamsWithHTTPClient creates a new GetActivityLogsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetActivityLogsParamsWithHTTPClient(client *http.Client) *GetActivityLogsParams { + var () + return &GetActivityLogsParams{ + HTTPClient: client, + } +} + +/*GetActivityLogsParams contains all the parameters to send to the API endpoint +for the get activity logs operation typically these are written to a http.Request +*/ +type GetActivityLogsParams struct { + + /*Entity*/ + Entity *string + /*From*/ + From *strfmt.DateTime + /*ID*/ + ID *int32 + /*Ids*/ + Ids []int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*SearchDate*/ + SearchDate *strfmt.DateTime + /*To*/ + To *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get activity logs params +func (o *GetActivityLogsParams) WithTimeout(timeout time.Duration) *GetActivityLogsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get activity logs params +func (o *GetActivityLogsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get activity logs params +func (o *GetActivityLogsParams) WithContext(ctx context.Context) *GetActivityLogsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get activity logs params +func (o *GetActivityLogsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get activity logs params +func (o *GetActivityLogsParams) WithHTTPClient(client *http.Client) *GetActivityLogsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get activity logs params +func (o *GetActivityLogsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEntity adds the entity to the get activity logs params +func (o *GetActivityLogsParams) WithEntity(entity *string) *GetActivityLogsParams { + o.SetEntity(entity) + return o +} + +// SetEntity adds the entity to the get activity logs params +func (o *GetActivityLogsParams) SetEntity(entity *string) { + o.Entity = entity +} + +// WithFrom adds the from to the get activity logs params +func (o *GetActivityLogsParams) WithFrom(from *strfmt.DateTime) *GetActivityLogsParams { + o.SetFrom(from) + return o +} + +// SetFrom adds the from to the get activity logs params +func (o *GetActivityLogsParams) SetFrom(from *strfmt.DateTime) { + o.From = from +} + +// WithID adds the id to the get activity logs params +func (o *GetActivityLogsParams) WithID(id *int32) *GetActivityLogsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get activity logs params +func (o *GetActivityLogsParams) SetID(id *int32) { + o.ID = id +} + +// WithIds adds the ids to the get activity logs params +func (o *GetActivityLogsParams) WithIds(ids []int32) *GetActivityLogsParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get activity logs params +func (o *GetActivityLogsParams) SetIds(ids []int32) { + o.Ids = ids +} + +// WithPage adds the page to the get activity logs params +func (o *GetActivityLogsParams) WithPage(page *int32) *GetActivityLogsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get activity logs params +func (o *GetActivityLogsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get activity logs params +func (o *GetActivityLogsParams) WithPageSize(pageSize *int32) *GetActivityLogsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get activity logs params +func (o *GetActivityLogsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithSearchDate adds the searchDate to the get activity logs params +func (o *GetActivityLogsParams) WithSearchDate(searchDate *strfmt.DateTime) *GetActivityLogsParams { + o.SetSearchDate(searchDate) + return o +} + +// SetSearchDate adds the searchDate to the get activity logs params +func (o *GetActivityLogsParams) SetSearchDate(searchDate *strfmt.DateTime) { + o.SearchDate = searchDate +} + +// WithTo adds the to to the get activity logs params +func (o *GetActivityLogsParams) WithTo(to *strfmt.DateTime) *GetActivityLogsParams { + o.SetTo(to) + return o +} + +// SetTo adds the to to the get activity logs params +func (o *GetActivityLogsParams) SetTo(to *strfmt.DateTime) { + o.To = to +} + +// WriteToRequest writes these params to a swagger request +func (o *GetActivityLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Entity != nil { + + // query param Entity + var qrEntity string + if o.Entity != nil { + qrEntity = *o.Entity + } + qEntity := qrEntity + if qEntity != "" { + if err := r.SetQueryParam("Entity", qEntity); err != nil { + return err + } + } + + } + + if o.From != nil { + + // query param From + var qrFrom strfmt.DateTime + if o.From != nil { + qrFrom = *o.From + } + qFrom := qrFrom.String() + if qFrom != "" { + if err := r.SetQueryParam("From", qFrom); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param Id + var qrID int32 + if o.ID != nil { + qrID = *o.ID + } + qID := swag.FormatInt32(qrID) + if qID != "" { + if err := r.SetQueryParam("Id", qID); err != nil { + return err + } + } + + } + + var valuesIds []string + for _, v := range o.Ids { + valuesIds = append(valuesIds, swag.FormatInt32(v)) + } + + joinedIds := swag.JoinByFormat(valuesIds, "multi") + // query array param Ids + if err := r.SetQueryParam("Ids", joinedIds...); 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.SearchDate != nil { + + // query param SearchDate + var qrSearchDate strfmt.DateTime + if o.SearchDate != nil { + qrSearchDate = *o.SearchDate + } + qSearchDate := qrSearchDate.String() + if qSearchDate != "" { + if err := r.SetQueryParam("SearchDate", qSearchDate); err != nil { + return err + } + } + + } + + if o.To != nil { + + // query param To + var qrTo strfmt.DateTime + if o.To != nil { + qrTo = *o.To + } + qTo := qrTo.String() + if qTo != "" { + if err := r.SetQueryParam("To", qTo); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/activity_logs/get_activity_logs_responses.go b/client/activity_logs/get_activity_logs_responses.go new file mode 100644 index 0000000..562ef0e --- /dev/null +++ b/client/activity_logs/get_activity_logs_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package activity_logs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetActivityLogsReader is a Reader for the GetActivityLogs structure. +type GetActivityLogsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetActivityLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetActivityLogsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetActivityLogsOK creates a GetActivityLogsOK with default headers values +func NewGetActivityLogsOK() *GetActivityLogsOK { + return &GetActivityLogsOK{} +} + +/*GetActivityLogsOK handles this case with default header values. + +Success +*/ +type GetActivityLogsOK struct { + Payload *models.ActivityLog +} + +func (o *GetActivityLogsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/ActivityLogs][%d] getActivityLogsOK %+v", 200, o.Payload) +} + +func (o *GetActivityLogsOK) GetPayload() *models.ActivityLog { + return o.Payload +} + +func (o *GetActivityLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ActivityLog) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/addresses/addresses_client.go b/client/addresses/addresses_client.go new file mode 100644 index 0000000..b76e726 --- /dev/null +++ b/client/addresses/addresses_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new addresses API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for addresses API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAddresses(params *GetAddressesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAddressesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAddresses get addresses API +*/ +func (a *Client) GetAddresses(params *GetAddressesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAddressesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAddressesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAddresses", + Method: "GET", + PathPattern: "/api/v1/organizations/{organizationId}/Addresses", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAddressesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAddressesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetAddresses: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/addresses/get_addresses_parameters.go b/client/addresses/get_addresses_parameters.go new file mode 100644 index 0000000..83bbf0c --- /dev/null +++ b/client/addresses/get_addresses_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// 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" +) + +// NewGetAddressesParams creates a new GetAddressesParams object +// with the default values initialized. +func NewGetAddressesParams() *GetAddressesParams { + var () + return &GetAddressesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAddressesParamsWithTimeout creates a new GetAddressesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAddressesParamsWithTimeout(timeout time.Duration) *GetAddressesParams { + var () + return &GetAddressesParams{ + + timeout: timeout, + } +} + +// NewGetAddressesParamsWithContext creates a new GetAddressesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAddressesParamsWithContext(ctx context.Context) *GetAddressesParams { + var () + return &GetAddressesParams{ + + Context: ctx, + } +} + +// NewGetAddressesParamsWithHTTPClient creates a new GetAddressesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAddressesParamsWithHTTPClient(client *http.Client) *GetAddressesParams { + var () + return &GetAddressesParams{ + HTTPClient: client, + } +} + +/*GetAddressesParams contains all the parameters to send to the API endpoint +for the get addresses operation typically these are written to a http.Request +*/ +type GetAddressesParams struct { + + /*OrganizationID*/ + OrganizationID int32 + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get addresses params +func (o *GetAddressesParams) WithTimeout(timeout time.Duration) *GetAddressesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get addresses params +func (o *GetAddressesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get addresses params +func (o *GetAddressesParams) WithContext(ctx context.Context) *GetAddressesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get addresses params +func (o *GetAddressesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get addresses params +func (o *GetAddressesParams) WithHTTPClient(client *http.Client) *GetAddressesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get addresses params +func (o *GetAddressesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrganizationID adds the organizationID to the get addresses params +func (o *GetAddressesParams) WithOrganizationID(organizationID int32) *GetAddressesParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get addresses params +func (o *GetAddressesParams) SetOrganizationID(organizationID int32) { + o.OrganizationID = organizationID +} + +// WithType adds the typeVar to the get addresses params +func (o *GetAddressesParams) WithType(typeVar *string) *GetAddressesParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get addresses params +func (o *GetAddressesParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAddressesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param organizationId + if err := r.SetPathParam("organizationId", swag.FormatInt32(o.OrganizationID)); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/addresses/get_addresses_responses.go b/client/addresses/get_addresses_responses.go new file mode 100644 index 0000000..216fc31 --- /dev/null +++ b/client/addresses/get_addresses_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetAddressesReader is a Reader for the GetAddresses structure. +type GetAddressesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAddressesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAddressesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAddressesOK creates a GetAddressesOK with default headers values +func NewGetAddressesOK() *GetAddressesOK { + return &GetAddressesOK{} +} + +/*GetAddressesOK handles this case with default header values. + +Success +*/ +type GetAddressesOK struct { + Payload *models.APICollectionOfAddress +} + +func (o *GetAddressesOK) Error() string { + return fmt.Sprintf("[GET /api/v1/organizations/{organizationId}/Addresses][%d] getAddressesOK %+v", 200, o.Payload) +} + +func (o *GetAddressesOK) GetPayload() *models.APICollectionOfAddress { + return o.Payload +} + +func (o *GetAddressesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfAddress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/agreement_products/agreement_products_client.go b/client/agreement_products/agreement_products_client.go index 184e05d..61d799e 100644 --- a/client/agreement_products/agreement_products_client.go +++ b/client/agreement_products/agreement_products_client.go @@ -27,6 +27,8 @@ type Client struct { // ClientService is the interface for Client methods type ClientService interface { + GetAgreementProducts(params *GetAgreementProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgreementProductsOK, error) + GetAsExcelFile(params *GetAsExcelFileParams, authInfo runtime.ClientAuthInfoWriter) (*GetAsExcelFileOK, error) GetOperationSdk133(params *GetOperationSdk133Params, authInfo runtime.ClientAuthInfoWriter) (*GetOperationSdk133OK, error) @@ -36,6 +38,41 @@ type ClientService interface { SetTransport(transport runtime.ClientTransport) } +/* + GetAgreementProducts get agreement products API +*/ +func (a *Client) GetAgreementProducts(params *GetAgreementProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgreementProductsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAgreementProductsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAgreementProducts", + Method: "GET", + PathPattern: "/api/v1/AgreementProducts", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAgreementProductsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAgreementProductsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetAgreementProducts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetAsExcelFile get as excel file API */ diff --git a/client/agreement_products/get_agreement_products_parameters.go b/client/agreement_products/get_agreement_products_parameters.go new file mode 100644 index 0000000..16e0a42 --- /dev/null +++ b/client/agreement_products/get_agreement_products_parameters.go @@ -0,0 +1,1270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreement_products + +// 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" +) + +// NewGetAgreementProductsParams creates a new GetAgreementProductsParams object +// with the default values initialized. +func NewGetAgreementProductsParams() *GetAgreementProductsParams { + var () + return &GetAgreementProductsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAgreementProductsParamsWithTimeout creates a new GetAgreementProductsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAgreementProductsParamsWithTimeout(timeout time.Duration) *GetAgreementProductsParams { + var () + return &GetAgreementProductsParams{ + + timeout: timeout, + } +} + +// NewGetAgreementProductsParamsWithContext creates a new GetAgreementProductsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAgreementProductsParamsWithContext(ctx context.Context) *GetAgreementProductsParams { + var () + return &GetAgreementProductsParams{ + + Context: ctx, + } +} + +// NewGetAgreementProductsParamsWithHTTPClient creates a new GetAgreementProductsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAgreementProductsParamsWithHTTPClient(client *http.Client) *GetAgreementProductsParams { + var () + return &GetAgreementProductsParams{ + HTTPClient: client, + } +} + +/*GetAgreementProductsParams contains all the parameters to send to the API endpoint +for the get agreement products operation typically these are written to a http.Request +*/ +type GetAgreementProductsParams struct { + + /*AgreementID*/ + AgreementID *int32 + /*AgreementIds*/ + AgreementIds []int32 + /*AgreementTypeIds*/ + AgreementTypeIds []string + /*CustomerTenantID*/ + CustomerTenantID *int32 + /*ExcludeLanguageNames*/ + ExcludeLanguageNames []string + /*ExcludeLevelNames*/ + ExcludeLevelNames []string + /*ExcludeLicenseAgreementTypeNames*/ + ExcludeLicenseAgreementTypeNames []string + /*ExcludeLicenseTypeNames*/ + ExcludeLicenseTypeNames []string + /*ExcludeOfferingNames*/ + ExcludeOfferingNames []string + /*ExcludeOperatingSystemNames*/ + ExcludeOperatingSystemNames []string + /*ExcludePartNumbers*/ + ExcludePartNumbers []string + /*ExcludePoolNames*/ + ExcludePoolNames []string + /*ExcludeProductCategoryNames*/ + ExcludeProductCategoryNames []string + /*ExcludeProductFamilyNames*/ + ExcludeProductFamilyNames []string + /*ExcludeProductTypeNames*/ + ExcludeProductTypeNames []string + /*ExcludeProgramNames*/ + ExcludeProgramNames []string + /*ExcludePublisherIds*/ + ExcludePublisherIds []int32 + /*ExcludePublisherNames*/ + ExcludePublisherNames []string + /*ExcludePurchasePeriodNames*/ + ExcludePurchasePeriodNames []string + /*ExcludePurchaseUnitNames*/ + ExcludePurchaseUnitNames []string + /*ExcludeRegionNames*/ + ExcludeRegionNames []string + /*ExcludeVersionNames*/ + ExcludeVersionNames []string + /*IncludeLanguageNames*/ + IncludeLanguageNames []string + /*IncludeLevelNames*/ + IncludeLevelNames []string + /*IncludeLicenseAgreementTypeNames*/ + IncludeLicenseAgreementTypeNames []string + /*IncludeLicenseTypeNames*/ + IncludeLicenseTypeNames []string + /*IncludeOfferingNames*/ + IncludeOfferingNames []string + /*IncludeOperatingSystemNames*/ + IncludeOperatingSystemNames []string + /*IncludePartNumbers*/ + IncludePartNumbers []string + /*IncludePoolNames*/ + IncludePoolNames []string + /*IncludeProductCategoryNames*/ + IncludeProductCategoryNames []string + /*IncludeProductFamilyNames*/ + IncludeProductFamilyNames []string + /*IncludeProductTypeNames*/ + IncludeProductTypeNames []string + /*IncludeProgramNames*/ + IncludeProgramNames []string + /*IncludePublisherIds*/ + IncludePublisherIds []int32 + /*IncludePublisherNames*/ + IncludePublisherNames []string + /*IncludePurchasePeriodNames*/ + IncludePurchasePeriodNames []string + /*IncludePurchaseUnitNames*/ + IncludePurchaseUnitNames []string + /*IncludeRegionNames*/ + IncludeRegionNames []string + /*IncludeVersionNames*/ + IncludeVersionNames []string + /*IncludeProductInformation*/ + IncludeProductInformation *bool + /*IsTrial*/ + IsTrial *bool + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*PriceListID*/ + PriceListID *int32 + /*Search*/ + Search *string + /*SearchDate*/ + SearchDate *strfmt.DateTime + /*SortKey*/ + SortKey *string + /*SortOrder*/ + SortOrder *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get agreement products params +func (o *GetAgreementProductsParams) WithTimeout(timeout time.Duration) *GetAgreementProductsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get agreement products params +func (o *GetAgreementProductsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get agreement products params +func (o *GetAgreementProductsParams) WithContext(ctx context.Context) *GetAgreementProductsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get agreement products params +func (o *GetAgreementProductsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get agreement products params +func (o *GetAgreementProductsParams) WithHTTPClient(client *http.Client) *GetAgreementProductsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get agreement products params +func (o *GetAgreementProductsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgreementID adds the agreementID to the get agreement products params +func (o *GetAgreementProductsParams) WithAgreementID(agreementID *int32) *GetAgreementProductsParams { + o.SetAgreementID(agreementID) + return o +} + +// SetAgreementID adds the agreementId to the get agreement products params +func (o *GetAgreementProductsParams) SetAgreementID(agreementID *int32) { + o.AgreementID = agreementID +} + +// WithAgreementIds adds the agreementIds to the get agreement products params +func (o *GetAgreementProductsParams) WithAgreementIds(agreementIds []int32) *GetAgreementProductsParams { + o.SetAgreementIds(agreementIds) + return o +} + +// SetAgreementIds adds the agreementIds to the get agreement products params +func (o *GetAgreementProductsParams) SetAgreementIds(agreementIds []int32) { + o.AgreementIds = agreementIds +} + +// WithAgreementTypeIds adds the agreementTypeIds to the get agreement products params +func (o *GetAgreementProductsParams) WithAgreementTypeIds(agreementTypeIds []string) *GetAgreementProductsParams { + o.SetAgreementTypeIds(agreementTypeIds) + return o +} + +// SetAgreementTypeIds adds the agreementTypeIds to the get agreement products params +func (o *GetAgreementProductsParams) SetAgreementTypeIds(agreementTypeIds []string) { + o.AgreementTypeIds = agreementTypeIds +} + +// WithCustomerTenantID adds the customerTenantID to the get agreement products params +func (o *GetAgreementProductsParams) WithCustomerTenantID(customerTenantID *int32) *GetAgreementProductsParams { + o.SetCustomerTenantID(customerTenantID) + return o +} + +// SetCustomerTenantID adds the customerTenantId to the get agreement products params +func (o *GetAgreementProductsParams) SetCustomerTenantID(customerTenantID *int32) { + o.CustomerTenantID = customerTenantID +} + +// WithExcludeLanguageNames adds the excludeLanguageNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeLanguageNames(excludeLanguageNames []string) *GetAgreementProductsParams { + o.SetExcludeLanguageNames(excludeLanguageNames) + return o +} + +// SetExcludeLanguageNames adds the excludeLanguageNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeLanguageNames(excludeLanguageNames []string) { + o.ExcludeLanguageNames = excludeLanguageNames +} + +// WithExcludeLevelNames adds the excludeLevelNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeLevelNames(excludeLevelNames []string) *GetAgreementProductsParams { + o.SetExcludeLevelNames(excludeLevelNames) + return o +} + +// SetExcludeLevelNames adds the excludeLevelNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeLevelNames(excludeLevelNames []string) { + o.ExcludeLevelNames = excludeLevelNames +} + +// WithExcludeLicenseAgreementTypeNames adds the excludeLicenseAgreementTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeLicenseAgreementTypeNames(excludeLicenseAgreementTypeNames []string) *GetAgreementProductsParams { + o.SetExcludeLicenseAgreementTypeNames(excludeLicenseAgreementTypeNames) + return o +} + +// SetExcludeLicenseAgreementTypeNames adds the excludeLicenseAgreementTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeLicenseAgreementTypeNames(excludeLicenseAgreementTypeNames []string) { + o.ExcludeLicenseAgreementTypeNames = excludeLicenseAgreementTypeNames +} + +// WithExcludeLicenseTypeNames adds the excludeLicenseTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeLicenseTypeNames(excludeLicenseTypeNames []string) *GetAgreementProductsParams { + o.SetExcludeLicenseTypeNames(excludeLicenseTypeNames) + return o +} + +// SetExcludeLicenseTypeNames adds the excludeLicenseTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeLicenseTypeNames(excludeLicenseTypeNames []string) { + o.ExcludeLicenseTypeNames = excludeLicenseTypeNames +} + +// WithExcludeOfferingNames adds the excludeOfferingNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeOfferingNames(excludeOfferingNames []string) *GetAgreementProductsParams { + o.SetExcludeOfferingNames(excludeOfferingNames) + return o +} + +// SetExcludeOfferingNames adds the excludeOfferingNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeOfferingNames(excludeOfferingNames []string) { + o.ExcludeOfferingNames = excludeOfferingNames +} + +// WithExcludeOperatingSystemNames adds the excludeOperatingSystemNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeOperatingSystemNames(excludeOperatingSystemNames []string) *GetAgreementProductsParams { + o.SetExcludeOperatingSystemNames(excludeOperatingSystemNames) + return o +} + +// SetExcludeOperatingSystemNames adds the excludeOperatingSystemNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeOperatingSystemNames(excludeOperatingSystemNames []string) { + o.ExcludeOperatingSystemNames = excludeOperatingSystemNames +} + +// WithExcludePartNumbers adds the excludePartNumbers to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludePartNumbers(excludePartNumbers []string) *GetAgreementProductsParams { + o.SetExcludePartNumbers(excludePartNumbers) + return o +} + +// SetExcludePartNumbers adds the excludePartNumbers to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludePartNumbers(excludePartNumbers []string) { + o.ExcludePartNumbers = excludePartNumbers +} + +// WithExcludePoolNames adds the excludePoolNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludePoolNames(excludePoolNames []string) *GetAgreementProductsParams { + o.SetExcludePoolNames(excludePoolNames) + return o +} + +// SetExcludePoolNames adds the excludePoolNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludePoolNames(excludePoolNames []string) { + o.ExcludePoolNames = excludePoolNames +} + +// WithExcludeProductCategoryNames adds the excludeProductCategoryNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeProductCategoryNames(excludeProductCategoryNames []string) *GetAgreementProductsParams { + o.SetExcludeProductCategoryNames(excludeProductCategoryNames) + return o +} + +// SetExcludeProductCategoryNames adds the excludeProductCategoryNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeProductCategoryNames(excludeProductCategoryNames []string) { + o.ExcludeProductCategoryNames = excludeProductCategoryNames +} + +// WithExcludeProductFamilyNames adds the excludeProductFamilyNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeProductFamilyNames(excludeProductFamilyNames []string) *GetAgreementProductsParams { + o.SetExcludeProductFamilyNames(excludeProductFamilyNames) + return o +} + +// SetExcludeProductFamilyNames adds the excludeProductFamilyNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeProductFamilyNames(excludeProductFamilyNames []string) { + o.ExcludeProductFamilyNames = excludeProductFamilyNames +} + +// WithExcludeProductTypeNames adds the excludeProductTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeProductTypeNames(excludeProductTypeNames []string) *GetAgreementProductsParams { + o.SetExcludeProductTypeNames(excludeProductTypeNames) + return o +} + +// SetExcludeProductTypeNames adds the excludeProductTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeProductTypeNames(excludeProductTypeNames []string) { + o.ExcludeProductTypeNames = excludeProductTypeNames +} + +// WithExcludeProgramNames adds the excludeProgramNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeProgramNames(excludeProgramNames []string) *GetAgreementProductsParams { + o.SetExcludeProgramNames(excludeProgramNames) + return o +} + +// SetExcludeProgramNames adds the excludeProgramNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeProgramNames(excludeProgramNames []string) { + o.ExcludeProgramNames = excludeProgramNames +} + +// WithExcludePublisherIds adds the excludePublisherIds to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludePublisherIds(excludePublisherIds []int32) *GetAgreementProductsParams { + o.SetExcludePublisherIds(excludePublisherIds) + return o +} + +// SetExcludePublisherIds adds the excludePublisherIds to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludePublisherIds(excludePublisherIds []int32) { + o.ExcludePublisherIds = excludePublisherIds +} + +// WithExcludePublisherNames adds the excludePublisherNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludePublisherNames(excludePublisherNames []string) *GetAgreementProductsParams { + o.SetExcludePublisherNames(excludePublisherNames) + return o +} + +// SetExcludePublisherNames adds the excludePublisherNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludePublisherNames(excludePublisherNames []string) { + o.ExcludePublisherNames = excludePublisherNames +} + +// WithExcludePurchasePeriodNames adds the excludePurchasePeriodNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludePurchasePeriodNames(excludePurchasePeriodNames []string) *GetAgreementProductsParams { + o.SetExcludePurchasePeriodNames(excludePurchasePeriodNames) + return o +} + +// SetExcludePurchasePeriodNames adds the excludePurchasePeriodNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludePurchasePeriodNames(excludePurchasePeriodNames []string) { + o.ExcludePurchasePeriodNames = excludePurchasePeriodNames +} + +// WithExcludePurchaseUnitNames adds the excludePurchaseUnitNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludePurchaseUnitNames(excludePurchaseUnitNames []string) *GetAgreementProductsParams { + o.SetExcludePurchaseUnitNames(excludePurchaseUnitNames) + return o +} + +// SetExcludePurchaseUnitNames adds the excludePurchaseUnitNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludePurchaseUnitNames(excludePurchaseUnitNames []string) { + o.ExcludePurchaseUnitNames = excludePurchaseUnitNames +} + +// WithExcludeRegionNames adds the excludeRegionNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeRegionNames(excludeRegionNames []string) *GetAgreementProductsParams { + o.SetExcludeRegionNames(excludeRegionNames) + return o +} + +// SetExcludeRegionNames adds the excludeRegionNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeRegionNames(excludeRegionNames []string) { + o.ExcludeRegionNames = excludeRegionNames +} + +// WithExcludeVersionNames adds the excludeVersionNames to the get agreement products params +func (o *GetAgreementProductsParams) WithExcludeVersionNames(excludeVersionNames []string) *GetAgreementProductsParams { + o.SetExcludeVersionNames(excludeVersionNames) + return o +} + +// SetExcludeVersionNames adds the excludeVersionNames to the get agreement products params +func (o *GetAgreementProductsParams) SetExcludeVersionNames(excludeVersionNames []string) { + o.ExcludeVersionNames = excludeVersionNames +} + +// WithIncludeLanguageNames adds the includeLanguageNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeLanguageNames(includeLanguageNames []string) *GetAgreementProductsParams { + o.SetIncludeLanguageNames(includeLanguageNames) + return o +} + +// SetIncludeLanguageNames adds the includeLanguageNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeLanguageNames(includeLanguageNames []string) { + o.IncludeLanguageNames = includeLanguageNames +} + +// WithIncludeLevelNames adds the includeLevelNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeLevelNames(includeLevelNames []string) *GetAgreementProductsParams { + o.SetIncludeLevelNames(includeLevelNames) + return o +} + +// SetIncludeLevelNames adds the includeLevelNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeLevelNames(includeLevelNames []string) { + o.IncludeLevelNames = includeLevelNames +} + +// WithIncludeLicenseAgreementTypeNames adds the includeLicenseAgreementTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeLicenseAgreementTypeNames(includeLicenseAgreementTypeNames []string) *GetAgreementProductsParams { + o.SetIncludeLicenseAgreementTypeNames(includeLicenseAgreementTypeNames) + return o +} + +// SetIncludeLicenseAgreementTypeNames adds the includeLicenseAgreementTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeLicenseAgreementTypeNames(includeLicenseAgreementTypeNames []string) { + o.IncludeLicenseAgreementTypeNames = includeLicenseAgreementTypeNames +} + +// WithIncludeLicenseTypeNames adds the includeLicenseTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeLicenseTypeNames(includeLicenseTypeNames []string) *GetAgreementProductsParams { + o.SetIncludeLicenseTypeNames(includeLicenseTypeNames) + return o +} + +// SetIncludeLicenseTypeNames adds the includeLicenseTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeLicenseTypeNames(includeLicenseTypeNames []string) { + o.IncludeLicenseTypeNames = includeLicenseTypeNames +} + +// WithIncludeOfferingNames adds the includeOfferingNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeOfferingNames(includeOfferingNames []string) *GetAgreementProductsParams { + o.SetIncludeOfferingNames(includeOfferingNames) + return o +} + +// SetIncludeOfferingNames adds the includeOfferingNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeOfferingNames(includeOfferingNames []string) { + o.IncludeOfferingNames = includeOfferingNames +} + +// WithIncludeOperatingSystemNames adds the includeOperatingSystemNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeOperatingSystemNames(includeOperatingSystemNames []string) *GetAgreementProductsParams { + o.SetIncludeOperatingSystemNames(includeOperatingSystemNames) + return o +} + +// SetIncludeOperatingSystemNames adds the includeOperatingSystemNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeOperatingSystemNames(includeOperatingSystemNames []string) { + o.IncludeOperatingSystemNames = includeOperatingSystemNames +} + +// WithIncludePartNumbers adds the includePartNumbers to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludePartNumbers(includePartNumbers []string) *GetAgreementProductsParams { + o.SetIncludePartNumbers(includePartNumbers) + return o +} + +// SetIncludePartNumbers adds the includePartNumbers to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludePartNumbers(includePartNumbers []string) { + o.IncludePartNumbers = includePartNumbers +} + +// WithIncludePoolNames adds the includePoolNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludePoolNames(includePoolNames []string) *GetAgreementProductsParams { + o.SetIncludePoolNames(includePoolNames) + return o +} + +// SetIncludePoolNames adds the includePoolNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludePoolNames(includePoolNames []string) { + o.IncludePoolNames = includePoolNames +} + +// WithIncludeProductCategoryNames adds the includeProductCategoryNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeProductCategoryNames(includeProductCategoryNames []string) *GetAgreementProductsParams { + o.SetIncludeProductCategoryNames(includeProductCategoryNames) + return o +} + +// SetIncludeProductCategoryNames adds the includeProductCategoryNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeProductCategoryNames(includeProductCategoryNames []string) { + o.IncludeProductCategoryNames = includeProductCategoryNames +} + +// WithIncludeProductFamilyNames adds the includeProductFamilyNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeProductFamilyNames(includeProductFamilyNames []string) *GetAgreementProductsParams { + o.SetIncludeProductFamilyNames(includeProductFamilyNames) + return o +} + +// SetIncludeProductFamilyNames adds the includeProductFamilyNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeProductFamilyNames(includeProductFamilyNames []string) { + o.IncludeProductFamilyNames = includeProductFamilyNames +} + +// WithIncludeProductTypeNames adds the includeProductTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeProductTypeNames(includeProductTypeNames []string) *GetAgreementProductsParams { + o.SetIncludeProductTypeNames(includeProductTypeNames) + return o +} + +// SetIncludeProductTypeNames adds the includeProductTypeNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeProductTypeNames(includeProductTypeNames []string) { + o.IncludeProductTypeNames = includeProductTypeNames +} + +// WithIncludeProgramNames adds the includeProgramNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeProgramNames(includeProgramNames []string) *GetAgreementProductsParams { + o.SetIncludeProgramNames(includeProgramNames) + return o +} + +// SetIncludeProgramNames adds the includeProgramNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeProgramNames(includeProgramNames []string) { + o.IncludeProgramNames = includeProgramNames +} + +// WithIncludePublisherIds adds the includePublisherIds to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludePublisherIds(includePublisherIds []int32) *GetAgreementProductsParams { + o.SetIncludePublisherIds(includePublisherIds) + return o +} + +// SetIncludePublisherIds adds the includePublisherIds to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludePublisherIds(includePublisherIds []int32) { + o.IncludePublisherIds = includePublisherIds +} + +// WithIncludePublisherNames adds the includePublisherNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludePublisherNames(includePublisherNames []string) *GetAgreementProductsParams { + o.SetIncludePublisherNames(includePublisherNames) + return o +} + +// SetIncludePublisherNames adds the includePublisherNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludePublisherNames(includePublisherNames []string) { + o.IncludePublisherNames = includePublisherNames +} + +// WithIncludePurchasePeriodNames adds the includePurchasePeriodNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludePurchasePeriodNames(includePurchasePeriodNames []string) *GetAgreementProductsParams { + o.SetIncludePurchasePeriodNames(includePurchasePeriodNames) + return o +} + +// SetIncludePurchasePeriodNames adds the includePurchasePeriodNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludePurchasePeriodNames(includePurchasePeriodNames []string) { + o.IncludePurchasePeriodNames = includePurchasePeriodNames +} + +// WithIncludePurchaseUnitNames adds the includePurchaseUnitNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludePurchaseUnitNames(includePurchaseUnitNames []string) *GetAgreementProductsParams { + o.SetIncludePurchaseUnitNames(includePurchaseUnitNames) + return o +} + +// SetIncludePurchaseUnitNames adds the includePurchaseUnitNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludePurchaseUnitNames(includePurchaseUnitNames []string) { + o.IncludePurchaseUnitNames = includePurchaseUnitNames +} + +// WithIncludeRegionNames adds the includeRegionNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeRegionNames(includeRegionNames []string) *GetAgreementProductsParams { + o.SetIncludeRegionNames(includeRegionNames) + return o +} + +// SetIncludeRegionNames adds the includeRegionNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeRegionNames(includeRegionNames []string) { + o.IncludeRegionNames = includeRegionNames +} + +// WithIncludeVersionNames adds the includeVersionNames to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeVersionNames(includeVersionNames []string) *GetAgreementProductsParams { + o.SetIncludeVersionNames(includeVersionNames) + return o +} + +// SetIncludeVersionNames adds the includeVersionNames to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeVersionNames(includeVersionNames []string) { + o.IncludeVersionNames = includeVersionNames +} + +// WithIncludeProductInformation adds the includeProductInformation to the get agreement products params +func (o *GetAgreementProductsParams) WithIncludeProductInformation(includeProductInformation *bool) *GetAgreementProductsParams { + o.SetIncludeProductInformation(includeProductInformation) + return o +} + +// SetIncludeProductInformation adds the includeProductInformation to the get agreement products params +func (o *GetAgreementProductsParams) SetIncludeProductInformation(includeProductInformation *bool) { + o.IncludeProductInformation = includeProductInformation +} + +// WithIsTrial adds the isTrial to the get agreement products params +func (o *GetAgreementProductsParams) WithIsTrial(isTrial *bool) *GetAgreementProductsParams { + o.SetIsTrial(isTrial) + return o +} + +// SetIsTrial adds the isTrial to the get agreement products params +func (o *GetAgreementProductsParams) SetIsTrial(isTrial *bool) { + o.IsTrial = isTrial +} + +// WithOrganizationID adds the organizationID to the get agreement products params +func (o *GetAgreementProductsParams) WithOrganizationID(organizationID *int32) *GetAgreementProductsParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get agreement products params +func (o *GetAgreementProductsParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get agreement products params +func (o *GetAgreementProductsParams) WithPage(page *int32) *GetAgreementProductsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get agreement products params +func (o *GetAgreementProductsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get agreement products params +func (o *GetAgreementProductsParams) WithPageSize(pageSize *int32) *GetAgreementProductsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get agreement products params +func (o *GetAgreementProductsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithPriceListID adds the priceListID to the get agreement products params +func (o *GetAgreementProductsParams) WithPriceListID(priceListID *int32) *GetAgreementProductsParams { + o.SetPriceListID(priceListID) + return o +} + +// SetPriceListID adds the priceListId to the get agreement products params +func (o *GetAgreementProductsParams) SetPriceListID(priceListID *int32) { + o.PriceListID = priceListID +} + +// WithSearch adds the search to the get agreement products params +func (o *GetAgreementProductsParams) WithSearch(search *string) *GetAgreementProductsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get agreement products params +func (o *GetAgreementProductsParams) SetSearch(search *string) { + o.Search = search +} + +// WithSearchDate adds the searchDate to the get agreement products params +func (o *GetAgreementProductsParams) WithSearchDate(searchDate *strfmt.DateTime) *GetAgreementProductsParams { + o.SetSearchDate(searchDate) + return o +} + +// SetSearchDate adds the searchDate to the get agreement products params +func (o *GetAgreementProductsParams) SetSearchDate(searchDate *strfmt.DateTime) { + o.SearchDate = searchDate +} + +// WithSortKey adds the sortKey to the get agreement products params +func (o *GetAgreementProductsParams) WithSortKey(sortKey *string) *GetAgreementProductsParams { + o.SetSortKey(sortKey) + return o +} + +// SetSortKey adds the sortKey to the get agreement products params +func (o *GetAgreementProductsParams) SetSortKey(sortKey *string) { + o.SortKey = sortKey +} + +// WithSortOrder adds the sortOrder to the get agreement products params +func (o *GetAgreementProductsParams) WithSortOrder(sortOrder *string) *GetAgreementProductsParams { + o.SetSortOrder(sortOrder) + return o +} + +// SetSortOrder adds the sortOrder to the get agreement products params +func (o *GetAgreementProductsParams) SetSortOrder(sortOrder *string) { + o.SortOrder = sortOrder +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAgreementProductsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AgreementID != nil { + + // query param AgreementId + var qrAgreementID int32 + if o.AgreementID != nil { + qrAgreementID = *o.AgreementID + } + qAgreementID := swag.FormatInt32(qrAgreementID) + if qAgreementID != "" { + if err := r.SetQueryParam("AgreementId", qAgreementID); err != nil { + return err + } + } + + } + + var valuesAgreementIds []string + for _, v := range o.AgreementIds { + valuesAgreementIds = append(valuesAgreementIds, swag.FormatInt32(v)) + } + + joinedAgreementIds := swag.JoinByFormat(valuesAgreementIds, "multi") + // query array param AgreementIds + if err := r.SetQueryParam("AgreementIds", joinedAgreementIds...); err != nil { + return err + } + + valuesAgreementTypeIds := o.AgreementTypeIds + + joinedAgreementTypeIds := swag.JoinByFormat(valuesAgreementTypeIds, "multi") + // query array param AgreementTypeIds + if err := r.SetQueryParam("AgreementTypeIds", joinedAgreementTypeIds...); err != nil { + return err + } + + if o.CustomerTenantID != nil { + + // query param CustomerTenantId + var qrCustomerTenantID int32 + if o.CustomerTenantID != nil { + qrCustomerTenantID = *o.CustomerTenantID + } + qCustomerTenantID := swag.FormatInt32(qrCustomerTenantID) + if qCustomerTenantID != "" { + if err := r.SetQueryParam("CustomerTenantId", qCustomerTenantID); err != nil { + return err + } + } + + } + + valuesExcludeLanguageNames := o.ExcludeLanguageNames + + joinedExcludeLanguageNames := swag.JoinByFormat(valuesExcludeLanguageNames, "multi") + // query array param Exclude.LanguageNames + if err := r.SetQueryParam("Exclude.LanguageNames", joinedExcludeLanguageNames...); err != nil { + return err + } + + valuesExcludeLevelNames := o.ExcludeLevelNames + + joinedExcludeLevelNames := swag.JoinByFormat(valuesExcludeLevelNames, "multi") + // query array param Exclude.LevelNames + if err := r.SetQueryParam("Exclude.LevelNames", joinedExcludeLevelNames...); err != nil { + return err + } + + valuesExcludeLicenseAgreementTypeNames := o.ExcludeLicenseAgreementTypeNames + + joinedExcludeLicenseAgreementTypeNames := swag.JoinByFormat(valuesExcludeLicenseAgreementTypeNames, "multi") + // query array param Exclude.LicenseAgreementTypeNames + if err := r.SetQueryParam("Exclude.LicenseAgreementTypeNames", joinedExcludeLicenseAgreementTypeNames...); err != nil { + return err + } + + valuesExcludeLicenseTypeNames := o.ExcludeLicenseTypeNames + + joinedExcludeLicenseTypeNames := swag.JoinByFormat(valuesExcludeLicenseTypeNames, "multi") + // query array param Exclude.LicenseTypeNames + if err := r.SetQueryParam("Exclude.LicenseTypeNames", joinedExcludeLicenseTypeNames...); err != nil { + return err + } + + valuesExcludeOfferingNames := o.ExcludeOfferingNames + + joinedExcludeOfferingNames := swag.JoinByFormat(valuesExcludeOfferingNames, "multi") + // query array param Exclude.OfferingNames + if err := r.SetQueryParam("Exclude.OfferingNames", joinedExcludeOfferingNames...); err != nil { + return err + } + + valuesExcludeOperatingSystemNames := o.ExcludeOperatingSystemNames + + joinedExcludeOperatingSystemNames := swag.JoinByFormat(valuesExcludeOperatingSystemNames, "multi") + // query array param Exclude.OperatingSystemNames + if err := r.SetQueryParam("Exclude.OperatingSystemNames", joinedExcludeOperatingSystemNames...); err != nil { + return err + } + + valuesExcludePartNumbers := o.ExcludePartNumbers + + joinedExcludePartNumbers := swag.JoinByFormat(valuesExcludePartNumbers, "multi") + // query array param Exclude.PartNumbers + if err := r.SetQueryParam("Exclude.PartNumbers", joinedExcludePartNumbers...); err != nil { + return err + } + + valuesExcludePoolNames := o.ExcludePoolNames + + joinedExcludePoolNames := swag.JoinByFormat(valuesExcludePoolNames, "multi") + // query array param Exclude.PoolNames + if err := r.SetQueryParam("Exclude.PoolNames", joinedExcludePoolNames...); err != nil { + return err + } + + valuesExcludeProductCategoryNames := o.ExcludeProductCategoryNames + + joinedExcludeProductCategoryNames := swag.JoinByFormat(valuesExcludeProductCategoryNames, "multi") + // query array param Exclude.ProductCategoryNames + if err := r.SetQueryParam("Exclude.ProductCategoryNames", joinedExcludeProductCategoryNames...); err != nil { + return err + } + + valuesExcludeProductFamilyNames := o.ExcludeProductFamilyNames + + joinedExcludeProductFamilyNames := swag.JoinByFormat(valuesExcludeProductFamilyNames, "multi") + // query array param Exclude.ProductFamilyNames + if err := r.SetQueryParam("Exclude.ProductFamilyNames", joinedExcludeProductFamilyNames...); err != nil { + return err + } + + valuesExcludeProductTypeNames := o.ExcludeProductTypeNames + + joinedExcludeProductTypeNames := swag.JoinByFormat(valuesExcludeProductTypeNames, "multi") + // query array param Exclude.ProductTypeNames + if err := r.SetQueryParam("Exclude.ProductTypeNames", joinedExcludeProductTypeNames...); err != nil { + return err + } + + valuesExcludeProgramNames := o.ExcludeProgramNames + + joinedExcludeProgramNames := swag.JoinByFormat(valuesExcludeProgramNames, "multi") + // query array param Exclude.ProgramNames + if err := r.SetQueryParam("Exclude.ProgramNames", joinedExcludeProgramNames...); err != nil { + return err + } + + var valuesExcludePublisherIds []string + for _, v := range o.ExcludePublisherIds { + valuesExcludePublisherIds = append(valuesExcludePublisherIds, swag.FormatInt32(v)) + } + + joinedExcludePublisherIds := swag.JoinByFormat(valuesExcludePublisherIds, "multi") + // query array param Exclude.PublisherIds + if err := r.SetQueryParam("Exclude.PublisherIds", joinedExcludePublisherIds...); err != nil { + return err + } + + valuesExcludePublisherNames := o.ExcludePublisherNames + + joinedExcludePublisherNames := swag.JoinByFormat(valuesExcludePublisherNames, "multi") + // query array param Exclude.PublisherNames + if err := r.SetQueryParam("Exclude.PublisherNames", joinedExcludePublisherNames...); err != nil { + return err + } + + valuesExcludePurchasePeriodNames := o.ExcludePurchasePeriodNames + + joinedExcludePurchasePeriodNames := swag.JoinByFormat(valuesExcludePurchasePeriodNames, "multi") + // query array param Exclude.PurchasePeriodNames + if err := r.SetQueryParam("Exclude.PurchasePeriodNames", joinedExcludePurchasePeriodNames...); err != nil { + return err + } + + valuesExcludePurchaseUnitNames := o.ExcludePurchaseUnitNames + + joinedExcludePurchaseUnitNames := swag.JoinByFormat(valuesExcludePurchaseUnitNames, "multi") + // query array param Exclude.PurchaseUnitNames + if err := r.SetQueryParam("Exclude.PurchaseUnitNames", joinedExcludePurchaseUnitNames...); err != nil { + return err + } + + valuesExcludeRegionNames := o.ExcludeRegionNames + + joinedExcludeRegionNames := swag.JoinByFormat(valuesExcludeRegionNames, "multi") + // query array param Exclude.RegionNames + if err := r.SetQueryParam("Exclude.RegionNames", joinedExcludeRegionNames...); err != nil { + return err + } + + valuesExcludeVersionNames := o.ExcludeVersionNames + + joinedExcludeVersionNames := swag.JoinByFormat(valuesExcludeVersionNames, "multi") + // query array param Exclude.VersionNames + if err := r.SetQueryParam("Exclude.VersionNames", joinedExcludeVersionNames...); err != nil { + return err + } + + valuesIncludeLanguageNames := o.IncludeLanguageNames + + joinedIncludeLanguageNames := swag.JoinByFormat(valuesIncludeLanguageNames, "multi") + // query array param Include.LanguageNames + if err := r.SetQueryParam("Include.LanguageNames", joinedIncludeLanguageNames...); err != nil { + return err + } + + valuesIncludeLevelNames := o.IncludeLevelNames + + joinedIncludeLevelNames := swag.JoinByFormat(valuesIncludeLevelNames, "multi") + // query array param Include.LevelNames + if err := r.SetQueryParam("Include.LevelNames", joinedIncludeLevelNames...); err != nil { + return err + } + + valuesIncludeLicenseAgreementTypeNames := o.IncludeLicenseAgreementTypeNames + + joinedIncludeLicenseAgreementTypeNames := swag.JoinByFormat(valuesIncludeLicenseAgreementTypeNames, "multi") + // query array param Include.LicenseAgreementTypeNames + if err := r.SetQueryParam("Include.LicenseAgreementTypeNames", joinedIncludeLicenseAgreementTypeNames...); err != nil { + return err + } + + valuesIncludeLicenseTypeNames := o.IncludeLicenseTypeNames + + joinedIncludeLicenseTypeNames := swag.JoinByFormat(valuesIncludeLicenseTypeNames, "multi") + // query array param Include.LicenseTypeNames + if err := r.SetQueryParam("Include.LicenseTypeNames", joinedIncludeLicenseTypeNames...); err != nil { + return err + } + + valuesIncludeOfferingNames := o.IncludeOfferingNames + + joinedIncludeOfferingNames := swag.JoinByFormat(valuesIncludeOfferingNames, "multi") + // query array param Include.OfferingNames + if err := r.SetQueryParam("Include.OfferingNames", joinedIncludeOfferingNames...); err != nil { + return err + } + + valuesIncludeOperatingSystemNames := o.IncludeOperatingSystemNames + + joinedIncludeOperatingSystemNames := swag.JoinByFormat(valuesIncludeOperatingSystemNames, "multi") + // query array param Include.OperatingSystemNames + if err := r.SetQueryParam("Include.OperatingSystemNames", joinedIncludeOperatingSystemNames...); err != nil { + return err + } + + valuesIncludePartNumbers := o.IncludePartNumbers + + joinedIncludePartNumbers := swag.JoinByFormat(valuesIncludePartNumbers, "multi") + // query array param Include.PartNumbers + if err := r.SetQueryParam("Include.PartNumbers", joinedIncludePartNumbers...); err != nil { + return err + } + + valuesIncludePoolNames := o.IncludePoolNames + + joinedIncludePoolNames := swag.JoinByFormat(valuesIncludePoolNames, "multi") + // query array param Include.PoolNames + if err := r.SetQueryParam("Include.PoolNames", joinedIncludePoolNames...); err != nil { + return err + } + + valuesIncludeProductCategoryNames := o.IncludeProductCategoryNames + + joinedIncludeProductCategoryNames := swag.JoinByFormat(valuesIncludeProductCategoryNames, "multi") + // query array param Include.ProductCategoryNames + if err := r.SetQueryParam("Include.ProductCategoryNames", joinedIncludeProductCategoryNames...); err != nil { + return err + } + + valuesIncludeProductFamilyNames := o.IncludeProductFamilyNames + + joinedIncludeProductFamilyNames := swag.JoinByFormat(valuesIncludeProductFamilyNames, "multi") + // query array param Include.ProductFamilyNames + if err := r.SetQueryParam("Include.ProductFamilyNames", joinedIncludeProductFamilyNames...); err != nil { + return err + } + + valuesIncludeProductTypeNames := o.IncludeProductTypeNames + + joinedIncludeProductTypeNames := swag.JoinByFormat(valuesIncludeProductTypeNames, "multi") + // query array param Include.ProductTypeNames + if err := r.SetQueryParam("Include.ProductTypeNames", joinedIncludeProductTypeNames...); err != nil { + return err + } + + valuesIncludeProgramNames := o.IncludeProgramNames + + joinedIncludeProgramNames := swag.JoinByFormat(valuesIncludeProgramNames, "multi") + // query array param Include.ProgramNames + if err := r.SetQueryParam("Include.ProgramNames", joinedIncludeProgramNames...); err != nil { + return err + } + + var valuesIncludePublisherIds []string + for _, v := range o.IncludePublisherIds { + valuesIncludePublisherIds = append(valuesIncludePublisherIds, swag.FormatInt32(v)) + } + + joinedIncludePublisherIds := swag.JoinByFormat(valuesIncludePublisherIds, "multi") + // query array param Include.PublisherIds + if err := r.SetQueryParam("Include.PublisherIds", joinedIncludePublisherIds...); err != nil { + return err + } + + valuesIncludePublisherNames := o.IncludePublisherNames + + joinedIncludePublisherNames := swag.JoinByFormat(valuesIncludePublisherNames, "multi") + // query array param Include.PublisherNames + if err := r.SetQueryParam("Include.PublisherNames", joinedIncludePublisherNames...); err != nil { + return err + } + + valuesIncludePurchasePeriodNames := o.IncludePurchasePeriodNames + + joinedIncludePurchasePeriodNames := swag.JoinByFormat(valuesIncludePurchasePeriodNames, "multi") + // query array param Include.PurchasePeriodNames + if err := r.SetQueryParam("Include.PurchasePeriodNames", joinedIncludePurchasePeriodNames...); err != nil { + return err + } + + valuesIncludePurchaseUnitNames := o.IncludePurchaseUnitNames + + joinedIncludePurchaseUnitNames := swag.JoinByFormat(valuesIncludePurchaseUnitNames, "multi") + // query array param Include.PurchaseUnitNames + if err := r.SetQueryParam("Include.PurchaseUnitNames", joinedIncludePurchaseUnitNames...); err != nil { + return err + } + + valuesIncludeRegionNames := o.IncludeRegionNames + + joinedIncludeRegionNames := swag.JoinByFormat(valuesIncludeRegionNames, "multi") + // query array param Include.RegionNames + if err := r.SetQueryParam("Include.RegionNames", joinedIncludeRegionNames...); err != nil { + return err + } + + valuesIncludeVersionNames := o.IncludeVersionNames + + joinedIncludeVersionNames := swag.JoinByFormat(valuesIncludeVersionNames, "multi") + // query array param Include.VersionNames + if err := r.SetQueryParam("Include.VersionNames", joinedIncludeVersionNames...); err != nil { + return err + } + + if o.IncludeProductInformation != nil { + + // query param IncludeProductInformation + var qrIncludeProductInformation bool + if o.IncludeProductInformation != nil { + qrIncludeProductInformation = *o.IncludeProductInformation + } + qIncludeProductInformation := swag.FormatBool(qrIncludeProductInformation) + if qIncludeProductInformation != "" { + if err := r.SetQueryParam("IncludeProductInformation", qIncludeProductInformation); err != nil { + return err + } + } + + } + + if o.IsTrial != nil { + + // query param IsTrial + var qrIsTrial bool + if o.IsTrial != nil { + qrIsTrial = *o.IsTrial + } + qIsTrial := swag.FormatBool(qrIsTrial) + if qIsTrial != "" { + if err := r.SetQueryParam("IsTrial", qIsTrial); 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.PriceListID != nil { + + // query param PriceListId + var qrPriceListID int32 + if o.PriceListID != nil { + qrPriceListID = *o.PriceListID + } + qPriceListID := swag.FormatInt32(qrPriceListID) + if qPriceListID != "" { + if err := r.SetQueryParam("PriceListId", qPriceListID); 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 o.SearchDate != nil { + + // query param SearchDate + var qrSearchDate strfmt.DateTime + if o.SearchDate != nil { + qrSearchDate = *o.SearchDate + } + qSearchDate := qrSearchDate.String() + if qSearchDate != "" { + if err := r.SetQueryParam("SearchDate", qSearchDate); err != nil { + return err + } + } + + } + + if o.SortKey != nil { + + // query param SortKey + var qrSortKey string + if o.SortKey != nil { + qrSortKey = *o.SortKey + } + qSortKey := qrSortKey + if qSortKey != "" { + if err := r.SetQueryParam("SortKey", qSortKey); err != nil { + return err + } + } + + } + + if o.SortOrder != nil { + + // query param SortOrder + var qrSortOrder string + if o.SortOrder != nil { + qrSortOrder = *o.SortOrder + } + qSortOrder := qrSortOrder + if qSortOrder != "" { + if err := r.SetQueryParam("SortOrder", qSortOrder); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/agreement_products/get_agreement_products_responses.go b/client/agreement_products/get_agreement_products_responses.go new file mode 100644 index 0000000..95e3e6b --- /dev/null +++ b/client/agreement_products/get_agreement_products_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreement_products + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetAgreementProductsReader is a Reader for the GetAgreementProducts structure. +type GetAgreementProductsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAgreementProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAgreementProductsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAgreementProductsOK creates a GetAgreementProductsOK with default headers values +func NewGetAgreementProductsOK() *GetAgreementProductsOK { + return &GetAgreementProductsOK{} +} + +/*GetAgreementProductsOK handles this case with default header values. + +Success +*/ +type GetAgreementProductsOK struct { + Payload *models.AgreementProductCollection +} + +func (o *GetAgreementProductsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/AgreementProducts][%d] getAgreementProductsOK %+v", 200, o.Payload) +} + +func (o *GetAgreementProductsOK) GetPayload() *models.AgreementProductCollection { + return o.Payload +} + +func (o *GetAgreementProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgreementProductCollection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/agreement_reports/agreement_reports_client.go b/client/agreement_reports/agreement_reports_client.go index c38e8e7..c2b902f 100644 --- a/client/agreement_reports/agreement_reports_client.go +++ b/client/agreement_reports/agreement_reports_client.go @@ -27,11 +27,48 @@ type Client struct { // ClientService is the interface for Client methods type ClientService interface { + GetAgreementReports(params *GetAgreementReportsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgreementReportsOK, error) + Update(params *UpdateParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateOK, error) SetTransport(transport runtime.ClientTransport) } +/* + GetAgreementReports get agreement reports API +*/ +func (a *Client) GetAgreementReports(params *GetAgreementReportsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgreementReportsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAgreementReportsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAgreementReports", + Method: "GET", + PathPattern: "/api/v1/AgreementReports/{productContainerId}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAgreementReportsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAgreementReportsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetAgreementReports: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* Update update API */ diff --git a/client/agreement_reports/get_agreement_reports_parameters.go b/client/agreement_reports/get_agreement_reports_parameters.go new file mode 100644 index 0000000..722d052 --- /dev/null +++ b/client/agreement_reports/get_agreement_reports_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreement_reports + +// 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" +) + +// NewGetAgreementReportsParams creates a new GetAgreementReportsParams object +// with the default values initialized. +func NewGetAgreementReportsParams() *GetAgreementReportsParams { + var () + return &GetAgreementReportsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAgreementReportsParamsWithTimeout creates a new GetAgreementReportsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAgreementReportsParamsWithTimeout(timeout time.Duration) *GetAgreementReportsParams { + var () + return &GetAgreementReportsParams{ + + timeout: timeout, + } +} + +// NewGetAgreementReportsParamsWithContext creates a new GetAgreementReportsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAgreementReportsParamsWithContext(ctx context.Context) *GetAgreementReportsParams { + var () + return &GetAgreementReportsParams{ + + Context: ctx, + } +} + +// NewGetAgreementReportsParamsWithHTTPClient creates a new GetAgreementReportsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAgreementReportsParamsWithHTTPClient(client *http.Client) *GetAgreementReportsParams { + var () + return &GetAgreementReportsParams{ + HTTPClient: client, + } +} + +/*GetAgreementReportsParams contains all the parameters to send to the API endpoint +for the get agreement reports operation typically these are written to a http.Request +*/ +type GetAgreementReportsParams struct { + + /*ProductContainerID*/ + ProductContainerID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get agreement reports params +func (o *GetAgreementReportsParams) WithTimeout(timeout time.Duration) *GetAgreementReportsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get agreement reports params +func (o *GetAgreementReportsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get agreement reports params +func (o *GetAgreementReportsParams) WithContext(ctx context.Context) *GetAgreementReportsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get agreement reports params +func (o *GetAgreementReportsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get agreement reports params +func (o *GetAgreementReportsParams) WithHTTPClient(client *http.Client) *GetAgreementReportsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get agreement reports params +func (o *GetAgreementReportsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProductContainerID adds the productContainerID to the get agreement reports params +func (o *GetAgreementReportsParams) WithProductContainerID(productContainerID int32) *GetAgreementReportsParams { + o.SetProductContainerID(productContainerID) + return o +} + +// SetProductContainerID adds the productContainerId to the get agreement reports params +func (o *GetAgreementReportsParams) SetProductContainerID(productContainerID int32) { + o.ProductContainerID = productContainerID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAgreementReportsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param productContainerId + if err := r.SetPathParam("productContainerId", swag.FormatInt32(o.ProductContainerID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/agreement_reports/get_agreement_reports_responses.go b/client/agreement_reports/get_agreement_reports_responses.go new file mode 100644 index 0000000..4c561ea --- /dev/null +++ b/client/agreement_reports/get_agreement_reports_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreement_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetAgreementReportsReader is a Reader for the GetAgreementReports structure. +type GetAgreementReportsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAgreementReportsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAgreementReportsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAgreementReportsOK creates a GetAgreementReportsOK with default headers values +func NewGetAgreementReportsOK() *GetAgreementReportsOK { + return &GetAgreementReportsOK{} +} + +/*GetAgreementReportsOK handles this case with default header values. + +Success +*/ +type GetAgreementReportsOK struct { + Payload *models.APICollectionOfAgreementReport +} + +func (o *GetAgreementReportsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/AgreementReports/{productContainerId}][%d] getAgreementReportsOK %+v", 200, o.Payload) +} + +func (o *GetAgreementReportsOK) GetPayload() *models.APICollectionOfAgreementReport { + return o.Payload +} + +func (o *GetAgreementReportsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfAgreementReport) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/agreements/agreements_client.go b/client/agreements/agreements_client.go new file mode 100644 index 0000000..7000140 --- /dev/null +++ b/client/agreements/agreements_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new agreements API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for agreements API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAgreements(params *GetAgreementsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgreementsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAgreements get agreements API +*/ +func (a *Client) GetAgreements(params *GetAgreementsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAgreementsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAgreementsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAgreements", + Method: "GET", + PathPattern: "/api/v1/Agreements", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAgreementsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAgreementsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetAgreements: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/agreements/get_agreements_parameters.go b/client/agreements/get_agreements_parameters.go new file mode 100644 index 0000000..304588b --- /dev/null +++ b/client/agreements/get_agreements_parameters.go @@ -0,0 +1,575 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreements + +// 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" +) + +// NewGetAgreementsParams creates a new GetAgreementsParams object +// with the default values initialized. +func NewGetAgreementsParams() *GetAgreementsParams { + var () + return &GetAgreementsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAgreementsParamsWithTimeout creates a new GetAgreementsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAgreementsParamsWithTimeout(timeout time.Duration) *GetAgreementsParams { + var () + return &GetAgreementsParams{ + + timeout: timeout, + } +} + +// NewGetAgreementsParamsWithContext creates a new GetAgreementsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAgreementsParamsWithContext(ctx context.Context) *GetAgreementsParams { + var () + return &GetAgreementsParams{ + + Context: ctx, + } +} + +// NewGetAgreementsParamsWithHTTPClient creates a new GetAgreementsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAgreementsParamsWithHTTPClient(client *http.Client) *GetAgreementsParams { + var () + return &GetAgreementsParams{ + HTTPClient: client, + } +} + +/*GetAgreementsParams contains all the parameters to send to the API endpoint +for the get agreements operation typically these are written to a http.Request +*/ +type GetAgreementsParams struct { + + /*AgreementIds*/ + AgreementIds []int32 + /*AgreementTypes*/ + AgreementTypes []string + /*EndDateFrom*/ + EndDateFrom *strfmt.DateTime + /*EndDateTo*/ + EndDateTo *strfmt.DateTime + /*OrganizationID*/ + OrganizationID *int32 + /*OrganizationIds*/ + OrganizationIds []int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*PricelistIds*/ + PricelistIds []int32 + /*ProgramIds*/ + ProgramIds []int32 + /*PublisherID*/ + PublisherID *int32 + /*PublisherIds*/ + PublisherIds []int32 + /*SalesPriceCurrency*/ + SalesPriceCurrency *string + /*Search*/ + Search *string + /*SearchDate*/ + SearchDate *strfmt.DateTime + /*Status*/ + Status *string + /*TermRequired*/ + TermRequired *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get agreements params +func (o *GetAgreementsParams) WithTimeout(timeout time.Duration) *GetAgreementsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get agreements params +func (o *GetAgreementsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get agreements params +func (o *GetAgreementsParams) WithContext(ctx context.Context) *GetAgreementsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get agreements params +func (o *GetAgreementsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get agreements params +func (o *GetAgreementsParams) WithHTTPClient(client *http.Client) *GetAgreementsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get agreements params +func (o *GetAgreementsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgreementIds adds the agreementIds to the get agreements params +func (o *GetAgreementsParams) WithAgreementIds(agreementIds []int32) *GetAgreementsParams { + o.SetAgreementIds(agreementIds) + return o +} + +// SetAgreementIds adds the agreementIds to the get agreements params +func (o *GetAgreementsParams) SetAgreementIds(agreementIds []int32) { + o.AgreementIds = agreementIds +} + +// WithAgreementTypes adds the agreementTypes to the get agreements params +func (o *GetAgreementsParams) WithAgreementTypes(agreementTypes []string) *GetAgreementsParams { + o.SetAgreementTypes(agreementTypes) + return o +} + +// SetAgreementTypes adds the agreementTypes to the get agreements params +func (o *GetAgreementsParams) SetAgreementTypes(agreementTypes []string) { + o.AgreementTypes = agreementTypes +} + +// WithEndDateFrom adds the endDateFrom to the get agreements params +func (o *GetAgreementsParams) WithEndDateFrom(endDateFrom *strfmt.DateTime) *GetAgreementsParams { + o.SetEndDateFrom(endDateFrom) + return o +} + +// SetEndDateFrom adds the endDateFrom to the get agreements params +func (o *GetAgreementsParams) SetEndDateFrom(endDateFrom *strfmt.DateTime) { + o.EndDateFrom = endDateFrom +} + +// WithEndDateTo adds the endDateTo to the get agreements params +func (o *GetAgreementsParams) WithEndDateTo(endDateTo *strfmt.DateTime) *GetAgreementsParams { + o.SetEndDateTo(endDateTo) + return o +} + +// SetEndDateTo adds the endDateTo to the get agreements params +func (o *GetAgreementsParams) SetEndDateTo(endDateTo *strfmt.DateTime) { + o.EndDateTo = endDateTo +} + +// WithOrganizationID adds the organizationID to the get agreements params +func (o *GetAgreementsParams) WithOrganizationID(organizationID *int32) *GetAgreementsParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get agreements params +func (o *GetAgreementsParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithOrganizationIds adds the organizationIds to the get agreements params +func (o *GetAgreementsParams) WithOrganizationIds(organizationIds []int32) *GetAgreementsParams { + o.SetOrganizationIds(organizationIds) + return o +} + +// SetOrganizationIds adds the organizationIds to the get agreements params +func (o *GetAgreementsParams) SetOrganizationIds(organizationIds []int32) { + o.OrganizationIds = organizationIds +} + +// WithPage adds the page to the get agreements params +func (o *GetAgreementsParams) WithPage(page *int32) *GetAgreementsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get agreements params +func (o *GetAgreementsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get agreements params +func (o *GetAgreementsParams) WithPageSize(pageSize *int32) *GetAgreementsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get agreements params +func (o *GetAgreementsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithPricelistIds adds the pricelistIds to the get agreements params +func (o *GetAgreementsParams) WithPricelistIds(pricelistIds []int32) *GetAgreementsParams { + o.SetPricelistIds(pricelistIds) + return o +} + +// SetPricelistIds adds the pricelistIds to the get agreements params +func (o *GetAgreementsParams) SetPricelistIds(pricelistIds []int32) { + o.PricelistIds = pricelistIds +} + +// WithProgramIds adds the programIds to the get agreements params +func (o *GetAgreementsParams) WithProgramIds(programIds []int32) *GetAgreementsParams { + o.SetProgramIds(programIds) + return o +} + +// SetProgramIds adds the programIds to the get agreements params +func (o *GetAgreementsParams) SetProgramIds(programIds []int32) { + o.ProgramIds = programIds +} + +// WithPublisherID adds the publisherID to the get agreements params +func (o *GetAgreementsParams) WithPublisherID(publisherID *int32) *GetAgreementsParams { + o.SetPublisherID(publisherID) + return o +} + +// SetPublisherID adds the publisherId to the get agreements params +func (o *GetAgreementsParams) SetPublisherID(publisherID *int32) { + o.PublisherID = publisherID +} + +// WithPublisherIds adds the publisherIds to the get agreements params +func (o *GetAgreementsParams) WithPublisherIds(publisherIds []int32) *GetAgreementsParams { + o.SetPublisherIds(publisherIds) + return o +} + +// SetPublisherIds adds the publisherIds to the get agreements params +func (o *GetAgreementsParams) SetPublisherIds(publisherIds []int32) { + o.PublisherIds = publisherIds +} + +// WithSalesPriceCurrency adds the salesPriceCurrency to the get agreements params +func (o *GetAgreementsParams) WithSalesPriceCurrency(salesPriceCurrency *string) *GetAgreementsParams { + o.SetSalesPriceCurrency(salesPriceCurrency) + return o +} + +// SetSalesPriceCurrency adds the salesPriceCurrency to the get agreements params +func (o *GetAgreementsParams) SetSalesPriceCurrency(salesPriceCurrency *string) { + o.SalesPriceCurrency = salesPriceCurrency +} + +// WithSearch adds the search to the get agreements params +func (o *GetAgreementsParams) WithSearch(search *string) *GetAgreementsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get agreements params +func (o *GetAgreementsParams) SetSearch(search *string) { + o.Search = search +} + +// WithSearchDate adds the searchDate to the get agreements params +func (o *GetAgreementsParams) WithSearchDate(searchDate *strfmt.DateTime) *GetAgreementsParams { + o.SetSearchDate(searchDate) + return o +} + +// SetSearchDate adds the searchDate to the get agreements params +func (o *GetAgreementsParams) SetSearchDate(searchDate *strfmt.DateTime) { + o.SearchDate = searchDate +} + +// WithStatus adds the status to the get agreements params +func (o *GetAgreementsParams) WithStatus(status *string) *GetAgreementsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the get agreements params +func (o *GetAgreementsParams) SetStatus(status *string) { + o.Status = status +} + +// WithTermRequired adds the termRequired to the get agreements params +func (o *GetAgreementsParams) WithTermRequired(termRequired *bool) *GetAgreementsParams { + o.SetTermRequired(termRequired) + return o +} + +// SetTermRequired adds the termRequired to the get agreements params +func (o *GetAgreementsParams) SetTermRequired(termRequired *bool) { + o.TermRequired = termRequired +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAgreementsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + var valuesAgreementIds []string + for _, v := range o.AgreementIds { + valuesAgreementIds = append(valuesAgreementIds, swag.FormatInt32(v)) + } + + joinedAgreementIds := swag.JoinByFormat(valuesAgreementIds, "multi") + // query array param AgreementIds + if err := r.SetQueryParam("AgreementIds", joinedAgreementIds...); err != nil { + return err + } + + valuesAgreementTypes := o.AgreementTypes + + joinedAgreementTypes := swag.JoinByFormat(valuesAgreementTypes, "multi") + // query array param AgreementTypes + if err := r.SetQueryParam("AgreementTypes", joinedAgreementTypes...); err != nil { + return err + } + + if o.EndDateFrom != nil { + + // query param EndDateFrom + var qrEndDateFrom strfmt.DateTime + if o.EndDateFrom != nil { + qrEndDateFrom = *o.EndDateFrom + } + qEndDateFrom := qrEndDateFrom.String() + if qEndDateFrom != "" { + if err := r.SetQueryParam("EndDateFrom", qEndDateFrom); err != nil { + return err + } + } + + } + + if o.EndDateTo != nil { + + // query param EndDateTo + var qrEndDateTo strfmt.DateTime + if o.EndDateTo != nil { + qrEndDateTo = *o.EndDateTo + } + qEndDateTo := qrEndDateTo.String() + if qEndDateTo != "" { + if err := r.SetQueryParam("EndDateTo", qEndDateTo); 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 + } + } + + } + + var valuesOrganizationIds []string + for _, v := range o.OrganizationIds { + valuesOrganizationIds = append(valuesOrganizationIds, swag.FormatInt32(v)) + } + + joinedOrganizationIds := swag.JoinByFormat(valuesOrganizationIds, "multi") + // query array param OrganizationIds + if err := r.SetQueryParam("OrganizationIds", joinedOrganizationIds...); 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 + } + } + + } + + var valuesPricelistIds []string + for _, v := range o.PricelistIds { + valuesPricelistIds = append(valuesPricelistIds, swag.FormatInt32(v)) + } + + joinedPricelistIds := swag.JoinByFormat(valuesPricelistIds, "multi") + // query array param PricelistIds + if err := r.SetQueryParam("PricelistIds", joinedPricelistIds...); err != nil { + return err + } + + var valuesProgramIds []string + for _, v := range o.ProgramIds { + valuesProgramIds = append(valuesProgramIds, swag.FormatInt32(v)) + } + + joinedProgramIds := swag.JoinByFormat(valuesProgramIds, "multi") + // query array param ProgramIds + if err := r.SetQueryParam("ProgramIds", joinedProgramIds...); 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 + } + } + + } + + var valuesPublisherIds []string + for _, v := range o.PublisherIds { + valuesPublisherIds = append(valuesPublisherIds, swag.FormatInt32(v)) + } + + joinedPublisherIds := swag.JoinByFormat(valuesPublisherIds, "multi") + // query array param PublisherIds + if err := r.SetQueryParam("PublisherIds", joinedPublisherIds...); err != nil { + return err + } + + if o.SalesPriceCurrency != nil { + + // query param SalesPriceCurrency + var qrSalesPriceCurrency string + if o.SalesPriceCurrency != nil { + qrSalesPriceCurrency = *o.SalesPriceCurrency + } + qSalesPriceCurrency := qrSalesPriceCurrency + if qSalesPriceCurrency != "" { + if err := r.SetQueryParam("SalesPriceCurrency", qSalesPriceCurrency); 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 o.SearchDate != nil { + + // query param SearchDate + var qrSearchDate strfmt.DateTime + if o.SearchDate != nil { + qrSearchDate = *o.SearchDate + } + qSearchDate := qrSearchDate.String() + if qSearchDate != "" { + if err := r.SetQueryParam("SearchDate", qSearchDate); err != nil { + return err + } + } + + } + + if o.Status != nil { + + // query param Status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("Status", qStatus); err != nil { + return err + } + } + + } + + if o.TermRequired != nil { + + // query param TermRequired + var qrTermRequired bool + if o.TermRequired != nil { + qrTermRequired = *o.TermRequired + } + qTermRequired := swag.FormatBool(qrTermRequired) + if qTermRequired != "" { + if err := r.SetQueryParam("TermRequired", qTermRequired); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/agreements/get_agreements_responses.go b/client/agreements/get_agreements_responses.go new file mode 100644 index 0000000..4ca0352 --- /dev/null +++ b/client/agreements/get_agreements_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agreements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetAgreementsReader is a Reader for the GetAgreements structure. +type GetAgreementsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAgreementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAgreementsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAgreementsOK creates a GetAgreementsOK with default headers values +func NewGetAgreementsOK() *GetAgreementsOK { + return &GetAgreementsOK{} +} + +/*GetAgreementsOK handles this case with default header values. + +Success +*/ +type GetAgreementsOK struct { + Payload *models.AgreementCollection +} + +func (o *GetAgreementsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Agreements][%d] getAgreementsOK %+v", 200, o.Payload) +} + +func (o *GetAgreementsOK) GetPayload() *models.AgreementCollection { + return o.Payload +} + +func (o *GetAgreementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AgreementCollection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/assets/assets_client.go b/client/assets/assets_client.go index 5663788..7098cc8 100644 --- a/client/assets/assets_client.go +++ b/client/assets/assets_client.go @@ -33,6 +33,8 @@ type ClientService interface { GetAssetOrdersAsync(params *GetAssetOrdersAsyncParams, authInfo runtime.ClientAuthInfoWriter) (*GetAssetOrdersAsyncOK, error) + GetAssets(params *GetAssetsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAssetsOK, error) + UpdateTagsAsync(params *UpdateTagsAsyncParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateTagsAsyncOK, error) VerifyAsync(params *VerifyAsyncParams, authInfo runtime.ClientAuthInfoWriter) (*VerifyAsyncOK, error) @@ -145,6 +147,41 @@ func (a *Client) GetAssetOrdersAsync(params *GetAssetOrdersAsyncParams, authInfo panic(msg) } +/* + GetAssets get assets API +*/ +func (a *Client) GetAssets(params *GetAssetsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAssetsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAssets", + Method: "GET", + PathPattern: "/api/v1/Assets", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAssetsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetAssets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UpdateTagsAsync update tags async API */ diff --git a/client/assets/get_assets_parameters.go b/client/assets/get_assets_parameters.go new file mode 100644 index 0000000..01cee81 --- /dev/null +++ b/client/assets/get_assets_parameters.go @@ -0,0 +1,397 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package assets + +// 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" +) + +// NewGetAssetsParams creates a new GetAssetsParams object +// with the default values initialized. +func NewGetAssetsParams() *GetAssetsParams { + var () + return &GetAssetsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAssetsParamsWithTimeout creates a new GetAssetsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAssetsParamsWithTimeout(timeout time.Duration) *GetAssetsParams { + var () + return &GetAssetsParams{ + + timeout: timeout, + } +} + +// NewGetAssetsParamsWithContext creates a new GetAssetsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAssetsParamsWithContext(ctx context.Context) *GetAssetsParams { + var () + return &GetAssetsParams{ + + Context: ctx, + } +} + +// NewGetAssetsParamsWithHTTPClient creates a new GetAssetsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAssetsParamsWithHTTPClient(client *http.Client) *GetAssetsParams { + var () + return &GetAssetsParams{ + HTTPClient: client, + } +} + +/*GetAssetsParams contains all the parameters to send to the API endpoint +for the get assets operation typically these are written to a http.Request +*/ +type GetAssetsParams struct { + + /*AssetType*/ + AssetType *string + /*ExternalOrderID*/ + ExternalOrderID *string + /*ExternalOrderIds*/ + ExternalOrderIds []string + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*PublisherID*/ + PublisherID *int32 + /*ResellerCustomerID*/ + ResellerCustomerID *int32 + /*ReservationID*/ + ReservationID *string + /*Search*/ + Search *string + /*Status*/ + Status *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get assets params +func (o *GetAssetsParams) WithTimeout(timeout time.Duration) *GetAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get assets params +func (o *GetAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get assets params +func (o *GetAssetsParams) WithContext(ctx context.Context) *GetAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get assets params +func (o *GetAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get assets params +func (o *GetAssetsParams) WithHTTPClient(client *http.Client) *GetAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get assets params +func (o *GetAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetType adds the assetType to the get assets params +func (o *GetAssetsParams) WithAssetType(assetType *string) *GetAssetsParams { + o.SetAssetType(assetType) + return o +} + +// SetAssetType adds the assetType to the get assets params +func (o *GetAssetsParams) SetAssetType(assetType *string) { + o.AssetType = assetType +} + +// WithExternalOrderID adds the externalOrderID to the get assets params +func (o *GetAssetsParams) WithExternalOrderID(externalOrderID *string) *GetAssetsParams { + o.SetExternalOrderID(externalOrderID) + return o +} + +// SetExternalOrderID adds the externalOrderId to the get assets params +func (o *GetAssetsParams) SetExternalOrderID(externalOrderID *string) { + o.ExternalOrderID = externalOrderID +} + +// WithExternalOrderIds adds the externalOrderIds to the get assets params +func (o *GetAssetsParams) WithExternalOrderIds(externalOrderIds []string) *GetAssetsParams { + o.SetExternalOrderIds(externalOrderIds) + return o +} + +// SetExternalOrderIds adds the externalOrderIds to the get assets params +func (o *GetAssetsParams) SetExternalOrderIds(externalOrderIds []string) { + o.ExternalOrderIds = externalOrderIds +} + +// WithPage adds the page to the get assets params +func (o *GetAssetsParams) WithPage(page *int32) *GetAssetsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get assets params +func (o *GetAssetsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get assets params +func (o *GetAssetsParams) WithPageSize(pageSize *int32) *GetAssetsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get assets params +func (o *GetAssetsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithPublisherID adds the publisherID to the get assets params +func (o *GetAssetsParams) WithPublisherID(publisherID *int32) *GetAssetsParams { + o.SetPublisherID(publisherID) + return o +} + +// SetPublisherID adds the publisherId to the get assets params +func (o *GetAssetsParams) SetPublisherID(publisherID *int32) { + o.PublisherID = publisherID +} + +// WithResellerCustomerID adds the resellerCustomerID to the get assets params +func (o *GetAssetsParams) WithResellerCustomerID(resellerCustomerID *int32) *GetAssetsParams { + o.SetResellerCustomerID(resellerCustomerID) + return o +} + +// SetResellerCustomerID adds the resellerCustomerId to the get assets params +func (o *GetAssetsParams) SetResellerCustomerID(resellerCustomerID *int32) { + o.ResellerCustomerID = resellerCustomerID +} + +// WithReservationID adds the reservationID to the get assets params +func (o *GetAssetsParams) WithReservationID(reservationID *string) *GetAssetsParams { + o.SetReservationID(reservationID) + return o +} + +// SetReservationID adds the reservationId to the get assets params +func (o *GetAssetsParams) SetReservationID(reservationID *string) { + o.ReservationID = reservationID +} + +// WithSearch adds the search to the get assets params +func (o *GetAssetsParams) WithSearch(search *string) *GetAssetsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get assets params +func (o *GetAssetsParams) SetSearch(search *string) { + o.Search = search +} + +// WithStatus adds the status to the get assets params +func (o *GetAssetsParams) WithStatus(status *string) *GetAssetsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the get assets params +func (o *GetAssetsParams) SetStatus(status *string) { + o.Status = status +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AssetType != nil { + + // query param AssetType + var qrAssetType string + if o.AssetType != nil { + qrAssetType = *o.AssetType + } + qAssetType := qrAssetType + if qAssetType != "" { + if err := r.SetQueryParam("AssetType", qAssetType); err != nil { + return err + } + } + + } + + if o.ExternalOrderID != nil { + + // query param ExternalOrderId + var qrExternalOrderID string + if o.ExternalOrderID != nil { + qrExternalOrderID = *o.ExternalOrderID + } + qExternalOrderID := qrExternalOrderID + if qExternalOrderID != "" { + if err := r.SetQueryParam("ExternalOrderId", qExternalOrderID); err != nil { + return err + } + } + + } + + valuesExternalOrderIds := o.ExternalOrderIds + + joinedExternalOrderIds := swag.JoinByFormat(valuesExternalOrderIds, "multi") + // query array param ExternalOrderIds + if err := r.SetQueryParam("ExternalOrderIds", joinedExternalOrderIds...); 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.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.ResellerCustomerID != nil { + + // query param ResellerCustomerId + var qrResellerCustomerID int32 + if o.ResellerCustomerID != nil { + qrResellerCustomerID = *o.ResellerCustomerID + } + qResellerCustomerID := swag.FormatInt32(qrResellerCustomerID) + if qResellerCustomerID != "" { + if err := r.SetQueryParam("ResellerCustomerId", qResellerCustomerID); err != nil { + return err + } + } + + } + + if o.ReservationID != nil { + + // query param ReservationId + var qrReservationID string + if o.ReservationID != nil { + qrReservationID = *o.ReservationID + } + qReservationID := qrReservationID + if qReservationID != "" { + if err := r.SetQueryParam("ReservationId", qReservationID); 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 o.Status != nil { + + // query param Status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("Status", qStatus); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/assets/get_assets_responses.go b/client/assets/get_assets_responses.go new file mode 100644 index 0000000..8fef7fc --- /dev/null +++ b/client/assets/get_assets_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package assets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetAssetsReader is a Reader for the GetAssets structure. +type GetAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAssetsOK creates a GetAssetsOK with default headers values +func NewGetAssetsOK() *GetAssetsOK { + return &GetAssetsOK{} +} + +/*GetAssetsOK handles this case with default header values. + +Success +*/ +type GetAssetsOK struct { + Payload *models.APICollectionOfAsset +} + +func (o *GetAssetsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Assets][%d] getAssetsOK %+v", 200, o.Payload) +} + +func (o *GetAssetsOK) GetPayload() *models.APICollectionOfAsset { + return o.Payload +} + +func (o *GetAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfAsset) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/aws_accounts/aws_accounts_client.go b/client/aws_accounts/aws_accounts_client.go index 9661693..fb27a84 100644 --- a/client/aws_accounts/aws_accounts_client.go +++ b/client/aws_accounts/aws_accounts_client.go @@ -31,6 +31,8 @@ type ClientService interface { GetAwsAccounts(params *GetAwsAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAwsAccountsOK, error) + PutAwsAccounts(params *PutAwsAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutAwsAccountsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -104,6 +106,41 @@ func (a *Client) GetAwsAccounts(params *GetAwsAccountsParams, authInfo runtime.C panic(msg) } +/* + PutAwsAccounts put aws accounts API +*/ +func (a *Client) PutAwsAccounts(params *PutAwsAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutAwsAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutAwsAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutAwsAccounts", + Method: "PUT", + PathPattern: "/api/v1/AwsAccounts/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutAwsAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutAwsAccountsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutAwsAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/aws_accounts/put_aws_accounts_parameters.go b/client/aws_accounts/put_aws_accounts_parameters.go new file mode 100644 index 0000000..9a13971 --- /dev/null +++ b/client/aws_accounts/put_aws_accounts_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package aws_accounts + +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutAwsAccountsParams creates a new PutAwsAccountsParams object +// with the default values initialized. +func NewPutAwsAccountsParams() *PutAwsAccountsParams { + var () + return &PutAwsAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutAwsAccountsParamsWithTimeout creates a new PutAwsAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutAwsAccountsParamsWithTimeout(timeout time.Duration) *PutAwsAccountsParams { + var () + return &PutAwsAccountsParams{ + + timeout: timeout, + } +} + +// NewPutAwsAccountsParamsWithContext creates a new PutAwsAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutAwsAccountsParamsWithContext(ctx context.Context) *PutAwsAccountsParams { + var () + return &PutAwsAccountsParams{ + + Context: ctx, + } +} + +// NewPutAwsAccountsParamsWithHTTPClient creates a new PutAwsAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutAwsAccountsParamsWithHTTPClient(client *http.Client) *PutAwsAccountsParams { + var () + return &PutAwsAccountsParams{ + HTTPClient: client, + } +} + +/*PutAwsAccountsParams contains all the parameters to send to the API endpoint +for the put aws accounts operation typically these are written to a http.Request +*/ +type PutAwsAccountsParams struct { + + /*AwsAccount*/ + AwsAccount *models.AwsAccount + /*ID*/ + ID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put aws accounts params +func (o *PutAwsAccountsParams) WithTimeout(timeout time.Duration) *PutAwsAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put aws accounts params +func (o *PutAwsAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put aws accounts params +func (o *PutAwsAccountsParams) WithContext(ctx context.Context) *PutAwsAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put aws accounts params +func (o *PutAwsAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put aws accounts params +func (o *PutAwsAccountsParams) WithHTTPClient(client *http.Client) *PutAwsAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put aws accounts params +func (o *PutAwsAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAwsAccount adds the awsAccount to the put aws accounts params +func (o *PutAwsAccountsParams) WithAwsAccount(awsAccount *models.AwsAccount) *PutAwsAccountsParams { + o.SetAwsAccount(awsAccount) + return o +} + +// SetAwsAccount adds the awsAccount to the put aws accounts params +func (o *PutAwsAccountsParams) SetAwsAccount(awsAccount *models.AwsAccount) { + o.AwsAccount = awsAccount +} + +// WithID adds the id to the put aws accounts params +func (o *PutAwsAccountsParams) WithID(id int32) *PutAwsAccountsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put aws accounts params +func (o *PutAwsAccountsParams) SetID(id int32) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAwsAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AwsAccount != nil { + if err := r.SetBodyParam(o.AwsAccount); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/aws_accounts/put_aws_accounts_responses.go b/client/aws_accounts/put_aws_accounts_responses.go new file mode 100644 index 0000000..abba3cb --- /dev/null +++ b/client/aws_accounts/put_aws_accounts_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package aws_accounts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutAwsAccountsReader is a Reader for the PutAwsAccounts structure. +type PutAwsAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAwsAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutAwsAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutAwsAccountsOK creates a PutAwsAccountsOK with default headers values +func NewPutAwsAccountsOK() *PutAwsAccountsOK { + return &PutAwsAccountsOK{} +} + +/*PutAwsAccountsOK handles this case with default header values. + +Success +*/ +type PutAwsAccountsOK struct { + Payload *models.AwsAccount +} + +func (o *PutAwsAccountsOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/AwsAccounts/{id}][%d] putAwsAccountsOK %+v", 200, o.Payload) +} + +func (o *PutAwsAccountsOK) GetPayload() *models.AwsAccount { + return o.Payload +} + +func (o *PutAwsAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AwsAccount) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/azure_plans/azure_plans_client.go b/client/azure_plans/azure_plans_client.go index 87c8f5a..a2f128d 100644 --- a/client/azure_plans/azure_plans_client.go +++ b/client/azure_plans/azure_plans_client.go @@ -37,8 +37,6 @@ type ClientService interface { GetSubscriptionByID(params *GetSubscriptionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionByIDOK, error) - GetSubscriptions(params *GetSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionsOK, error) - PostAPIV1AzurePlansAzurePlanIDAzureSubscriptionsIDEnable(params *PostAPIV1AzurePlansAzurePlanIDAzureSubscriptionsIDEnableParams, authInfo runtime.ClientAuthInfoWriter) (*PostAPIV1AzurePlansAzurePlanIDAzureSubscriptionsIDEnableOK, error) UpdateSubscription(params *UpdateSubscriptionParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateSubscriptionOK, error) @@ -221,41 +219,6 @@ func (a *Client) GetSubscriptionByID(params *GetSubscriptionByIDParams, authInfo panic(msg) } -/* - GetSubscriptions get subscriptions API -*/ -func (a *Client) GetSubscriptions(params *GetSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSubscriptionsParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetSubscriptions", - Method: "GET", - PathPattern: "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions", - ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetSubscriptionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSubscriptionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* PostAPIV1AzurePlansAzurePlanIDAzureSubscriptionsIDEnable post API v1 azure plans azure plan ID azure subscriptions ID enable API */ diff --git a/client/clients/clients_client.go b/client/clients/clients_client.go new file mode 100644 index 0000000..85c36d3 --- /dev/null +++ b/client/clients/clients_client.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new clients API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for clients API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteClients(params *DeleteClientsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteClientsOK, error) + + GetClients(params *GetClientsParams, authInfo runtime.ClientAuthInfoWriter) (*GetClientsOK, error) + + PostClients(params *PostClientsParams, authInfo runtime.ClientAuthInfoWriter) (*PostClientsOK, error) + + PutClients(params *PutClientsParams, authInfo runtime.ClientAuthInfoWriter) (*PutClientsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteClients delete clients API +*/ +func (a *Client) DeleteClients(params *DeleteClientsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteClientsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteClientsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteClients", + Method: "DELETE", + PathPattern: "/api/v1/Clients/{clientId}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteClientsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteClientsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteClients: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetClients get clients API +*/ +func (a *Client) GetClients(params *GetClientsParams, authInfo runtime.ClientAuthInfoWriter) (*GetClientsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClientsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClients", + Method: "GET", + PathPattern: "/api/v1/Clients", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClientsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClientsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetClients: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostClients post clients API +*/ +func (a *Client) PostClients(params *PostClientsParams, authInfo runtime.ClientAuthInfoWriter) (*PostClientsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostClientsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostClients", + Method: "POST", + PathPattern: "/api/v1/Clients", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostClientsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostClientsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostClients: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutClients put clients API +*/ +func (a *Client) PutClients(params *PutClientsParams, authInfo runtime.ClientAuthInfoWriter) (*PutClientsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClientsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClients", + Method: "PUT", + PathPattern: "/api/v1/Clients/{clientId}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClientsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClientsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutClients: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/clients/delete_clients_parameters.go b/client/clients/delete_clients_parameters.go new file mode 100644 index 0000000..b0095c2 --- /dev/null +++ b/client/clients/delete_clients_parameters.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// 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" +) + +// NewDeleteClientsParams creates a new DeleteClientsParams object +// with the default values initialized. +func NewDeleteClientsParams() *DeleteClientsParams { + var () + return &DeleteClientsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteClientsParamsWithTimeout creates a new DeleteClientsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteClientsParamsWithTimeout(timeout time.Duration) *DeleteClientsParams { + var () + return &DeleteClientsParams{ + + timeout: timeout, + } +} + +// NewDeleteClientsParamsWithContext creates a new DeleteClientsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteClientsParamsWithContext(ctx context.Context) *DeleteClientsParams { + var () + return &DeleteClientsParams{ + + Context: ctx, + } +} + +// NewDeleteClientsParamsWithHTTPClient creates a new DeleteClientsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteClientsParamsWithHTTPClient(client *http.Client) *DeleteClientsParams { + var () + return &DeleteClientsParams{ + HTTPClient: client, + } +} + +/*DeleteClientsParams contains all the parameters to send to the API endpoint +for the delete clients operation typically these are written to a http.Request +*/ +type DeleteClientsParams struct { + + /*ClientID*/ + ClientID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete clients params +func (o *DeleteClientsParams) WithTimeout(timeout time.Duration) *DeleteClientsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete clients params +func (o *DeleteClientsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete clients params +func (o *DeleteClientsParams) WithContext(ctx context.Context) *DeleteClientsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete clients params +func (o *DeleteClientsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete clients params +func (o *DeleteClientsParams) WithHTTPClient(client *http.Client) *DeleteClientsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete clients params +func (o *DeleteClientsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClientID adds the clientID to the delete clients params +func (o *DeleteClientsParams) WithClientID(clientID string) *DeleteClientsParams { + o.SetClientID(clientID) + return o +} + +// SetClientID adds the clientId to the delete clients params +func (o *DeleteClientsParams) SetClientID(clientID string) { + o.ClientID = clientID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteClientsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param clientId + if err := r.SetPathParam("clientId", o.ClientID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/clients/delete_clients_responses.go b/client/clients/delete_clients_responses.go new file mode 100644 index 0000000..b5e617e --- /dev/null +++ b/client/clients/delete_clients_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteClientsReader is a Reader for the DeleteClients structure. +type DeleteClientsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteClientsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteClientsOK creates a DeleteClientsOK with default headers values +func NewDeleteClientsOK() *DeleteClientsOK { + return &DeleteClientsOK{} +} + +/*DeleteClientsOK handles this case with default header values. + +Success +*/ +type DeleteClientsOK struct { + Payload bool +} + +func (o *DeleteClientsOK) Error() string { + return fmt.Sprintf("[DELETE /api/v1/Clients/{clientId}][%d] deleteClientsOK %+v", 200, o.Payload) +} + +func (o *DeleteClientsOK) GetPayload() bool { + return o.Payload +} + +func (o *DeleteClientsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/clients/get_clients_parameters.go b/client/clients/get_clients_parameters.go new file mode 100644 index 0000000..5a77424 --- /dev/null +++ b/client/clients/get_clients_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// 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" +) + +// NewGetClientsParams creates a new GetClientsParams object +// with the default values initialized. +func NewGetClientsParams() *GetClientsParams { + var () + return &GetClientsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClientsParamsWithTimeout creates a new GetClientsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClientsParamsWithTimeout(timeout time.Duration) *GetClientsParams { + var () + return &GetClientsParams{ + + timeout: timeout, + } +} + +// NewGetClientsParamsWithContext creates a new GetClientsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClientsParamsWithContext(ctx context.Context) *GetClientsParams { + var () + return &GetClientsParams{ + + Context: ctx, + } +} + +// NewGetClientsParamsWithHTTPClient creates a new GetClientsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClientsParamsWithHTTPClient(client *http.Client) *GetClientsParams { + var () + return &GetClientsParams{ + HTTPClient: client, + } +} + +/*GetClientsParams contains all the parameters to send to the API endpoint +for the get clients operation typically these are written to a http.Request +*/ +type GetClientsParams struct { + + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get clients params +func (o *GetClientsParams) WithTimeout(timeout time.Duration) *GetClientsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get clients params +func (o *GetClientsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get clients params +func (o *GetClientsParams) WithContext(ctx context.Context) *GetClientsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get clients params +func (o *GetClientsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get clients params +func (o *GetClientsParams) WithHTTPClient(client *http.Client) *GetClientsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get clients params +func (o *GetClientsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the get clients params +func (o *GetClientsParams) WithPage(page *int32) *GetClientsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get clients params +func (o *GetClientsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get clients params +func (o *GetClientsParams) WithPageSize(pageSize *int32) *GetClientsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get clients params +func (o *GetClientsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithSearch adds the search to the get clients params +func (o *GetClientsParams) WithSearch(search *string) *GetClientsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get clients params +func (o *GetClientsParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClientsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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 +} diff --git a/client/clients/get_clients_responses.go b/client/clients/get_clients_responses.go new file mode 100644 index 0000000..10ccfdc --- /dev/null +++ b/client/clients/get_clients_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetClientsReader is a Reader for the GetClients structure. +type GetClientsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClientsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetClientsOK creates a GetClientsOK with default headers values +func NewGetClientsOK() *GetClientsOK { + return &GetClientsOK{} +} + +/*GetClientsOK handles this case with default header values. + +Success +*/ +type GetClientsOK struct { + Payload *models.APICollectionOfClient +} + +func (o *GetClientsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Clients][%d] getClientsOK %+v", 200, o.Payload) +} + +func (o *GetClientsOK) GetPayload() *models.APICollectionOfClient { + return o.Payload +} + +func (o *GetClientsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfClient) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/clients/post_clients_parameters.go b/client/clients/post_clients_parameters.go new file mode 100644 index 0000000..123dbc5 --- /dev/null +++ b/client/clients/post_clients_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostClientsParams creates a new PostClientsParams object +// with the default values initialized. +func NewPostClientsParams() *PostClientsParams { + var () + return &PostClientsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostClientsParamsWithTimeout creates a new PostClientsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostClientsParamsWithTimeout(timeout time.Duration) *PostClientsParams { + var () + return &PostClientsParams{ + + timeout: timeout, + } +} + +// NewPostClientsParamsWithContext creates a new PostClientsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostClientsParamsWithContext(ctx context.Context) *PostClientsParams { + var () + return &PostClientsParams{ + + Context: ctx, + } +} + +// NewPostClientsParamsWithHTTPClient creates a new PostClientsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostClientsParamsWithHTTPClient(client *http.Client) *PostClientsParams { + var () + return &PostClientsParams{ + HTTPClient: client, + } +} + +/*PostClientsParams contains all the parameters to send to the API endpoint +for the post clients operation typically these are written to a http.Request +*/ +type PostClientsParams struct { + + /*Client*/ + Client *models.Client + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post clients params +func (o *PostClientsParams) WithTimeout(timeout time.Duration) *PostClientsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post clients params +func (o *PostClientsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post clients params +func (o *PostClientsParams) WithContext(ctx context.Context) *PostClientsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post clients params +func (o *PostClientsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post clients params +func (o *PostClientsParams) WithHTTPClient(client *http.Client) *PostClientsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post clients params +func (o *PostClientsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClient adds the client to the post clients params +func (o *PostClientsParams) WithClient(client *models.Client) *PostClientsParams { + o.SetClient(client) + return o +} + +// SetClient adds the client to the post clients params +func (o *PostClientsParams) SetClient(client *models.Client) { + o.Client = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PostClientsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Client != nil { + if err := r.SetBodyParam(o.Client); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/clients/post_clients_responses.go b/client/clients/post_clients_responses.go new file mode 100644 index 0000000..f310213 --- /dev/null +++ b/client/clients/post_clients_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostClientsReader is a Reader for the PostClients structure. +type PostClientsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostClientsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostClientsOK creates a PostClientsOK with default headers values +func NewPostClientsOK() *PostClientsOK { + return &PostClientsOK{} +} + +/*PostClientsOK handles this case with default header values. + +Success +*/ +type PostClientsOK struct { + Payload *models.Client +} + +func (o *PostClientsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/Clients][%d] postClientsOK %+v", 200, o.Payload) +} + +func (o *PostClientsOK) GetPayload() *models.Client { + return o.Payload +} + +func (o *PostClientsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/clients/put_clients_parameters.go b/client/clients/put_clients_parameters.go new file mode 100644 index 0000000..b52bb0c --- /dev/null +++ b/client/clients/put_clients_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPutClientsParams creates a new PutClientsParams object +// with the default values initialized. +func NewPutClientsParams() *PutClientsParams { + var () + return &PutClientsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClientsParamsWithTimeout creates a new PutClientsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClientsParamsWithTimeout(timeout time.Duration) *PutClientsParams { + var () + return &PutClientsParams{ + + timeout: timeout, + } +} + +// NewPutClientsParamsWithContext creates a new PutClientsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClientsParamsWithContext(ctx context.Context) *PutClientsParams { + var () + return &PutClientsParams{ + + Context: ctx, + } +} + +// NewPutClientsParamsWithHTTPClient creates a new PutClientsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClientsParamsWithHTTPClient(client *http.Client) *PutClientsParams { + var () + return &PutClientsParams{ + HTTPClient: client, + } +} + +/*PutClientsParams contains all the parameters to send to the API endpoint +for the put clients operation typically these are written to a http.Request +*/ +type PutClientsParams struct { + + /*Client*/ + Client *models.Client + /*ClientID*/ + ClientID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put clients params +func (o *PutClientsParams) WithTimeout(timeout time.Duration) *PutClientsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put clients params +func (o *PutClientsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put clients params +func (o *PutClientsParams) WithContext(ctx context.Context) *PutClientsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put clients params +func (o *PutClientsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put clients params +func (o *PutClientsParams) WithHTTPClient(client *http.Client) *PutClientsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put clients params +func (o *PutClientsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClient adds the client to the put clients params +func (o *PutClientsParams) WithClient(client *models.Client) *PutClientsParams { + o.SetClient(client) + return o +} + +// SetClient adds the client to the put clients params +func (o *PutClientsParams) SetClient(client *models.Client) { + o.Client = client +} + +// WithClientID adds the clientID to the put clients params +func (o *PutClientsParams) WithClientID(clientID string) *PutClientsParams { + o.SetClientID(clientID) + return o +} + +// SetClientID adds the clientId to the put clients params +func (o *PutClientsParams) SetClientID(clientID string) { + o.ClientID = clientID +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClientsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Client != nil { + if err := r.SetBodyParam(o.Client); err != nil { + return err + } + } + + // path param clientId + if err := r.SetPathParam("clientId", o.ClientID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/clients/put_clients_responses.go b/client/clients/put_clients_responses.go new file mode 100644 index 0000000..c4c8720 --- /dev/null +++ b/client/clients/put_clients_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package clients + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutClientsReader is a Reader for the PutClients structure. +type PutClientsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClientsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClientsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutClientsOK creates a PutClientsOK with default headers values +func NewPutClientsOK() *PutClientsOK { + return &PutClientsOK{} +} + +/*PutClientsOK handles this case with default header values. + +Success +*/ +type PutClientsOK struct { + Payload *models.Client +} + +func (o *PutClientsOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/Clients/{clientId}][%d] putClientsOK %+v", 200, o.Payload) +} + +func (o *PutClientsOK) GetPayload() *models.Client { + return o.Payload +} + +func (o *PutClientsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/consumers/consumers_client.go b/client/consumers/consumers_client.go index 4ed35a5..7624b6e 100644 --- a/client/consumers/consumers_client.go +++ b/client/consumers/consumers_client.go @@ -33,6 +33,8 @@ type ClientService interface { GetConsumerByID(params *GetConsumerByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetConsumerByIDOK, error) + GetConsumers(params *GetConsumersParams, authInfo runtime.ClientAuthInfoWriter) (*GetConsumersOK, error) + UpdateConsumer(params *UpdateConsumerParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateConsumerOK, error) SetTransport(transport runtime.ClientTransport) @@ -143,6 +145,41 @@ func (a *Client) GetConsumerByID(params *GetConsumerByIDParams, authInfo runtime panic(msg) } +/* + GetConsumers get consumers API +*/ +func (a *Client) GetConsumers(params *GetConsumersParams, authInfo runtime.ClientAuthInfoWriter) (*GetConsumersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetConsumersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetConsumers", + Method: "GET", + PathPattern: "/api/v1/Consumers", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetConsumersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetConsumersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetConsumers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UpdateConsumer update consumer API */ diff --git a/client/consumers/get_consumers_parameters.go b/client/consumers/get_consumers_parameters.go new file mode 100644 index 0000000..23e9e8f --- /dev/null +++ b/client/consumers/get_consumers_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package consumers + +// 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" +) + +// NewGetConsumersParams creates a new GetConsumersParams object +// with the default values initialized. +func NewGetConsumersParams() *GetConsumersParams { + var () + return &GetConsumersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetConsumersParamsWithTimeout creates a new GetConsumersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetConsumersParamsWithTimeout(timeout time.Duration) *GetConsumersParams { + var () + return &GetConsumersParams{ + + timeout: timeout, + } +} + +// NewGetConsumersParamsWithContext creates a new GetConsumersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetConsumersParamsWithContext(ctx context.Context) *GetConsumersParams { + var () + return &GetConsumersParams{ + + Context: ctx, + } +} + +// NewGetConsumersParamsWithHTTPClient creates a new GetConsumersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetConsumersParamsWithHTTPClient(client *http.Client) *GetConsumersParams { + var () + return &GetConsumersParams{ + HTTPClient: client, + } +} + +/*GetConsumersParams contains all the parameters to send to the API endpoint +for the get consumers operation typically these are written to a http.Request +*/ +type GetConsumersParams struct { + + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get consumers params +func (o *GetConsumersParams) WithTimeout(timeout time.Duration) *GetConsumersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get consumers params +func (o *GetConsumersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get consumers params +func (o *GetConsumersParams) WithContext(ctx context.Context) *GetConsumersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get consumers params +func (o *GetConsumersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get consumers params +func (o *GetConsumersParams) WithHTTPClient(client *http.Client) *GetConsumersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get consumers params +func (o *GetConsumersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrganizationID adds the organizationID to the get consumers params +func (o *GetConsumersParams) WithOrganizationID(organizationID *int32) *GetConsumersParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get consumers params +func (o *GetConsumersParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get consumers params +func (o *GetConsumersParams) WithPage(page *int32) *GetConsumersParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get consumers params +func (o *GetConsumersParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get consumers params +func (o *GetConsumersParams) WithPageSize(pageSize *int32) *GetConsumersParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get consumers params +func (o *GetConsumersParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithSearch adds the search to the get consumers params +func (o *GetConsumersParams) WithSearch(search *string) *GetConsumersParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get consumers params +func (o *GetConsumersParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetConsumersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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 +} diff --git a/client/consumers/get_consumers_responses.go b/client/consumers/get_consumers_responses.go new file mode 100644 index 0000000..4f6eadf --- /dev/null +++ b/client/consumers/get_consumers_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package consumers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetConsumersReader is a Reader for the GetConsumers structure. +type GetConsumersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetConsumersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetConsumersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetConsumersOK creates a GetConsumersOK with default headers values +func NewGetConsumersOK() *GetConsumersOK { + return &GetConsumersOK{} +} + +/*GetConsumersOK handles this case with default header values. + +Success +*/ +type GetConsumersOK struct { + Payload *models.APICollectionOfConsumer +} + +func (o *GetConsumersOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Consumers][%d] getConsumersOK %+v", 200, o.Payload) +} + +func (o *GetConsumersOK) GetPayload() *models.APICollectionOfConsumer { + return o.Payload +} + +func (o *GetConsumersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfConsumer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/crayon_accounts/crayon_accounts_client.go b/client/crayon_accounts/crayon_accounts_client.go index 990aca6..feca43c 100644 --- a/client/crayon_accounts/crayon_accounts_client.go +++ b/client/crayon_accounts/crayon_accounts_client.go @@ -31,6 +31,10 @@ type ClientService interface { GetCrayonAccounts(params *GetCrayonAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCrayonAccountsOK, error) + PostCrayonAccounts(params *PostCrayonAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCrayonAccountsOK, error) + + PutCrayonAccounts(params *PutCrayonAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCrayonAccountsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -104,6 +108,76 @@ func (a *Client) GetCrayonAccounts(params *GetCrayonAccountsParams, authInfo run panic(msg) } +/* + PostCrayonAccounts post crayon accounts API +*/ +func (a *Client) PostCrayonAccounts(params *PostCrayonAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCrayonAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCrayonAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostCrayonAccounts", + Method: "POST", + PathPattern: "/api/v1/CrayonAccounts", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCrayonAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCrayonAccountsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostCrayonAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutCrayonAccounts put crayon accounts API +*/ +func (a *Client) PutCrayonAccounts(params *PutCrayonAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCrayonAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutCrayonAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutCrayonAccounts", + Method: "PUT", + PathPattern: "/api/v1/CrayonAccounts/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutCrayonAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutCrayonAccountsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutCrayonAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/crayon_accounts/post_crayon_accounts_parameters.go b/client/crayon_accounts/post_crayon_accounts_parameters.go new file mode 100644 index 0000000..5ae51f7 --- /dev/null +++ b/client/crayon_accounts/post_crayon_accounts_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package crayon_accounts + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostCrayonAccountsParams creates a new PostCrayonAccountsParams object +// with the default values initialized. +func NewPostCrayonAccountsParams() *PostCrayonAccountsParams { + var () + return &PostCrayonAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCrayonAccountsParamsWithTimeout creates a new PostCrayonAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCrayonAccountsParamsWithTimeout(timeout time.Duration) *PostCrayonAccountsParams { + var () + return &PostCrayonAccountsParams{ + + timeout: timeout, + } +} + +// NewPostCrayonAccountsParamsWithContext creates a new PostCrayonAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCrayonAccountsParamsWithContext(ctx context.Context) *PostCrayonAccountsParams { + var () + return &PostCrayonAccountsParams{ + + Context: ctx, + } +} + +// NewPostCrayonAccountsParamsWithHTTPClient creates a new PostCrayonAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCrayonAccountsParamsWithHTTPClient(client *http.Client) *PostCrayonAccountsParams { + var () + return &PostCrayonAccountsParams{ + HTTPClient: client, + } +} + +/*PostCrayonAccountsParams contains all the parameters to send to the API endpoint +for the post crayon accounts operation typically these are written to a http.Request +*/ +type PostCrayonAccountsParams struct { + + /*CrayonAccount*/ + CrayonAccount *models.CrayonAccount + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post crayon accounts params +func (o *PostCrayonAccountsParams) WithTimeout(timeout time.Duration) *PostCrayonAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post crayon accounts params +func (o *PostCrayonAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post crayon accounts params +func (o *PostCrayonAccountsParams) WithContext(ctx context.Context) *PostCrayonAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post crayon accounts params +func (o *PostCrayonAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post crayon accounts params +func (o *PostCrayonAccountsParams) WithHTTPClient(client *http.Client) *PostCrayonAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post crayon accounts params +func (o *PostCrayonAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCrayonAccount adds the crayonAccount to the post crayon accounts params +func (o *PostCrayonAccountsParams) WithCrayonAccount(crayonAccount *models.CrayonAccount) *PostCrayonAccountsParams { + o.SetCrayonAccount(crayonAccount) + return o +} + +// SetCrayonAccount adds the crayonAccount to the post crayon accounts params +func (o *PostCrayonAccountsParams) SetCrayonAccount(crayonAccount *models.CrayonAccount) { + o.CrayonAccount = crayonAccount +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCrayonAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CrayonAccount != nil { + if err := r.SetBodyParam(o.CrayonAccount); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/crayon_accounts/post_crayon_accounts_responses.go b/client/crayon_accounts/post_crayon_accounts_responses.go new file mode 100644 index 0000000..84414ca --- /dev/null +++ b/client/crayon_accounts/post_crayon_accounts_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package crayon_accounts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostCrayonAccountsReader is a Reader for the PostCrayonAccounts structure. +type PostCrayonAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCrayonAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCrayonAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostCrayonAccountsOK creates a PostCrayonAccountsOK with default headers values +func NewPostCrayonAccountsOK() *PostCrayonAccountsOK { + return &PostCrayonAccountsOK{} +} + +/*PostCrayonAccountsOK handles this case with default header values. + +Success +*/ +type PostCrayonAccountsOK struct { + Payload *models.CrayonAccount +} + +func (o *PostCrayonAccountsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/CrayonAccounts][%d] postCrayonAccountsOK %+v", 200, o.Payload) +} + +func (o *PostCrayonAccountsOK) GetPayload() *models.CrayonAccount { + return o.Payload +} + +func (o *PostCrayonAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CrayonAccount) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/crayon_accounts/put_crayon_accounts_parameters.go b/client/crayon_accounts/put_crayon_accounts_parameters.go new file mode 100644 index 0000000..2da7114 --- /dev/null +++ b/client/crayon_accounts/put_crayon_accounts_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package crayon_accounts + +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutCrayonAccountsParams creates a new PutCrayonAccountsParams object +// with the default values initialized. +func NewPutCrayonAccountsParams() *PutCrayonAccountsParams { + var () + return &PutCrayonAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutCrayonAccountsParamsWithTimeout creates a new PutCrayonAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutCrayonAccountsParamsWithTimeout(timeout time.Duration) *PutCrayonAccountsParams { + var () + return &PutCrayonAccountsParams{ + + timeout: timeout, + } +} + +// NewPutCrayonAccountsParamsWithContext creates a new PutCrayonAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutCrayonAccountsParamsWithContext(ctx context.Context) *PutCrayonAccountsParams { + var () + return &PutCrayonAccountsParams{ + + Context: ctx, + } +} + +// NewPutCrayonAccountsParamsWithHTTPClient creates a new PutCrayonAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutCrayonAccountsParamsWithHTTPClient(client *http.Client) *PutCrayonAccountsParams { + var () + return &PutCrayonAccountsParams{ + HTTPClient: client, + } +} + +/*PutCrayonAccountsParams contains all the parameters to send to the API endpoint +for the put crayon accounts operation typically these are written to a http.Request +*/ +type PutCrayonAccountsParams struct { + + /*CrayonAccount*/ + CrayonAccount *models.CrayonAccount + /*ID*/ + ID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put crayon accounts params +func (o *PutCrayonAccountsParams) WithTimeout(timeout time.Duration) *PutCrayonAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put crayon accounts params +func (o *PutCrayonAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put crayon accounts params +func (o *PutCrayonAccountsParams) WithContext(ctx context.Context) *PutCrayonAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put crayon accounts params +func (o *PutCrayonAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put crayon accounts params +func (o *PutCrayonAccountsParams) WithHTTPClient(client *http.Client) *PutCrayonAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put crayon accounts params +func (o *PutCrayonAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCrayonAccount adds the crayonAccount to the put crayon accounts params +func (o *PutCrayonAccountsParams) WithCrayonAccount(crayonAccount *models.CrayonAccount) *PutCrayonAccountsParams { + o.SetCrayonAccount(crayonAccount) + return o +} + +// SetCrayonAccount adds the crayonAccount to the put crayon accounts params +func (o *PutCrayonAccountsParams) SetCrayonAccount(crayonAccount *models.CrayonAccount) { + o.CrayonAccount = crayonAccount +} + +// WithID adds the id to the put crayon accounts params +func (o *PutCrayonAccountsParams) WithID(id int32) *PutCrayonAccountsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put crayon accounts params +func (o *PutCrayonAccountsParams) SetID(id int32) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *PutCrayonAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CrayonAccount != nil { + if err := r.SetBodyParam(o.CrayonAccount); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/crayon_accounts/put_crayon_accounts_responses.go b/client/crayon_accounts/put_crayon_accounts_responses.go new file mode 100644 index 0000000..c090572 --- /dev/null +++ b/client/crayon_accounts/put_crayon_accounts_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package crayon_accounts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutCrayonAccountsReader is a Reader for the PutCrayonAccounts structure. +type PutCrayonAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutCrayonAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutCrayonAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutCrayonAccountsOK creates a PutCrayonAccountsOK with default headers values +func NewPutCrayonAccountsOK() *PutCrayonAccountsOK { + return &PutCrayonAccountsOK{} +} + +/*PutCrayonAccountsOK handles this case with default header values. + +Success +*/ +type PutCrayonAccountsOK struct { + Payload *models.CrayonAccount +} + +func (o *PutCrayonAccountsOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/CrayonAccounts/{id}][%d] putCrayonAccountsOK %+v", 200, o.Payload) +} + +func (o *PutCrayonAccountsOK) GetPayload() *models.CrayonAccount { + return o.Payload +} + +func (o *PutCrayonAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CrayonAccount) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/crayon_group_customer_api_client.go b/client/crayon_group_customer_api_client.go index e2d8325..9a5b188 100644 --- a/client/crayon_group_customer_api_client.go +++ b/client/crayon_group_customer_api_client.go @@ -10,23 +10,33 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/bjerkio/crayon-api-go/client/activity_logs" + "github.com/bjerkio/crayon-api-go/client/addresses" "github.com/bjerkio/crayon-api-go/client/agreement_products" "github.com/bjerkio/crayon-api-go/client/agreement_reports" + "github.com/bjerkio/crayon-api-go/client/agreements" "github.com/bjerkio/crayon-api-go/client/assets" "github.com/bjerkio/crayon-api-go/client/aws_accounts" "github.com/bjerkio/crayon-api-go/client/azure_plans" "github.com/bjerkio/crayon-api-go/client/billing_cycles" "github.com/bjerkio/crayon-api-go/client/billing_statements" "github.com/bjerkio/crayon-api-go/client/blog_items" + "github.com/bjerkio/crayon-api-go/client/clients" "github.com/bjerkio/crayon-api-go/client/consumers" "github.com/bjerkio/crayon-api-go/client/crayon_accounts" "github.com/bjerkio/crayon-api-go/client/customer_tenant_agreements" "github.com/bjerkio/crayon-api-go/client/customer_tenants" + "github.com/bjerkio/crayon-api-go/client/customer_token" "github.com/bjerkio/crayon-api-go/client/google_orders" + "github.com/bjerkio/crayon-api-go/client/groupings" + "github.com/bjerkio/crayon-api-go/client/invoice_profiles" "github.com/bjerkio/crayon-api-go/client/management_links" + "github.com/bjerkio/crayon-api-go/client/me" "github.com/bjerkio/crayon-api-go/client/organization_access" "github.com/bjerkio/crayon-api-go/client/organizations" + "github.com/bjerkio/crayon-api-go/client/ping" "github.com/bjerkio/crayon-api-go/client/product_containers" + "github.com/bjerkio/crayon-api-go/client/programs" "github.com/bjerkio/crayon-api-go/client/publishers" "github.com/bjerkio/crayon-api-go/client/regions" "github.com/bjerkio/crayon-api-go/client/reseller_sales_prices" @@ -78,23 +88,33 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *CrayonGrou cli := new(CrayonGroupCustomerAPI) cli.Transport = transport + cli.ActivityLogs = activity_logs.New(transport, formats) + cli.Addresses = addresses.New(transport, formats) cli.AgreementProducts = agreement_products.New(transport, formats) cli.AgreementReports = agreement_reports.New(transport, formats) + cli.Agreements = agreements.New(transport, formats) cli.Assets = assets.New(transport, formats) cli.AwsAccounts = aws_accounts.New(transport, formats) cli.AzurePlans = azure_plans.New(transport, formats) cli.BillingCycles = billing_cycles.New(transport, formats) cli.BillingStatements = billing_statements.New(transport, formats) cli.BlogItems = blog_items.New(transport, formats) + cli.Clients = clients.New(transport, formats) cli.Consumers = consumers.New(transport, formats) cli.CrayonAccounts = crayon_accounts.New(transport, formats) cli.CustomerTenantAgreements = customer_tenant_agreements.New(transport, formats) cli.CustomerTenants = customer_tenants.New(transport, formats) + cli.CustomerToken = customer_token.New(transport, formats) cli.GoogleOrders = google_orders.New(transport, formats) + cli.Groupings = groupings.New(transport, formats) + cli.InvoiceProfiles = invoice_profiles.New(transport, formats) cli.ManagementLinks = management_links.New(transport, formats) + cli.Me = me.New(transport, formats) cli.OrganizationAccess = organization_access.New(transport, formats) cli.Organizations = organizations.New(transport, formats) + cli.Ping = ping.New(transport, formats) cli.ProductContainers = product_containers.New(transport, formats) + cli.Programs = programs.New(transport, formats) cli.Publishers = publishers.New(transport, formats) cli.Regions = regions.New(transport, formats) cli.ResellerSalesPrices = reseller_sales_prices.New(transport, formats) @@ -146,10 +166,16 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { // CrayonGroupCustomerAPI is a client for crayon group customer API type CrayonGroupCustomerAPI struct { + ActivityLogs activity_logs.ClientService + + Addresses addresses.ClientService + AgreementProducts agreement_products.ClientService AgreementReports agreement_reports.ClientService + Agreements agreements.ClientService + Assets assets.ClientService AwsAccounts aws_accounts.ClientService @@ -162,6 +188,8 @@ type CrayonGroupCustomerAPI struct { BlogItems blog_items.ClientService + Clients clients.ClientService + Consumers consumers.ClientService CrayonAccounts crayon_accounts.ClientService @@ -170,16 +198,28 @@ type CrayonGroupCustomerAPI struct { CustomerTenants customer_tenants.ClientService + CustomerToken customer_token.ClientService + GoogleOrders google_orders.ClientService + Groupings groupings.ClientService + + InvoiceProfiles invoice_profiles.ClientService + ManagementLinks management_links.ClientService + Me me.ClientService + OrganizationAccess organization_access.ClientService Organizations organizations.ClientService + Ping ping.ClientService + ProductContainers product_containers.ClientService + Programs programs.ClientService + Publishers publishers.ClientService Regions regions.ClientService @@ -200,23 +240,33 @@ type CrayonGroupCustomerAPI struct { // SetTransport changes the transport on the client and all its subresources func (c *CrayonGroupCustomerAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport + c.ActivityLogs.SetTransport(transport) + c.Addresses.SetTransport(transport) c.AgreementProducts.SetTransport(transport) c.AgreementReports.SetTransport(transport) + c.Agreements.SetTransport(transport) c.Assets.SetTransport(transport) c.AwsAccounts.SetTransport(transport) c.AzurePlans.SetTransport(transport) c.BillingCycles.SetTransport(transport) c.BillingStatements.SetTransport(transport) c.BlogItems.SetTransport(transport) + c.Clients.SetTransport(transport) c.Consumers.SetTransport(transport) c.CrayonAccounts.SetTransport(transport) c.CustomerTenantAgreements.SetTransport(transport) c.CustomerTenants.SetTransport(transport) + c.CustomerToken.SetTransport(transport) c.GoogleOrders.SetTransport(transport) + c.Groupings.SetTransport(transport) + c.InvoiceProfiles.SetTransport(transport) c.ManagementLinks.SetTransport(transport) + c.Me.SetTransport(transport) c.OrganizationAccess.SetTransport(transport) c.Organizations.SetTransport(transport) + c.Ping.SetTransport(transport) c.ProductContainers.SetTransport(transport) + c.Programs.SetTransport(transport) c.Publishers.SetTransport(transport) c.Regions.SetTransport(transport) c.ResellerSalesPrices.SetTransport(transport) diff --git a/client/customer_tenant_agreements/customer_tenant_agreements_client.go b/client/customer_tenant_agreements/customer_tenant_agreements_client.go index ff852ea..5ca5631 100644 --- a/client/customer_tenant_agreements/customer_tenant_agreements_client.go +++ b/client/customer_tenant_agreements/customer_tenant_agreements_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { Add(params *AddParams, authInfo runtime.ClientAuthInfoWriter) (*AddOK, error) + GetCustomerTenantAgreements(params *GetCustomerTenantAgreementsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTenantAgreementsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -67,6 +69,41 @@ func (a *Client) Add(params *AddParams, authInfo runtime.ClientAuthInfoWriter) ( panic(msg) } +/* + GetCustomerTenantAgreements get customer tenant agreements API +*/ +func (a *Client) GetCustomerTenantAgreements(params *GetCustomerTenantAgreementsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTenantAgreementsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCustomerTenantAgreementsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetCustomerTenantAgreements", + Method: "GET", + PathPattern: "/api/v1/customertenants/{customerTenantId}/agreements", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCustomerTenantAgreementsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCustomerTenantAgreementsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetCustomerTenantAgreements: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/customer_tenant_agreements/get_customer_tenant_agreements_parameters.go b/client/customer_tenant_agreements/get_customer_tenant_agreements_parameters.go new file mode 100644 index 0000000..5a20578 --- /dev/null +++ b/client/customer_tenant_agreements/get_customer_tenant_agreements_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_tenant_agreements + +// 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" +) + +// NewGetCustomerTenantAgreementsParams creates a new GetCustomerTenantAgreementsParams object +// with the default values initialized. +func NewGetCustomerTenantAgreementsParams() *GetCustomerTenantAgreementsParams { + var () + return &GetCustomerTenantAgreementsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCustomerTenantAgreementsParamsWithTimeout creates a new GetCustomerTenantAgreementsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCustomerTenantAgreementsParamsWithTimeout(timeout time.Duration) *GetCustomerTenantAgreementsParams { + var () + return &GetCustomerTenantAgreementsParams{ + + timeout: timeout, + } +} + +// NewGetCustomerTenantAgreementsParamsWithContext creates a new GetCustomerTenantAgreementsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCustomerTenantAgreementsParamsWithContext(ctx context.Context) *GetCustomerTenantAgreementsParams { + var () + return &GetCustomerTenantAgreementsParams{ + + Context: ctx, + } +} + +// NewGetCustomerTenantAgreementsParamsWithHTTPClient creates a new GetCustomerTenantAgreementsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCustomerTenantAgreementsParamsWithHTTPClient(client *http.Client) *GetCustomerTenantAgreementsParams { + var () + return &GetCustomerTenantAgreementsParams{ + HTTPClient: client, + } +} + +/*GetCustomerTenantAgreementsParams contains all the parameters to send to the API endpoint +for the get customer tenant agreements operation typically these are written to a http.Request +*/ +type GetCustomerTenantAgreementsParams struct { + + /*AgreementTypeConsent*/ + AgreementTypeConsent *string + /*CustomerTenantID*/ + CustomerTenantID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) WithTimeout(timeout time.Duration) *GetCustomerTenantAgreementsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) WithContext(ctx context.Context) *GetCustomerTenantAgreementsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) WithHTTPClient(client *http.Client) *GetCustomerTenantAgreementsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAgreementTypeConsent adds the agreementTypeConsent to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) WithAgreementTypeConsent(agreementTypeConsent *string) *GetCustomerTenantAgreementsParams { + o.SetAgreementTypeConsent(agreementTypeConsent) + return o +} + +// SetAgreementTypeConsent adds the agreementTypeConsent to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) SetAgreementTypeConsent(agreementTypeConsent *string) { + o.AgreementTypeConsent = agreementTypeConsent +} + +// WithCustomerTenantID adds the customerTenantID to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) WithCustomerTenantID(customerTenantID int32) *GetCustomerTenantAgreementsParams { + o.SetCustomerTenantID(customerTenantID) + return o +} + +// SetCustomerTenantID adds the customerTenantId to the get customer tenant agreements params +func (o *GetCustomerTenantAgreementsParams) SetCustomerTenantID(customerTenantID int32) { + o.CustomerTenantID = customerTenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCustomerTenantAgreementsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AgreementTypeConsent != nil { + + // query param AgreementTypeConsent + var qrAgreementTypeConsent string + if o.AgreementTypeConsent != nil { + qrAgreementTypeConsent = *o.AgreementTypeConsent + } + qAgreementTypeConsent := qrAgreementTypeConsent + if qAgreementTypeConsent != "" { + if err := r.SetQueryParam("AgreementTypeConsent", qAgreementTypeConsent); err != nil { + return err + } + } + + } + + // path param customerTenantId + if err := r.SetPathParam("customerTenantId", swag.FormatInt32(o.CustomerTenantID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/customer_tenant_agreements/get_customer_tenant_agreements_responses.go b/client/customer_tenant_agreements/get_customer_tenant_agreements_responses.go new file mode 100644 index 0000000..11ef2f7 --- /dev/null +++ b/client/customer_tenant_agreements/get_customer_tenant_agreements_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_tenant_agreements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetCustomerTenantAgreementsReader is a Reader for the GetCustomerTenantAgreements structure. +type GetCustomerTenantAgreementsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCustomerTenantAgreementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCustomerTenantAgreementsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCustomerTenantAgreementsOK creates a GetCustomerTenantAgreementsOK with default headers values +func NewGetCustomerTenantAgreementsOK() *GetCustomerTenantAgreementsOK { + return &GetCustomerTenantAgreementsOK{} +} + +/*GetCustomerTenantAgreementsOK handles this case with default header values. + +Success +*/ +type GetCustomerTenantAgreementsOK struct { + Payload *models.APICollectionOfServiceAccountAgreement +} + +func (o *GetCustomerTenantAgreementsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/customertenants/{customerTenantId}/agreements][%d] getCustomerTenantAgreementsOK %+v", 200, o.Payload) +} + +func (o *GetCustomerTenantAgreementsOK) GetPayload() *models.APICollectionOfServiceAccountAgreement { + return o.Payload +} + +func (o *GetCustomerTenantAgreementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfServiceAccountAgreement) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/customer_tenants/customer_tenants_client.go b/client/customer_tenants/customer_tenants_client.go index 23d1347..db4af21 100644 --- a/client/customer_tenants/customer_tenants_client.go +++ b/client/customer_tenants/customer_tenants_client.go @@ -37,6 +37,12 @@ type ClientService interface { GetCustomerTenantDetailedByID(params *GetCustomerTenantDetailedByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTenantDetailedByIDOK, error) + GetCustomerTenants(params *GetCustomerTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTenantsOK, error) + + PostCustomerTenants(params *PostCustomerTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCustomerTenantsOK, error) + + PutCustomerTenants(params *PutCustomerTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCustomerTenantsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -215,6 +221,111 @@ func (a *Client) GetCustomerTenantDetailedByID(params *GetCustomerTenantDetailed panic(msg) } +/* + GetCustomerTenants get customer tenants API +*/ +func (a *Client) GetCustomerTenants(params *GetCustomerTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCustomerTenantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetCustomerTenants", + Method: "GET", + PathPattern: "/api/v1/CustomerTenants", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCustomerTenantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCustomerTenantsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetCustomerTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCustomerTenants post customer tenants API +*/ +func (a *Client) PostCustomerTenants(params *PostCustomerTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCustomerTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCustomerTenantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostCustomerTenants", + Method: "POST", + PathPattern: "/api/v1/CustomerTenants", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCustomerTenantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCustomerTenantsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostCustomerTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutCustomerTenants put customer tenants API +*/ +func (a *Client) PutCustomerTenants(params *PutCustomerTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCustomerTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutCustomerTenantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutCustomerTenants", + Method: "PUT", + PathPattern: "/api/v1/CustomerTenants/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutCustomerTenantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutCustomerTenantsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutCustomerTenants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/customer_tenants/get_customer_tenants_parameters.go b/client/customer_tenants/get_customer_tenants_parameters.go new file mode 100644 index 0000000..50404b5 --- /dev/null +++ b/client/customer_tenants/get_customer_tenants_parameters.go @@ -0,0 +1,434 @@ +// 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 +} diff --git a/client/customer_tenants/get_customer_tenants_responses.go b/client/customer_tenants/get_customer_tenants_responses.go new file mode 100644 index 0000000..1bf15e2 --- /dev/null +++ b/client/customer_tenants/get_customer_tenants_responses.go @@ -0,0 +1,69 @@ +// 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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetCustomerTenantsReader is a Reader for the GetCustomerTenants structure. +type GetCustomerTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCustomerTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCustomerTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCustomerTenantsOK creates a GetCustomerTenantsOK with default headers values +func NewGetCustomerTenantsOK() *GetCustomerTenantsOK { + return &GetCustomerTenantsOK{} +} + +/*GetCustomerTenantsOK handles this case with default header values. + +Success +*/ +type GetCustomerTenantsOK struct { + Payload *models.APICollectionOfCustomerTenant +} + +func (o *GetCustomerTenantsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/CustomerTenants][%d] getCustomerTenantsOK %+v", 200, o.Payload) +} + +func (o *GetCustomerTenantsOK) GetPayload() *models.APICollectionOfCustomerTenant { + return o.Payload +} + +func (o *GetCustomerTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfCustomerTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/customer_tenants/post_customer_tenants_parameters.go b/client/customer_tenants/post_customer_tenants_parameters.go new file mode 100644 index 0000000..9b2df39 --- /dev/null +++ b/client/customer_tenants/post_customer_tenants_parameters.go @@ -0,0 +1,135 @@ +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostCustomerTenantsParams creates a new PostCustomerTenantsParams object +// with the default values initialized. +func NewPostCustomerTenantsParams() *PostCustomerTenantsParams { + var () + return &PostCustomerTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCustomerTenantsParamsWithTimeout creates a new PostCustomerTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCustomerTenantsParamsWithTimeout(timeout time.Duration) *PostCustomerTenantsParams { + var () + return &PostCustomerTenantsParams{ + + timeout: timeout, + } +} + +// NewPostCustomerTenantsParamsWithContext creates a new PostCustomerTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCustomerTenantsParamsWithContext(ctx context.Context) *PostCustomerTenantsParams { + var () + return &PostCustomerTenantsParams{ + + Context: ctx, + } +} + +// NewPostCustomerTenantsParamsWithHTTPClient creates a new PostCustomerTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCustomerTenantsParamsWithHTTPClient(client *http.Client) *PostCustomerTenantsParams { + var () + return &PostCustomerTenantsParams{ + HTTPClient: client, + } +} + +/*PostCustomerTenantsParams contains all the parameters to send to the API endpoint +for the post customer tenants operation typically these are written to a http.Request +*/ +type PostCustomerTenantsParams struct { + + /*CustomerTenant*/ + CustomerTenant *models.CustomerTenantDetailed + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post customer tenants params +func (o *PostCustomerTenantsParams) WithTimeout(timeout time.Duration) *PostCustomerTenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post customer tenants params +func (o *PostCustomerTenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post customer tenants params +func (o *PostCustomerTenantsParams) WithContext(ctx context.Context) *PostCustomerTenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post customer tenants params +func (o *PostCustomerTenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post customer tenants params +func (o *PostCustomerTenantsParams) WithHTTPClient(client *http.Client) *PostCustomerTenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post customer tenants params +func (o *PostCustomerTenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCustomerTenant adds the customerTenant to the post customer tenants params +func (o *PostCustomerTenantsParams) WithCustomerTenant(customerTenant *models.CustomerTenantDetailed) *PostCustomerTenantsParams { + o.SetCustomerTenant(customerTenant) + return o +} + +// SetCustomerTenant adds the customerTenant to the post customer tenants params +func (o *PostCustomerTenantsParams) SetCustomerTenant(customerTenant *models.CustomerTenantDetailed) { + o.CustomerTenant = customerTenant +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCustomerTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CustomerTenant != nil { + if err := r.SetBodyParam(o.CustomerTenant); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/customer_tenants/post_customer_tenants_responses.go b/client/customer_tenants/post_customer_tenants_responses.go new file mode 100644 index 0000000..c14ae6f --- /dev/null +++ b/client/customer_tenants/post_customer_tenants_responses.go @@ -0,0 +1,69 @@ +// 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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostCustomerTenantsReader is a Reader for the PostCustomerTenants structure. +type PostCustomerTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCustomerTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCustomerTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostCustomerTenantsOK creates a PostCustomerTenantsOK with default headers values +func NewPostCustomerTenantsOK() *PostCustomerTenantsOK { + return &PostCustomerTenantsOK{} +} + +/*PostCustomerTenantsOK handles this case with default header values. + +Success +*/ +type PostCustomerTenantsOK struct { + Payload *models.CustomerTenantDetailed +} + +func (o *PostCustomerTenantsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/CustomerTenants][%d] postCustomerTenantsOK %+v", 200, o.Payload) +} + +func (o *PostCustomerTenantsOK) GetPayload() *models.CustomerTenantDetailed { + return o.Payload +} + +func (o *PostCustomerTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CustomerTenantDetailed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/customer_tenants/put_customer_tenants_parameters.go b/client/customer_tenants/put_customer_tenants_parameters.go new file mode 100644 index 0000000..8fcd3da --- /dev/null +++ b/client/customer_tenants/put_customer_tenants_parameters.go @@ -0,0 +1,154 @@ +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutCustomerTenantsParams creates a new PutCustomerTenantsParams object +// with the default values initialized. +func NewPutCustomerTenantsParams() *PutCustomerTenantsParams { + var () + return &PutCustomerTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutCustomerTenantsParamsWithTimeout creates a new PutCustomerTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutCustomerTenantsParamsWithTimeout(timeout time.Duration) *PutCustomerTenantsParams { + var () + return &PutCustomerTenantsParams{ + + timeout: timeout, + } +} + +// NewPutCustomerTenantsParamsWithContext creates a new PutCustomerTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutCustomerTenantsParamsWithContext(ctx context.Context) *PutCustomerTenantsParams { + var () + return &PutCustomerTenantsParams{ + + Context: ctx, + } +} + +// NewPutCustomerTenantsParamsWithHTTPClient creates a new PutCustomerTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutCustomerTenantsParamsWithHTTPClient(client *http.Client) *PutCustomerTenantsParams { + var () + return &PutCustomerTenantsParams{ + HTTPClient: client, + } +} + +/*PutCustomerTenantsParams contains all the parameters to send to the API endpoint +for the put customer tenants operation typically these are written to a http.Request +*/ +type PutCustomerTenantsParams struct { + + /*CustomerTenant*/ + CustomerTenant *models.CustomerTenantDetailed + /*ID*/ + ID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put customer tenants params +func (o *PutCustomerTenantsParams) WithTimeout(timeout time.Duration) *PutCustomerTenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put customer tenants params +func (o *PutCustomerTenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put customer tenants params +func (o *PutCustomerTenantsParams) WithContext(ctx context.Context) *PutCustomerTenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put customer tenants params +func (o *PutCustomerTenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put customer tenants params +func (o *PutCustomerTenantsParams) WithHTTPClient(client *http.Client) *PutCustomerTenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put customer tenants params +func (o *PutCustomerTenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCustomerTenant adds the customerTenant to the put customer tenants params +func (o *PutCustomerTenantsParams) WithCustomerTenant(customerTenant *models.CustomerTenantDetailed) *PutCustomerTenantsParams { + o.SetCustomerTenant(customerTenant) + return o +} + +// SetCustomerTenant adds the customerTenant to the put customer tenants params +func (o *PutCustomerTenantsParams) SetCustomerTenant(customerTenant *models.CustomerTenantDetailed) { + o.CustomerTenant = customerTenant +} + +// WithID adds the id to the put customer tenants params +func (o *PutCustomerTenantsParams) WithID(id int32) *PutCustomerTenantsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put customer tenants params +func (o *PutCustomerTenantsParams) SetID(id int32) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *PutCustomerTenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CustomerTenant != nil { + if err := r.SetBodyParam(o.CustomerTenant); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/customer_tenants/put_customer_tenants_responses.go b/client/customer_tenants/put_customer_tenants_responses.go new file mode 100644 index 0000000..449ecfb --- /dev/null +++ b/client/customer_tenants/put_customer_tenants_responses.go @@ -0,0 +1,69 @@ +// 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 ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutCustomerTenantsReader is a Reader for the PutCustomerTenants structure. +type PutCustomerTenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutCustomerTenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutCustomerTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutCustomerTenantsOK creates a PutCustomerTenantsOK with default headers values +func NewPutCustomerTenantsOK() *PutCustomerTenantsOK { + return &PutCustomerTenantsOK{} +} + +/*PutCustomerTenantsOK handles this case with default header values. + +Success +*/ +type PutCustomerTenantsOK struct { + Payload *models.CustomerTenantDetailed +} + +func (o *PutCustomerTenantsOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/CustomerTenants/{id}][%d] putCustomerTenantsOK %+v", 200, o.Payload) +} + +func (o *PutCustomerTenantsOK) GetPayload() *models.CustomerTenantDetailed { + return o.Payload +} + +func (o *PutCustomerTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CustomerTenantDetailed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/customer_token/customer_token_client.go b/client/customer_token/customer_token_client.go new file mode 100644 index 0000000..9c835f2 --- /dev/null +++ b/client/customer_token/customer_token_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_token + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new customer token API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for customer token API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + PostCustomerToken(params *PostCustomerTokenParams, authInfo runtime.ClientAuthInfoWriter) (*PostCustomerTokenOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostCustomerToken post customer token API +*/ +func (a *Client) PostCustomerToken(params *PostCustomerTokenParams, authInfo runtime.ClientAuthInfoWriter) (*PostCustomerTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCustomerTokenParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostCustomerToken", + Method: "POST", + PathPattern: "/api/v1/connect/token", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCustomerTokenReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCustomerTokenOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostCustomerToken: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/customer_token/post_customer_token_parameters.go b/client/customer_token/post_customer_token_parameters.go new file mode 100644 index 0000000..ccde43a --- /dev/null +++ b/client/customer_token/post_customer_token_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_token + +// 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" +) + +// NewPostCustomerTokenParams creates a new PostCustomerTokenParams object +// with the default values initialized. +func NewPostCustomerTokenParams() *PostCustomerTokenParams { + + return &PostCustomerTokenParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCustomerTokenParamsWithTimeout creates a new PostCustomerTokenParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCustomerTokenParamsWithTimeout(timeout time.Duration) *PostCustomerTokenParams { + + return &PostCustomerTokenParams{ + + timeout: timeout, + } +} + +// NewPostCustomerTokenParamsWithContext creates a new PostCustomerTokenParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCustomerTokenParamsWithContext(ctx context.Context) *PostCustomerTokenParams { + + return &PostCustomerTokenParams{ + + Context: ctx, + } +} + +// NewPostCustomerTokenParamsWithHTTPClient creates a new PostCustomerTokenParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCustomerTokenParamsWithHTTPClient(client *http.Client) *PostCustomerTokenParams { + + return &PostCustomerTokenParams{ + HTTPClient: client, + } +} + +/*PostCustomerTokenParams contains all the parameters to send to the API endpoint +for the post customer token operation typically these are written to a http.Request +*/ +type PostCustomerTokenParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post customer token params +func (o *PostCustomerTokenParams) WithTimeout(timeout time.Duration) *PostCustomerTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post customer token params +func (o *PostCustomerTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post customer token params +func (o *PostCustomerTokenParams) WithContext(ctx context.Context) *PostCustomerTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post customer token params +func (o *PostCustomerTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post customer token params +func (o *PostCustomerTokenParams) WithHTTPClient(client *http.Client) *PostCustomerTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post customer token params +func (o *PostCustomerTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCustomerTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/customer_token/post_customer_token_responses.go b/client/customer_token/post_customer_token_responses.go new file mode 100644 index 0000000..10df6ad --- /dev/null +++ b/client/customer_token/post_customer_token_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_token + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostCustomerTokenReader is a Reader for the PostCustomerToken structure. +type PostCustomerTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCustomerTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCustomerTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostCustomerTokenOK creates a PostCustomerTokenOK with default headers values +func NewPostCustomerTokenOK() *PostCustomerTokenOK { + return &PostCustomerTokenOK{} +} + +/*PostCustomerTokenOK handles this case with default header values. + +Success +*/ +type PostCustomerTokenOK struct { + Payload *models.Token +} + +func (o *PostCustomerTokenOK) Error() string { + return fmt.Sprintf("[POST /api/v1/connect/token][%d] postCustomerTokenOK %+v", 200, o.Payload) +} + +func (o *PostCustomerTokenOK) GetPayload() *models.Token { + return o.Payload +} + +func (o *PostCustomerTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Token) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/groupings/delete_groupings_parameters.go b/client/groupings/delete_groupings_parameters.go new file mode 100644 index 0000000..8dae634 --- /dev/null +++ b/client/groupings/delete_groupings_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// 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" +) + +// NewDeleteGroupingsParams creates a new DeleteGroupingsParams object +// with the default values initialized. +func NewDeleteGroupingsParams() *DeleteGroupingsParams { + var () + return &DeleteGroupingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteGroupingsParamsWithTimeout creates a new DeleteGroupingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteGroupingsParamsWithTimeout(timeout time.Duration) *DeleteGroupingsParams { + var () + return &DeleteGroupingsParams{ + + timeout: timeout, + } +} + +// NewDeleteGroupingsParamsWithContext creates a new DeleteGroupingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteGroupingsParamsWithContext(ctx context.Context) *DeleteGroupingsParams { + var () + return &DeleteGroupingsParams{ + + Context: ctx, + } +} + +// NewDeleteGroupingsParamsWithHTTPClient creates a new DeleteGroupingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteGroupingsParamsWithHTTPClient(client *http.Client) *DeleteGroupingsParams { + var () + return &DeleteGroupingsParams{ + HTTPClient: client, + } +} + +/*DeleteGroupingsParams contains all the parameters to send to the API endpoint +for the delete groupings operation typically these are written to a http.Request +*/ +type DeleteGroupingsParams struct { + + /*ID*/ + ID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete groupings params +func (o *DeleteGroupingsParams) WithTimeout(timeout time.Duration) *DeleteGroupingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete groupings params +func (o *DeleteGroupingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete groupings params +func (o *DeleteGroupingsParams) WithContext(ctx context.Context) *DeleteGroupingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete groupings params +func (o *DeleteGroupingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete groupings params +func (o *DeleteGroupingsParams) WithHTTPClient(client *http.Client) *DeleteGroupingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete groupings params +func (o *DeleteGroupingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete groupings params +func (o *DeleteGroupingsParams) WithID(id int32) *DeleteGroupingsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete groupings params +func (o *DeleteGroupingsParams) SetID(id int32) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteGroupingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/groupings/delete_groupings_responses.go b/client/groupings/delete_groupings_responses.go new file mode 100644 index 0000000..332e4d5 --- /dev/null +++ b/client/groupings/delete_groupings_responses.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteGroupingsReader is a Reader for the DeleteGroupings structure. +type DeleteGroupingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteGroupingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteGroupingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteGroupingsOK creates a DeleteGroupingsOK with default headers values +func NewDeleteGroupingsOK() *DeleteGroupingsOK { + return &DeleteGroupingsOK{} +} + +/*DeleteGroupingsOK handles this case with default header values. + +Success +*/ +type DeleteGroupingsOK struct { +} + +func (o *DeleteGroupingsOK) Error() string { + return fmt.Sprintf("[DELETE /api/v1/Groupings/{id}][%d] deleteGroupingsOK ", 200) +} + +func (o *DeleteGroupingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/groupings/get_groupings_parameters.go b/client/groupings/get_groupings_parameters.go new file mode 100644 index 0000000..77f9e5e --- /dev/null +++ b/client/groupings/get_groupings_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// 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" +) + +// NewGetGroupingsParams creates a new GetGroupingsParams object +// with the default values initialized. +func NewGetGroupingsParams() *GetGroupingsParams { + var () + return &GetGroupingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetGroupingsParamsWithTimeout creates a new GetGroupingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetGroupingsParamsWithTimeout(timeout time.Duration) *GetGroupingsParams { + var () + return &GetGroupingsParams{ + + timeout: timeout, + } +} + +// NewGetGroupingsParamsWithContext creates a new GetGroupingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetGroupingsParamsWithContext(ctx context.Context) *GetGroupingsParams { + var () + return &GetGroupingsParams{ + + Context: ctx, + } +} + +// NewGetGroupingsParamsWithHTTPClient creates a new GetGroupingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetGroupingsParamsWithHTTPClient(client *http.Client) *GetGroupingsParams { + var () + return &GetGroupingsParams{ + HTTPClient: client, + } +} + +/*GetGroupingsParams contains all the parameters to send to the API endpoint +for the get groupings operation typically these are written to a http.Request +*/ +type GetGroupingsParams struct { + + /*IncludeRemoved*/ + IncludeRemoved *bool + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get groupings params +func (o *GetGroupingsParams) WithTimeout(timeout time.Duration) *GetGroupingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get groupings params +func (o *GetGroupingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get groupings params +func (o *GetGroupingsParams) WithContext(ctx context.Context) *GetGroupingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get groupings params +func (o *GetGroupingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get groupings params +func (o *GetGroupingsParams) WithHTTPClient(client *http.Client) *GetGroupingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get groupings params +func (o *GetGroupingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncludeRemoved adds the includeRemoved to the get groupings params +func (o *GetGroupingsParams) WithIncludeRemoved(includeRemoved *bool) *GetGroupingsParams { + o.SetIncludeRemoved(includeRemoved) + return o +} + +// SetIncludeRemoved adds the includeRemoved to the get groupings params +func (o *GetGroupingsParams) SetIncludeRemoved(includeRemoved *bool) { + o.IncludeRemoved = includeRemoved +} + +// WithOrganizationID adds the organizationID to the get groupings params +func (o *GetGroupingsParams) WithOrganizationID(organizationID *int32) *GetGroupingsParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get groupings params +func (o *GetGroupingsParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get groupings params +func (o *GetGroupingsParams) WithPage(page *int32) *GetGroupingsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get groupings params +func (o *GetGroupingsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get groupings params +func (o *GetGroupingsParams) WithPageSize(pageSize *int32) *GetGroupingsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get groupings params +func (o *GetGroupingsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithSearch adds the search to the get groupings params +func (o *GetGroupingsParams) WithSearch(search *string) *GetGroupingsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get groupings params +func (o *GetGroupingsParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGroupingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IncludeRemoved != nil { + + // query param IncludeRemoved + var qrIncludeRemoved bool + if o.IncludeRemoved != nil { + qrIncludeRemoved = *o.IncludeRemoved + } + qIncludeRemoved := swag.FormatBool(qrIncludeRemoved) + if qIncludeRemoved != "" { + if err := r.SetQueryParam("IncludeRemoved", qIncludeRemoved); 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.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 +} diff --git a/client/groupings/get_groupings_responses.go b/client/groupings/get_groupings_responses.go new file mode 100644 index 0000000..5c9f240 --- /dev/null +++ b/client/groupings/get_groupings_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetGroupingsReader is a Reader for the GetGroupings structure. +type GetGroupingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGroupingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGroupingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetGroupingsOK creates a GetGroupingsOK with default headers values +func NewGetGroupingsOK() *GetGroupingsOK { + return &GetGroupingsOK{} +} + +/*GetGroupingsOK handles this case with default header values. + +Success +*/ +type GetGroupingsOK struct { + Payload *models.APICollectionOfGrouping +} + +func (o *GetGroupingsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Groupings][%d] getGroupingsOK %+v", 200, o.Payload) +} + +func (o *GetGroupingsOK) GetPayload() *models.APICollectionOfGrouping { + return o.Payload +} + +func (o *GetGroupingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfGrouping) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/groupings/groupings_client.go b/client/groupings/groupings_client.go new file mode 100644 index 0000000..1f9f64c --- /dev/null +++ b/client/groupings/groupings_client.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new groupings API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for groupings API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteGroupings(params *DeleteGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteGroupingsOK, error) + + GetGroupings(params *GetGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetGroupingsOK, error) + + PostGroupings(params *PostGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostGroupingsOK, error) + + PutGroupings(params *PutGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*PutGroupingsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteGroupings delete groupings API +*/ +func (a *Client) DeleteGroupings(params *DeleteGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteGroupingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteGroupingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteGroupings", + Method: "DELETE", + PathPattern: "/api/v1/Groupings/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteGroupingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteGroupingsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteGroupings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetGroupings get groupings API +*/ +func (a *Client) GetGroupings(params *GetGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetGroupingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGroupingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetGroupings", + Method: "GET", + PathPattern: "/api/v1/Groupings", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetGroupingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetGroupingsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetGroupings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostGroupings post groupings API +*/ +func (a *Client) PostGroupings(params *PostGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostGroupingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostGroupingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostGroupings", + Method: "POST", + PathPattern: "/api/v1/Groupings", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostGroupingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostGroupingsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostGroupings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutGroupings put groupings API +*/ +func (a *Client) PutGroupings(params *PutGroupingsParams, authInfo runtime.ClientAuthInfoWriter) (*PutGroupingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutGroupingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutGroupings", + Method: "PUT", + PathPattern: "/api/v1/Groupings/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutGroupingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutGroupingsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutGroupings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/groupings/post_groupings_parameters.go b/client/groupings/post_groupings_parameters.go new file mode 100644 index 0000000..8bc796a --- /dev/null +++ b/client/groupings/post_groupings_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostGroupingsParams creates a new PostGroupingsParams object +// with the default values initialized. +func NewPostGroupingsParams() *PostGroupingsParams { + var () + return &PostGroupingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostGroupingsParamsWithTimeout creates a new PostGroupingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostGroupingsParamsWithTimeout(timeout time.Duration) *PostGroupingsParams { + var () + return &PostGroupingsParams{ + + timeout: timeout, + } +} + +// NewPostGroupingsParamsWithContext creates a new PostGroupingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostGroupingsParamsWithContext(ctx context.Context) *PostGroupingsParams { + var () + return &PostGroupingsParams{ + + Context: ctx, + } +} + +// NewPostGroupingsParamsWithHTTPClient creates a new PostGroupingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostGroupingsParamsWithHTTPClient(client *http.Client) *PostGroupingsParams { + var () + return &PostGroupingsParams{ + HTTPClient: client, + } +} + +/*PostGroupingsParams contains all the parameters to send to the API endpoint +for the post groupings operation typically these are written to a http.Request +*/ +type PostGroupingsParams struct { + + /*Grouping*/ + Grouping *models.Grouping + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post groupings params +func (o *PostGroupingsParams) WithTimeout(timeout time.Duration) *PostGroupingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post groupings params +func (o *PostGroupingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post groupings params +func (o *PostGroupingsParams) WithContext(ctx context.Context) *PostGroupingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post groupings params +func (o *PostGroupingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post groupings params +func (o *PostGroupingsParams) WithHTTPClient(client *http.Client) *PostGroupingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post groupings params +func (o *PostGroupingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGrouping adds the grouping to the post groupings params +func (o *PostGroupingsParams) WithGrouping(grouping *models.Grouping) *PostGroupingsParams { + o.SetGrouping(grouping) + return o +} + +// SetGrouping adds the grouping to the post groupings params +func (o *PostGroupingsParams) SetGrouping(grouping *models.Grouping) { + o.Grouping = grouping +} + +// WriteToRequest writes these params to a swagger request +func (o *PostGroupingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Grouping != nil { + if err := r.SetBodyParam(o.Grouping); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/groupings/post_groupings_responses.go b/client/groupings/post_groupings_responses.go new file mode 100644 index 0000000..ab5285f --- /dev/null +++ b/client/groupings/post_groupings_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostGroupingsReader is a Reader for the PostGroupings structure. +type PostGroupingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostGroupingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostGroupingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostGroupingsOK creates a PostGroupingsOK with default headers values +func NewPostGroupingsOK() *PostGroupingsOK { + return &PostGroupingsOK{} +} + +/*PostGroupingsOK handles this case with default header values. + +Success +*/ +type PostGroupingsOK struct { + Payload *models.Grouping +} + +func (o *PostGroupingsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/Groupings][%d] postGroupingsOK %+v", 200, o.Payload) +} + +func (o *PostGroupingsOK) GetPayload() *models.Grouping { + return o.Payload +} + +func (o *PostGroupingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Grouping) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/groupings/put_groupings_parameters.go b/client/groupings/put_groupings_parameters.go new file mode 100644 index 0000000..540ea80 --- /dev/null +++ b/client/groupings/put_groupings_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutGroupingsParams creates a new PutGroupingsParams object +// with the default values initialized. +func NewPutGroupingsParams() *PutGroupingsParams { + var () + return &PutGroupingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutGroupingsParamsWithTimeout creates a new PutGroupingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutGroupingsParamsWithTimeout(timeout time.Duration) *PutGroupingsParams { + var () + return &PutGroupingsParams{ + + timeout: timeout, + } +} + +// NewPutGroupingsParamsWithContext creates a new PutGroupingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutGroupingsParamsWithContext(ctx context.Context) *PutGroupingsParams { + var () + return &PutGroupingsParams{ + + Context: ctx, + } +} + +// NewPutGroupingsParamsWithHTTPClient creates a new PutGroupingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutGroupingsParamsWithHTTPClient(client *http.Client) *PutGroupingsParams { + var () + return &PutGroupingsParams{ + HTTPClient: client, + } +} + +/*PutGroupingsParams contains all the parameters to send to the API endpoint +for the put groupings operation typically these are written to a http.Request +*/ +type PutGroupingsParams struct { + + /*Grouping*/ + Grouping *models.Grouping + /*ID*/ + ID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put groupings params +func (o *PutGroupingsParams) WithTimeout(timeout time.Duration) *PutGroupingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put groupings params +func (o *PutGroupingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put groupings params +func (o *PutGroupingsParams) WithContext(ctx context.Context) *PutGroupingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put groupings params +func (o *PutGroupingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put groupings params +func (o *PutGroupingsParams) WithHTTPClient(client *http.Client) *PutGroupingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put groupings params +func (o *PutGroupingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGrouping adds the grouping to the put groupings params +func (o *PutGroupingsParams) WithGrouping(grouping *models.Grouping) *PutGroupingsParams { + o.SetGrouping(grouping) + return o +} + +// SetGrouping adds the grouping to the put groupings params +func (o *PutGroupingsParams) SetGrouping(grouping *models.Grouping) { + o.Grouping = grouping +} + +// WithID adds the id to the put groupings params +func (o *PutGroupingsParams) WithID(id int32) *PutGroupingsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put groupings params +func (o *PutGroupingsParams) SetID(id int32) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *PutGroupingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Grouping != nil { + if err := r.SetBodyParam(o.Grouping); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/groupings/put_groupings_responses.go b/client/groupings/put_groupings_responses.go new file mode 100644 index 0000000..f004594 --- /dev/null +++ b/client/groupings/put_groupings_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package groupings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutGroupingsReader is a Reader for the PutGroupings structure. +type PutGroupingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutGroupingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutGroupingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutGroupingsOK creates a PutGroupingsOK with default headers values +func NewPutGroupingsOK() *PutGroupingsOK { + return &PutGroupingsOK{} +} + +/*PutGroupingsOK handles this case with default header values. + +Success +*/ +type PutGroupingsOK struct { + Payload *models.Grouping +} + +func (o *PutGroupingsOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/Groupings/{id}][%d] putGroupingsOK %+v", 200, o.Payload) +} + +func (o *PutGroupingsOK) GetPayload() *models.Grouping { + return o.Payload +} + +func (o *PutGroupingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Grouping) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/invoice_profiles/delete_invoice_profiles_parameters.go b/client/invoice_profiles/delete_invoice_profiles_parameters.go new file mode 100644 index 0000000..f4c99c2 --- /dev/null +++ b/client/invoice_profiles/delete_invoice_profiles_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// 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" +) + +// NewDeleteInvoiceProfilesParams creates a new DeleteInvoiceProfilesParams object +// with the default values initialized. +func NewDeleteInvoiceProfilesParams() *DeleteInvoiceProfilesParams { + var () + return &DeleteInvoiceProfilesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteInvoiceProfilesParamsWithTimeout creates a new DeleteInvoiceProfilesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteInvoiceProfilesParamsWithTimeout(timeout time.Duration) *DeleteInvoiceProfilesParams { + var () + return &DeleteInvoiceProfilesParams{ + + timeout: timeout, + } +} + +// NewDeleteInvoiceProfilesParamsWithContext creates a new DeleteInvoiceProfilesParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteInvoiceProfilesParamsWithContext(ctx context.Context) *DeleteInvoiceProfilesParams { + var () + return &DeleteInvoiceProfilesParams{ + + Context: ctx, + } +} + +// NewDeleteInvoiceProfilesParamsWithHTTPClient creates a new DeleteInvoiceProfilesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteInvoiceProfilesParamsWithHTTPClient(client *http.Client) *DeleteInvoiceProfilesParams { + var () + return &DeleteInvoiceProfilesParams{ + HTTPClient: client, + } +} + +/*DeleteInvoiceProfilesParams contains all the parameters to send to the API endpoint +for the delete invoice profiles operation typically these are written to a http.Request +*/ +type DeleteInvoiceProfilesParams struct { + + /*ID*/ + ID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) WithTimeout(timeout time.Duration) *DeleteInvoiceProfilesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) WithContext(ctx context.Context) *DeleteInvoiceProfilesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) WithHTTPClient(client *http.Client) *DeleteInvoiceProfilesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) WithID(id int32) *DeleteInvoiceProfilesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete invoice profiles params +func (o *DeleteInvoiceProfilesParams) SetID(id int32) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteInvoiceProfilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/invoice_profiles/delete_invoice_profiles_responses.go b/client/invoice_profiles/delete_invoice_profiles_responses.go new file mode 100644 index 0000000..d7f7cbe --- /dev/null +++ b/client/invoice_profiles/delete_invoice_profiles_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteInvoiceProfilesReader is a Reader for the DeleteInvoiceProfiles structure. +type DeleteInvoiceProfilesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteInvoiceProfilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteInvoiceProfilesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteInvoiceProfilesOK creates a DeleteInvoiceProfilesOK with default headers values +func NewDeleteInvoiceProfilesOK() *DeleteInvoiceProfilesOK { + return &DeleteInvoiceProfilesOK{} +} + +/*DeleteInvoiceProfilesOK handles this case with default header values. + +Success +*/ +type DeleteInvoiceProfilesOK struct { + Payload bool +} + +func (o *DeleteInvoiceProfilesOK) Error() string { + return fmt.Sprintf("[DELETE /api/v1/InvoiceProfiles/{id}][%d] deleteInvoiceProfilesOK %+v", 200, o.Payload) +} + +func (o *DeleteInvoiceProfilesOK) GetPayload() bool { + return o.Payload +} + +func (o *DeleteInvoiceProfilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/invoice_profiles/get_invoice_profiles_parameters.go b/client/invoice_profiles/get_invoice_profiles_parameters.go new file mode 100644 index 0000000..e3a2ba7 --- /dev/null +++ b/client/invoice_profiles/get_invoice_profiles_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// 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" +) + +// NewGetInvoiceProfilesParams creates a new GetInvoiceProfilesParams object +// with the default values initialized. +func NewGetInvoiceProfilesParams() *GetInvoiceProfilesParams { + var () + return &GetInvoiceProfilesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetInvoiceProfilesParamsWithTimeout creates a new GetInvoiceProfilesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetInvoiceProfilesParamsWithTimeout(timeout time.Duration) *GetInvoiceProfilesParams { + var () + return &GetInvoiceProfilesParams{ + + timeout: timeout, + } +} + +// NewGetInvoiceProfilesParamsWithContext creates a new GetInvoiceProfilesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetInvoiceProfilesParamsWithContext(ctx context.Context) *GetInvoiceProfilesParams { + var () + return &GetInvoiceProfilesParams{ + + Context: ctx, + } +} + +// NewGetInvoiceProfilesParamsWithHTTPClient creates a new GetInvoiceProfilesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetInvoiceProfilesParamsWithHTTPClient(client *http.Client) *GetInvoiceProfilesParams { + var () + return &GetInvoiceProfilesParams{ + HTTPClient: client, + } +} + +/*GetInvoiceProfilesParams contains all the parameters to send to the API endpoint +for the get invoice profiles operation typically these are written to a http.Request +*/ +type GetInvoiceProfilesParams struct { + + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithTimeout(timeout time.Duration) *GetInvoiceProfilesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithContext(ctx context.Context) *GetInvoiceProfilesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithHTTPClient(client *http.Client) *GetInvoiceProfilesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrganizationID adds the organizationID to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithOrganizationID(organizationID *int32) *GetInvoiceProfilesParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithPage(page *int32) *GetInvoiceProfilesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithPageSize(pageSize *int32) *GetInvoiceProfilesParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithSearch adds the search to the get invoice profiles params +func (o *GetInvoiceProfilesParams) WithSearch(search *string) *GetInvoiceProfilesParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get invoice profiles params +func (o *GetInvoiceProfilesParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInvoiceProfilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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 +} diff --git a/client/invoice_profiles/get_invoice_profiles_responses.go b/client/invoice_profiles/get_invoice_profiles_responses.go new file mode 100644 index 0000000..487bf71 --- /dev/null +++ b/client/invoice_profiles/get_invoice_profiles_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetInvoiceProfilesReader is a Reader for the GetInvoiceProfiles structure. +type GetInvoiceProfilesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInvoiceProfilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInvoiceProfilesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetInvoiceProfilesOK creates a GetInvoiceProfilesOK with default headers values +func NewGetInvoiceProfilesOK() *GetInvoiceProfilesOK { + return &GetInvoiceProfilesOK{} +} + +/*GetInvoiceProfilesOK handles this case with default header values. + +Success +*/ +type GetInvoiceProfilesOK struct { + Payload *models.APICollectionOfInvoiceProfile +} + +func (o *GetInvoiceProfilesOK) Error() string { + return fmt.Sprintf("[GET /api/v1/InvoiceProfiles][%d] getInvoiceProfilesOK %+v", 200, o.Payload) +} + +func (o *GetInvoiceProfilesOK) GetPayload() *models.APICollectionOfInvoiceProfile { + return o.Payload +} + +func (o *GetInvoiceProfilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfInvoiceProfile) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/invoice_profiles/invoice_profiles_client.go b/client/invoice_profiles/invoice_profiles_client.go new file mode 100644 index 0000000..01320d5 --- /dev/null +++ b/client/invoice_profiles/invoice_profiles_client.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new invoice profiles API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoice profiles API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteInvoiceProfiles(params *DeleteInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteInvoiceProfilesOK, error) + + GetInvoiceProfiles(params *GetInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoiceProfilesOK, error) + + PostInvoiceProfiles(params *PostInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*PostInvoiceProfilesOK, error) + + PutInvoiceProfiles(params *PutInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*PutInvoiceProfilesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteInvoiceProfiles delete invoice profiles API +*/ +func (a *Client) DeleteInvoiceProfiles(params *DeleteInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteInvoiceProfilesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteInvoiceProfilesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteInvoiceProfiles", + Method: "DELETE", + PathPattern: "/api/v1/InvoiceProfiles/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteInvoiceProfilesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteInvoiceProfilesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteInvoiceProfiles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetInvoiceProfiles get invoice profiles API +*/ +func (a *Client) GetInvoiceProfiles(params *GetInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoiceProfilesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInvoiceProfilesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetInvoiceProfiles", + Method: "GET", + PathPattern: "/api/v1/InvoiceProfiles", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetInvoiceProfilesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetInvoiceProfilesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetInvoiceProfiles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostInvoiceProfiles post invoice profiles API +*/ +func (a *Client) PostInvoiceProfiles(params *PostInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*PostInvoiceProfilesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostInvoiceProfilesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostInvoiceProfiles", + Method: "POST", + PathPattern: "/api/v1/InvoiceProfiles", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostInvoiceProfilesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostInvoiceProfilesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostInvoiceProfiles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutInvoiceProfiles put invoice profiles API +*/ +func (a *Client) PutInvoiceProfiles(params *PutInvoiceProfilesParams, authInfo runtime.ClientAuthInfoWriter) (*PutInvoiceProfilesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutInvoiceProfilesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutInvoiceProfiles", + Method: "PUT", + PathPattern: "/api/v1/InvoiceProfiles/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutInvoiceProfilesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutInvoiceProfilesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutInvoiceProfiles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/invoice_profiles/post_invoice_profiles_parameters.go b/client/invoice_profiles/post_invoice_profiles_parameters.go new file mode 100644 index 0000000..57b40cc --- /dev/null +++ b/client/invoice_profiles/post_invoice_profiles_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostInvoiceProfilesParams creates a new PostInvoiceProfilesParams object +// with the default values initialized. +func NewPostInvoiceProfilesParams() *PostInvoiceProfilesParams { + var () + return &PostInvoiceProfilesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostInvoiceProfilesParamsWithTimeout creates a new PostInvoiceProfilesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostInvoiceProfilesParamsWithTimeout(timeout time.Duration) *PostInvoiceProfilesParams { + var () + return &PostInvoiceProfilesParams{ + + timeout: timeout, + } +} + +// NewPostInvoiceProfilesParamsWithContext creates a new PostInvoiceProfilesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostInvoiceProfilesParamsWithContext(ctx context.Context) *PostInvoiceProfilesParams { + var () + return &PostInvoiceProfilesParams{ + + Context: ctx, + } +} + +// NewPostInvoiceProfilesParamsWithHTTPClient creates a new PostInvoiceProfilesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostInvoiceProfilesParamsWithHTTPClient(client *http.Client) *PostInvoiceProfilesParams { + var () + return &PostInvoiceProfilesParams{ + HTTPClient: client, + } +} + +/*PostInvoiceProfilesParams contains all the parameters to send to the API endpoint +for the post invoice profiles operation typically these are written to a http.Request +*/ +type PostInvoiceProfilesParams struct { + + /*InvoiceProfile*/ + InvoiceProfile *models.InvoiceProfile + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post invoice profiles params +func (o *PostInvoiceProfilesParams) WithTimeout(timeout time.Duration) *PostInvoiceProfilesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post invoice profiles params +func (o *PostInvoiceProfilesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post invoice profiles params +func (o *PostInvoiceProfilesParams) WithContext(ctx context.Context) *PostInvoiceProfilesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post invoice profiles params +func (o *PostInvoiceProfilesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post invoice profiles params +func (o *PostInvoiceProfilesParams) WithHTTPClient(client *http.Client) *PostInvoiceProfilesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post invoice profiles params +func (o *PostInvoiceProfilesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceProfile adds the invoiceProfile to the post invoice profiles params +func (o *PostInvoiceProfilesParams) WithInvoiceProfile(invoiceProfile *models.InvoiceProfile) *PostInvoiceProfilesParams { + o.SetInvoiceProfile(invoiceProfile) + return o +} + +// SetInvoiceProfile adds the invoiceProfile to the post invoice profiles params +func (o *PostInvoiceProfilesParams) SetInvoiceProfile(invoiceProfile *models.InvoiceProfile) { + o.InvoiceProfile = invoiceProfile +} + +// WriteToRequest writes these params to a swagger request +func (o *PostInvoiceProfilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceProfile != nil { + if err := r.SetBodyParam(o.InvoiceProfile); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/invoice_profiles/post_invoice_profiles_responses.go b/client/invoice_profiles/post_invoice_profiles_responses.go new file mode 100644 index 0000000..3b85bc9 --- /dev/null +++ b/client/invoice_profiles/post_invoice_profiles_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostInvoiceProfilesReader is a Reader for the PostInvoiceProfiles structure. +type PostInvoiceProfilesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostInvoiceProfilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostInvoiceProfilesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostInvoiceProfilesOK creates a PostInvoiceProfilesOK with default headers values +func NewPostInvoiceProfilesOK() *PostInvoiceProfilesOK { + return &PostInvoiceProfilesOK{} +} + +/*PostInvoiceProfilesOK handles this case with default header values. + +Success +*/ +type PostInvoiceProfilesOK struct { + Payload *models.InvoiceProfile +} + +func (o *PostInvoiceProfilesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/InvoiceProfiles][%d] postInvoiceProfilesOK %+v", 200, o.Payload) +} + +func (o *PostInvoiceProfilesOK) GetPayload() *models.InvoiceProfile { + return o.Payload +} + +func (o *PostInvoiceProfilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InvoiceProfile) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/invoice_profiles/put_invoice_profiles_parameters.go b/client/invoice_profiles/put_invoice_profiles_parameters.go new file mode 100644 index 0000000..cb2dfa8 --- /dev/null +++ b/client/invoice_profiles/put_invoice_profiles_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutInvoiceProfilesParams creates a new PutInvoiceProfilesParams object +// with the default values initialized. +func NewPutInvoiceProfilesParams() *PutInvoiceProfilesParams { + var () + return &PutInvoiceProfilesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutInvoiceProfilesParamsWithTimeout creates a new PutInvoiceProfilesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutInvoiceProfilesParamsWithTimeout(timeout time.Duration) *PutInvoiceProfilesParams { + var () + return &PutInvoiceProfilesParams{ + + timeout: timeout, + } +} + +// NewPutInvoiceProfilesParamsWithContext creates a new PutInvoiceProfilesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutInvoiceProfilesParamsWithContext(ctx context.Context) *PutInvoiceProfilesParams { + var () + return &PutInvoiceProfilesParams{ + + Context: ctx, + } +} + +// NewPutInvoiceProfilesParamsWithHTTPClient creates a new PutInvoiceProfilesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutInvoiceProfilesParamsWithHTTPClient(client *http.Client) *PutInvoiceProfilesParams { + var () + return &PutInvoiceProfilesParams{ + HTTPClient: client, + } +} + +/*PutInvoiceProfilesParams contains all the parameters to send to the API endpoint +for the put invoice profiles operation typically these are written to a http.Request +*/ +type PutInvoiceProfilesParams struct { + + /*ID*/ + ID int32 + /*InvoiceProfile*/ + InvoiceProfile *models.InvoiceProfile + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put invoice profiles params +func (o *PutInvoiceProfilesParams) WithTimeout(timeout time.Duration) *PutInvoiceProfilesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put invoice profiles params +func (o *PutInvoiceProfilesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put invoice profiles params +func (o *PutInvoiceProfilesParams) WithContext(ctx context.Context) *PutInvoiceProfilesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put invoice profiles params +func (o *PutInvoiceProfilesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put invoice profiles params +func (o *PutInvoiceProfilesParams) WithHTTPClient(client *http.Client) *PutInvoiceProfilesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put invoice profiles params +func (o *PutInvoiceProfilesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the put invoice profiles params +func (o *PutInvoiceProfilesParams) WithID(id int32) *PutInvoiceProfilesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put invoice profiles params +func (o *PutInvoiceProfilesParams) SetID(id int32) { + o.ID = id +} + +// WithInvoiceProfile adds the invoiceProfile to the put invoice profiles params +func (o *PutInvoiceProfilesParams) WithInvoiceProfile(invoiceProfile *models.InvoiceProfile) *PutInvoiceProfilesParams { + o.SetInvoiceProfile(invoiceProfile) + return o +} + +// SetInvoiceProfile adds the invoiceProfile to the put invoice profiles params +func (o *PutInvoiceProfilesParams) SetInvoiceProfile(invoiceProfile *models.InvoiceProfile) { + o.InvoiceProfile = invoiceProfile +} + +// WriteToRequest writes these params to a swagger request +func (o *PutInvoiceProfilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if o.InvoiceProfile != nil { + if err := r.SetBodyParam(o.InvoiceProfile); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/invoice_profiles/put_invoice_profiles_responses.go b/client/invoice_profiles/put_invoice_profiles_responses.go new file mode 100644 index 0000000..d5fc684 --- /dev/null +++ b/client/invoice_profiles/put_invoice_profiles_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package invoice_profiles + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutInvoiceProfilesReader is a Reader for the PutInvoiceProfiles structure. +type PutInvoiceProfilesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutInvoiceProfilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutInvoiceProfilesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutInvoiceProfilesOK creates a PutInvoiceProfilesOK with default headers values +func NewPutInvoiceProfilesOK() *PutInvoiceProfilesOK { + return &PutInvoiceProfilesOK{} +} + +/*PutInvoiceProfilesOK handles this case with default header values. + +Success +*/ +type PutInvoiceProfilesOK struct { + Payload *models.InvoiceProfile +} + +func (o *PutInvoiceProfilesOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/InvoiceProfiles/{id}][%d] putInvoiceProfilesOK %+v", 200, o.Payload) +} + +func (o *PutInvoiceProfilesOK) GetPayload() *models.InvoiceProfile { + return o.Payload +} + +func (o *PutInvoiceProfilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InvoiceProfile) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/management_links/get_management_links_parameters.go b/client/management_links/get_management_links_parameters.go new file mode 100644 index 0000000..52d9b82 --- /dev/null +++ b/client/management_links/get_management_links_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package management_links + +// 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" +) + +// NewGetManagementLinksParams creates a new GetManagementLinksParams object +// with the default values initialized. +func NewGetManagementLinksParams() *GetManagementLinksParams { + var () + return &GetManagementLinksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetManagementLinksParamsWithTimeout creates a new GetManagementLinksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetManagementLinksParamsWithTimeout(timeout time.Duration) *GetManagementLinksParams { + var () + return &GetManagementLinksParams{ + + timeout: timeout, + } +} + +// NewGetManagementLinksParamsWithContext creates a new GetManagementLinksParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetManagementLinksParamsWithContext(ctx context.Context) *GetManagementLinksParams { + var () + return &GetManagementLinksParams{ + + Context: ctx, + } +} + +// NewGetManagementLinksParamsWithHTTPClient creates a new GetManagementLinksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetManagementLinksParamsWithHTTPClient(client *http.Client) *GetManagementLinksParams { + var () + return &GetManagementLinksParams{ + HTTPClient: client, + } +} + +/*GetManagementLinksParams contains all the parameters to send to the API endpoint +for the get management links operation typically these are written to a http.Request +*/ +type GetManagementLinksParams struct { + + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*ResellerCustomerIds*/ + ResellerCustomerIds []int32 + /*SubscriptionIds*/ + SubscriptionIds []int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get management links params +func (o *GetManagementLinksParams) WithTimeout(timeout time.Duration) *GetManagementLinksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get management links params +func (o *GetManagementLinksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get management links params +func (o *GetManagementLinksParams) WithContext(ctx context.Context) *GetManagementLinksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get management links params +func (o *GetManagementLinksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get management links params +func (o *GetManagementLinksParams) WithHTTPClient(client *http.Client) *GetManagementLinksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get management links params +func (o *GetManagementLinksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the get management links params +func (o *GetManagementLinksParams) WithPage(page *int32) *GetManagementLinksParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get management links params +func (o *GetManagementLinksParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get management links params +func (o *GetManagementLinksParams) WithPageSize(pageSize *int32) *GetManagementLinksParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get management links params +func (o *GetManagementLinksParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithResellerCustomerIds adds the resellerCustomerIds to the get management links params +func (o *GetManagementLinksParams) WithResellerCustomerIds(resellerCustomerIds []int32) *GetManagementLinksParams { + o.SetResellerCustomerIds(resellerCustomerIds) + return o +} + +// SetResellerCustomerIds adds the resellerCustomerIds to the get management links params +func (o *GetManagementLinksParams) SetResellerCustomerIds(resellerCustomerIds []int32) { + o.ResellerCustomerIds = resellerCustomerIds +} + +// WithSubscriptionIds adds the subscriptionIds to the get management links params +func (o *GetManagementLinksParams) WithSubscriptionIds(subscriptionIds []int32) *GetManagementLinksParams { + o.SetSubscriptionIds(subscriptionIds) + return o +} + +// SetSubscriptionIds adds the subscriptionIds to the get management links params +func (o *GetManagementLinksParams) SetSubscriptionIds(subscriptionIds []int32) { + o.SubscriptionIds = subscriptionIds +} + +// WriteToRequest writes these params to a swagger request +func (o *GetManagementLinksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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 + } + } + + } + + var valuesResellerCustomerIds []string + for _, v := range o.ResellerCustomerIds { + valuesResellerCustomerIds = append(valuesResellerCustomerIds, swag.FormatInt32(v)) + } + + joinedResellerCustomerIds := swag.JoinByFormat(valuesResellerCustomerIds, "multi") + // query array param ResellerCustomerIds + if err := r.SetQueryParam("ResellerCustomerIds", joinedResellerCustomerIds...); err != nil { + return err + } + + var valuesSubscriptionIds []string + for _, v := range o.SubscriptionIds { + valuesSubscriptionIds = append(valuesSubscriptionIds, swag.FormatInt32(v)) + } + + joinedSubscriptionIds := swag.JoinByFormat(valuesSubscriptionIds, "multi") + // query array param SubscriptionIds + if err := r.SetQueryParam("SubscriptionIds", joinedSubscriptionIds...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/management_links/get_management_links_responses.go b/client/management_links/get_management_links_responses.go new file mode 100644 index 0000000..b31c095 --- /dev/null +++ b/client/management_links/get_management_links_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package management_links + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetManagementLinksReader is a Reader for the GetManagementLinks structure. +type GetManagementLinksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetManagementLinksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetManagementLinksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetManagementLinksOK creates a GetManagementLinksOK with default headers values +func NewGetManagementLinksOK() *GetManagementLinksOK { + return &GetManagementLinksOK{} +} + +/*GetManagementLinksOK handles this case with default header values. + +Success +*/ +type GetManagementLinksOK struct { + Payload *models.APICollectionOfManagementLink +} + +func (o *GetManagementLinksOK) Error() string { + return fmt.Sprintf("[GET /api/v1/ManagementLinks][%d] getManagementLinksOK %+v", 200, o.Payload) +} + +func (o *GetManagementLinksOK) GetPayload() *models.APICollectionOfManagementLink { + return o.Payload +} + +func (o *GetManagementLinksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfManagementLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/management_links/management_links_client.go b/client/management_links/management_links_client.go index 31323a2..830b3c4 100644 --- a/client/management_links/management_links_client.go +++ b/client/management_links/management_links_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { GetGrouped(params *GetGroupedParams, authInfo runtime.ClientAuthInfoWriter) (*GetGroupedOK, error) + GetManagementLinks(params *GetManagementLinksParams, authInfo runtime.ClientAuthInfoWriter) (*GetManagementLinksOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -67,6 +69,41 @@ func (a *Client) GetGrouped(params *GetGroupedParams, authInfo runtime.ClientAut panic(msg) } +/* + GetManagementLinks get management links API +*/ +func (a *Client) GetManagementLinks(params *GetManagementLinksParams, authInfo runtime.ClientAuthInfoWriter) (*GetManagementLinksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetManagementLinksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetManagementLinks", + Method: "GET", + PathPattern: "/api/v1/ManagementLinks", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetManagementLinksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetManagementLinksOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetManagementLinks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/me/get_me_parameters.go b/client/me/get_me_parameters.go new file mode 100644 index 0000000..c4dc2ae --- /dev/null +++ b/client/me/get_me_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package me + +// 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" +) + +// NewGetMeParams creates a new GetMeParams object +// with the default values initialized. +func NewGetMeParams() *GetMeParams { + + return &GetMeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetMeParamsWithTimeout creates a new GetMeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetMeParamsWithTimeout(timeout time.Duration) *GetMeParams { + + return &GetMeParams{ + + timeout: timeout, + } +} + +// NewGetMeParamsWithContext creates a new GetMeParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetMeParamsWithContext(ctx context.Context) *GetMeParams { + + return &GetMeParams{ + + Context: ctx, + } +} + +// NewGetMeParamsWithHTTPClient creates a new GetMeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetMeParamsWithHTTPClient(client *http.Client) *GetMeParams { + + return &GetMeParams{ + HTTPClient: client, + } +} + +/*GetMeParams contains all the parameters to send to the API endpoint +for the get me operation typically these are written to a http.Request +*/ +type GetMeParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get me params +func (o *GetMeParams) WithTimeout(timeout time.Duration) *GetMeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get me params +func (o *GetMeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get me params +func (o *GetMeParams) WithContext(ctx context.Context) *GetMeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get me params +func (o *GetMeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get me params +func (o *GetMeParams) WithHTTPClient(client *http.Client) *GetMeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get me params +func (o *GetMeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/me/get_me_responses.go b/client/me/get_me_responses.go new file mode 100644 index 0000000..4ea0179 --- /dev/null +++ b/client/me/get_me_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package me + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetMeReader is a Reader for the GetMe structure. +type GetMeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetMeOK creates a GetMeOK with default headers values +func NewGetMeOK() *GetMeOK { + return &GetMeOK{} +} + +/*GetMeOK handles this case with default header values. + +Success +*/ +type GetMeOK struct { + Payload *models.Me +} + +func (o *GetMeOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Me][%d] getMeOK %+v", 200, o.Payload) +} + +func (o *GetMeOK) GetPayload() *models.Me { + return o.Payload +} + +func (o *GetMeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Me) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/me/me_client.go b/client/me/me_client.go new file mode 100644 index 0000000..18bf659 --- /dev/null +++ b/client/me/me_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package me + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new me API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for me API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter) (*GetMeOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetMe get me API +*/ +func (a *Client) GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter) (*GetMeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetMe", + Method: "GET", + PathPattern: "/api/v1/Me", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMeReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetMeOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetMe: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/organization_access/get_organization_access_responses.go b/client/organization_access/get_organization_access_responses.go index de511c6..0b99b52 100644 --- a/client/organization_access/get_organization_access_responses.go +++ b/client/organization_access/get_organization_access_responses.go @@ -49,7 +49,7 @@ type GetOrganizationAccessOK struct { } func (o *GetOrganizationAccessOK) Error() string { - return fmt.Sprintf("[GET /api/v1/OrganizationAccess][%d] getOrganizationAccessOK %+v", 200, o.Payload) + return fmt.Sprintf("[GET /api/v1/OrganizationAccess/grant][%d] getOrganizationAccessOK %+v", 200, o.Payload) } func (o *GetOrganizationAccessOK) GetPayload() *models.APICollectionOfOrganizationAccess { diff --git a/client/organization_access/organization_access_client.go b/client/organization_access/organization_access_client.go index b57d93b..a6b6671 100644 --- a/client/organization_access/organization_access_client.go +++ b/client/organization_access/organization_access_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { GetOrganizationAccess(params *GetOrganizationAccessParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrganizationAccessOK, error) + PutOrganizationAccess(params *PutOrganizationAccessParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrganizationAccessOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -44,7 +46,7 @@ func (a *Client) GetOrganizationAccess(params *GetOrganizationAccessParams, auth result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "GetOrganizationAccess", Method: "GET", - PathPattern: "/api/v1/OrganizationAccess", + PathPattern: "/api/v1/OrganizationAccess/grant", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, @@ -67,6 +69,41 @@ func (a *Client) GetOrganizationAccess(params *GetOrganizationAccessParams, auth panic(msg) } +/* + PutOrganizationAccess put organization access API +*/ +func (a *Client) PutOrganizationAccess(params *PutOrganizationAccessParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrganizationAccessOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutOrganizationAccessParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutOrganizationAccess", + Method: "PUT", + PathPattern: "/api/v1/OrganizationAccess", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutOrganizationAccessReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutOrganizationAccessOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutOrganizationAccess: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/organization_access/put_organization_access_parameters.go b/client/organization_access/put_organization_access_parameters.go new file mode 100644 index 0000000..0d35ea7 --- /dev/null +++ b/client/organization_access/put_organization_access_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organization_access + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPutOrganizationAccessParams creates a new PutOrganizationAccessParams object +// with the default values initialized. +func NewPutOrganizationAccessParams() *PutOrganizationAccessParams { + var () + return &PutOrganizationAccessParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutOrganizationAccessParamsWithTimeout creates a new PutOrganizationAccessParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutOrganizationAccessParamsWithTimeout(timeout time.Duration) *PutOrganizationAccessParams { + var () + return &PutOrganizationAccessParams{ + + timeout: timeout, + } +} + +// NewPutOrganizationAccessParamsWithContext creates a new PutOrganizationAccessParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutOrganizationAccessParamsWithContext(ctx context.Context) *PutOrganizationAccessParams { + var () + return &PutOrganizationAccessParams{ + + Context: ctx, + } +} + +// NewPutOrganizationAccessParamsWithHTTPClient creates a new PutOrganizationAccessParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutOrganizationAccessParamsWithHTTPClient(client *http.Client) *PutOrganizationAccessParams { + var () + return &PutOrganizationAccessParams{ + HTTPClient: client, + } +} + +/*PutOrganizationAccessParams contains all the parameters to send to the API endpoint +for the put organization access operation typically these are written to a http.Request +*/ +type PutOrganizationAccessParams struct { + + /*List*/ + List []*models.OrganizationAccess + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put organization access params +func (o *PutOrganizationAccessParams) WithTimeout(timeout time.Duration) *PutOrganizationAccessParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put organization access params +func (o *PutOrganizationAccessParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put organization access params +func (o *PutOrganizationAccessParams) WithContext(ctx context.Context) *PutOrganizationAccessParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put organization access params +func (o *PutOrganizationAccessParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put organization access params +func (o *PutOrganizationAccessParams) WithHTTPClient(client *http.Client) *PutOrganizationAccessParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put organization access params +func (o *PutOrganizationAccessParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithList adds the list to the put organization access params +func (o *PutOrganizationAccessParams) WithList(list []*models.OrganizationAccess) *PutOrganizationAccessParams { + o.SetList(list) + return o +} + +// SetList adds the list to the put organization access params +func (o *PutOrganizationAccessParams) SetList(list []*models.OrganizationAccess) { + o.List = list +} + +// WriteToRequest writes these params to a swagger request +func (o *PutOrganizationAccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.List != nil { + if err := r.SetBodyParam(o.List); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/organization_access/put_organization_access_responses.go b/client/organization_access/put_organization_access_responses.go new file mode 100644 index 0000000..0728dd1 --- /dev/null +++ b/client/organization_access/put_organization_access_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organization_access + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutOrganizationAccessReader is a Reader for the PutOrganizationAccess structure. +type PutOrganizationAccessReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutOrganizationAccessReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutOrganizationAccessOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutOrganizationAccessOK creates a PutOrganizationAccessOK with default headers values +func NewPutOrganizationAccessOK() *PutOrganizationAccessOK { + return &PutOrganizationAccessOK{} +} + +/*PutOrganizationAccessOK handles this case with default header values. + +Success +*/ +type PutOrganizationAccessOK struct { + Payload []*models.OrganizationAccess +} + +func (o *PutOrganizationAccessOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/OrganizationAccess][%d] putOrganizationAccessOK %+v", 200, o.Payload) +} + +func (o *PutOrganizationAccessOK) GetPayload() []*models.OrganizationAccess { + return o.Payload +} + +func (o *PutOrganizationAccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/organizations/get_organizations_parameters.go b/client/organizations/get_organizations_parameters.go new file mode 100644 index 0000000..f43d6d5 --- /dev/null +++ b/client/organizations/get_organizations_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// 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" +) + +// NewGetOrganizationsParams creates a new GetOrganizationsParams object +// with the default values initialized. +func NewGetOrganizationsParams() *GetOrganizationsParams { + var () + return &GetOrganizationsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetOrganizationsParamsWithTimeout creates a new GetOrganizationsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetOrganizationsParamsWithTimeout(timeout time.Duration) *GetOrganizationsParams { + var () + return &GetOrganizationsParams{ + + timeout: timeout, + } +} + +// NewGetOrganizationsParamsWithContext creates a new GetOrganizationsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetOrganizationsParamsWithContext(ctx context.Context) *GetOrganizationsParams { + var () + return &GetOrganizationsParams{ + + Context: ctx, + } +} + +// NewGetOrganizationsParamsWithHTTPClient creates a new GetOrganizationsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetOrganizationsParamsWithHTTPClient(client *http.Client) *GetOrganizationsParams { + var () + return &GetOrganizationsParams{ + HTTPClient: client, + } +} + +/*GetOrganizationsParams contains all the parameters to send to the API endpoint +for the get organizations operation typically these are written to a http.Request +*/ +type GetOrganizationsParams struct { + + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get organizations params +func (o *GetOrganizationsParams) WithTimeout(timeout time.Duration) *GetOrganizationsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get organizations params +func (o *GetOrganizationsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get organizations params +func (o *GetOrganizationsParams) WithContext(ctx context.Context) *GetOrganizationsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get organizations params +func (o *GetOrganizationsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get organizations params +func (o *GetOrganizationsParams) WithHTTPClient(client *http.Client) *GetOrganizationsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get organizations params +func (o *GetOrganizationsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the get organizations params +func (o *GetOrganizationsParams) WithPage(page *int32) *GetOrganizationsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get organizations params +func (o *GetOrganizationsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get organizations params +func (o *GetOrganizationsParams) WithPageSize(pageSize *int32) *GetOrganizationsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get organizations params +func (o *GetOrganizationsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithSearch adds the search to the get organizations params +func (o *GetOrganizationsParams) WithSearch(search *string) *GetOrganizationsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get organizations params +func (o *GetOrganizationsParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOrganizationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.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 +} diff --git a/client/organizations/get_organizations_responses.go b/client/organizations/get_organizations_responses.go new file mode 100644 index 0000000..871987f --- /dev/null +++ b/client/organizations/get_organizations_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetOrganizationsReader is a Reader for the GetOrganizations structure. +type GetOrganizationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrganizationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOrganizationsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetOrganizationsOK creates a GetOrganizationsOK with default headers values +func NewGetOrganizationsOK() *GetOrganizationsOK { + return &GetOrganizationsOK{} +} + +/*GetOrganizationsOK handles this case with default header values. + +Success +*/ +type GetOrganizationsOK struct { + Payload *models.APICollectionOfOrganization +} + +func (o *GetOrganizationsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Organizations][%d] getOrganizationsOK %+v", 200, o.Payload) +} + +func (o *GetOrganizationsOK) GetPayload() *models.APICollectionOfOrganization { + return o.Payload +} + +func (o *GetOrganizationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfOrganization) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/organizations/organizations_client.go b/client/organizations/organizations_client.go index 35694ed..970dd89 100644 --- a/client/organizations/organizations_client.go +++ b/client/organizations/organizations_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { GetOrganizationSalesContact(params *GetOrganizationSalesContactParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrganizationSalesContactOK, error) + GetOrganizations(params *GetOrganizationsParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrganizationsOK, error) + HasAccessAsync(params *HasAccessAsyncParams, authInfo runtime.ClientAuthInfoWriter) (*HasAccessAsyncOK, error) SetTransport(transport runtime.ClientTransport) @@ -69,6 +71,41 @@ func (a *Client) GetOrganizationSalesContact(params *GetOrganizationSalesContact panic(msg) } +/* + GetOrganizations get organizations API +*/ +func (a *Client) GetOrganizations(params *GetOrganizationsParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrganizationsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOrganizationsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetOrganizations", + Method: "GET", + PathPattern: "/api/v1/Organizations", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetOrganizationsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetOrganizationsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetOrganizations: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* HasAccessAsync has access async API */ diff --git a/client/ping/get_ping_parameters.go b/client/ping/get_ping_parameters.go new file mode 100644 index 0000000..7a9b94b --- /dev/null +++ b/client/ping/get_ping_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ping + +// 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" +) + +// NewGetPingParams creates a new GetPingParams object +// with the default values initialized. +func NewGetPingParams() *GetPingParams { + + return &GetPingParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPingParamsWithTimeout creates a new GetPingParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPingParamsWithTimeout(timeout time.Duration) *GetPingParams { + + return &GetPingParams{ + + timeout: timeout, + } +} + +// NewGetPingParamsWithContext creates a new GetPingParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPingParamsWithContext(ctx context.Context) *GetPingParams { + + return &GetPingParams{ + + Context: ctx, + } +} + +// NewGetPingParamsWithHTTPClient creates a new GetPingParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPingParamsWithHTTPClient(client *http.Client) *GetPingParams { + + return &GetPingParams{ + HTTPClient: client, + } +} + +/*GetPingParams contains all the parameters to send to the API endpoint +for the get ping operation typically these are written to a http.Request +*/ +type GetPingParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get ping params +func (o *GetPingParams) WithTimeout(timeout time.Duration) *GetPingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ping params +func (o *GetPingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ping params +func (o *GetPingParams) WithContext(ctx context.Context) *GetPingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ping params +func (o *GetPingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ping params +func (o *GetPingParams) WithHTTPClient(client *http.Client) *GetPingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ping params +func (o *GetPingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ping/get_ping_responses.go b/client/ping/get_ping_responses.go new file mode 100644 index 0000000..6b8b0cc --- /dev/null +++ b/client/ping/get_ping_responses.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ping + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetPingReader is a Reader for the GetPing structure. +type GetPingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetPingOK creates a GetPingOK with default headers values +func NewGetPingOK() *GetPingOK { + return &GetPingOK{} +} + +/*GetPingOK handles this case with default header values. + +Success +*/ +type GetPingOK struct { +} + +func (o *GetPingOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Ping][%d] getPingOK ", 200) +} + +func (o *GetPingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/ping/ping_client.go b/client/ping/ping_client.go new file mode 100644 index 0000000..a00b861 --- /dev/null +++ b/client/ping/ping_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ping + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new ping API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ping API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPing(params *GetPingParams, authInfo runtime.ClientAuthInfoWriter) (*GetPingOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPing get ping API +*/ +func (a *Client) GetPing(params *GetPingParams, authInfo runtime.ClientAuthInfoWriter) (*GetPingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPingParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetPing", + Method: "GET", + PathPattern: "/api/v1/Ping", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPingReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPingOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetPing: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/product_containers/get_product_containers_parameters.go b/client/product_containers/get_product_containers_parameters.go new file mode 100644 index 0000000..9215b06 --- /dev/null +++ b/client/product_containers/get_product_containers_parameters.go @@ -0,0 +1,579 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package product_containers + +// 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" +) + +// NewGetProductContainersParams creates a new GetProductContainersParams object +// with the default values initialized. +func NewGetProductContainersParams() *GetProductContainersParams { + var () + return &GetProductContainersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProductContainersParamsWithTimeout creates a new GetProductContainersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProductContainersParamsWithTimeout(timeout time.Duration) *GetProductContainersParams { + var () + return &GetProductContainersParams{ + + timeout: timeout, + } +} + +// NewGetProductContainersParamsWithContext creates a new GetProductContainersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProductContainersParamsWithContext(ctx context.Context) *GetProductContainersParams { + var () + return &GetProductContainersParams{ + + Context: ctx, + } +} + +// NewGetProductContainersParamsWithHTTPClient creates a new GetProductContainersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProductContainersParamsWithHTTPClient(client *http.Client) *GetProductContainersParams { + var () + return &GetProductContainersParams{ + HTTPClient: client, + } +} + +/*GetProductContainersParams contains all the parameters to send to the API endpoint +for the get product containers operation typically these are written to a http.Request +*/ +type GetProductContainersParams struct { + + /*ActiveDraft*/ + ActiveDraft *bool + /*Category*/ + Category *string + /*From*/ + From *strfmt.DateTime + /*IncludeRemoved*/ + IncludeRemoved *bool + /*IncludeSubsidiaries*/ + IncludeSubsidiaries *bool + /*Month*/ + Month *int32 + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*ProgramID*/ + ProgramID *int32 + /*Search*/ + Search *string + /*SentByUserID*/ + SentByUserID *string + /*To*/ + To *strfmt.DateTime + /*Type*/ + Type *string + /*UserID*/ + UserID *string + /*Year*/ + Year *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get product containers params +func (o *GetProductContainersParams) WithTimeout(timeout time.Duration) *GetProductContainersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get product containers params +func (o *GetProductContainersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get product containers params +func (o *GetProductContainersParams) WithContext(ctx context.Context) *GetProductContainersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get product containers params +func (o *GetProductContainersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get product containers params +func (o *GetProductContainersParams) WithHTTPClient(client *http.Client) *GetProductContainersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get product containers params +func (o *GetProductContainersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActiveDraft adds the activeDraft to the get product containers params +func (o *GetProductContainersParams) WithActiveDraft(activeDraft *bool) *GetProductContainersParams { + o.SetActiveDraft(activeDraft) + return o +} + +// SetActiveDraft adds the activeDraft to the get product containers params +func (o *GetProductContainersParams) SetActiveDraft(activeDraft *bool) { + o.ActiveDraft = activeDraft +} + +// WithCategory adds the category to the get product containers params +func (o *GetProductContainersParams) WithCategory(category *string) *GetProductContainersParams { + o.SetCategory(category) + return o +} + +// SetCategory adds the category to the get product containers params +func (o *GetProductContainersParams) SetCategory(category *string) { + o.Category = category +} + +// WithFrom adds the from to the get product containers params +func (o *GetProductContainersParams) WithFrom(from *strfmt.DateTime) *GetProductContainersParams { + o.SetFrom(from) + return o +} + +// SetFrom adds the from to the get product containers params +func (o *GetProductContainersParams) SetFrom(from *strfmt.DateTime) { + o.From = from +} + +// WithIncludeRemoved adds the includeRemoved to the get product containers params +func (o *GetProductContainersParams) WithIncludeRemoved(includeRemoved *bool) *GetProductContainersParams { + o.SetIncludeRemoved(includeRemoved) + return o +} + +// SetIncludeRemoved adds the includeRemoved to the get product containers params +func (o *GetProductContainersParams) SetIncludeRemoved(includeRemoved *bool) { + o.IncludeRemoved = includeRemoved +} + +// WithIncludeSubsidiaries adds the includeSubsidiaries to the get product containers params +func (o *GetProductContainersParams) WithIncludeSubsidiaries(includeSubsidiaries *bool) *GetProductContainersParams { + o.SetIncludeSubsidiaries(includeSubsidiaries) + return o +} + +// SetIncludeSubsidiaries adds the includeSubsidiaries to the get product containers params +func (o *GetProductContainersParams) SetIncludeSubsidiaries(includeSubsidiaries *bool) { + o.IncludeSubsidiaries = includeSubsidiaries +} + +// WithMonth adds the month to the get product containers params +func (o *GetProductContainersParams) WithMonth(month *int32) *GetProductContainersParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get product containers params +func (o *GetProductContainersParams) SetMonth(month *int32) { + o.Month = month +} + +// WithOrganizationID adds the organizationID to the get product containers params +func (o *GetProductContainersParams) WithOrganizationID(organizationID *int32) *GetProductContainersParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get product containers params +func (o *GetProductContainersParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get product containers params +func (o *GetProductContainersParams) WithPage(page *int32) *GetProductContainersParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get product containers params +func (o *GetProductContainersParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get product containers params +func (o *GetProductContainersParams) WithPageSize(pageSize *int32) *GetProductContainersParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get product containers params +func (o *GetProductContainersParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithProgramID adds the programID to the get product containers params +func (o *GetProductContainersParams) WithProgramID(programID *int32) *GetProductContainersParams { + o.SetProgramID(programID) + return o +} + +// SetProgramID adds the programId to the get product containers params +func (o *GetProductContainersParams) SetProgramID(programID *int32) { + o.ProgramID = programID +} + +// WithSearch adds the search to the get product containers params +func (o *GetProductContainersParams) WithSearch(search *string) *GetProductContainersParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get product containers params +func (o *GetProductContainersParams) SetSearch(search *string) { + o.Search = search +} + +// WithSentByUserID adds the sentByUserID to the get product containers params +func (o *GetProductContainersParams) WithSentByUserID(sentByUserID *string) *GetProductContainersParams { + o.SetSentByUserID(sentByUserID) + return o +} + +// SetSentByUserID adds the sentByUserId to the get product containers params +func (o *GetProductContainersParams) SetSentByUserID(sentByUserID *string) { + o.SentByUserID = sentByUserID +} + +// WithTo adds the to to the get product containers params +func (o *GetProductContainersParams) WithTo(to *strfmt.DateTime) *GetProductContainersParams { + o.SetTo(to) + return o +} + +// SetTo adds the to to the get product containers params +func (o *GetProductContainersParams) SetTo(to *strfmt.DateTime) { + o.To = to +} + +// WithType adds the typeVar to the get product containers params +func (o *GetProductContainersParams) WithType(typeVar *string) *GetProductContainersParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get product containers params +func (o *GetProductContainersParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithUserID adds the userID to the get product containers params +func (o *GetProductContainersParams) WithUserID(userID *string) *GetProductContainersParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get product containers params +func (o *GetProductContainersParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WithYear adds the year to the get product containers params +func (o *GetProductContainersParams) WithYear(year *int32) *GetProductContainersParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get product containers params +func (o *GetProductContainersParams) SetYear(year *int32) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProductContainersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ActiveDraft != nil { + + // query param ActiveDraft + var qrActiveDraft bool + if o.ActiveDraft != nil { + qrActiveDraft = *o.ActiveDraft + } + qActiveDraft := swag.FormatBool(qrActiveDraft) + if qActiveDraft != "" { + if err := r.SetQueryParam("ActiveDraft", qActiveDraft); err != nil { + return err + } + } + + } + + if o.Category != nil { + + // query param Category + var qrCategory string + if o.Category != nil { + qrCategory = *o.Category + } + qCategory := qrCategory + if qCategory != "" { + if err := r.SetQueryParam("Category", qCategory); err != nil { + return err + } + } + + } + + if o.From != nil { + + // query param From + var qrFrom strfmt.DateTime + if o.From != nil { + qrFrom = *o.From + } + qFrom := qrFrom.String() + if qFrom != "" { + if err := r.SetQueryParam("From", qFrom); err != nil { + return err + } + } + + } + + if o.IncludeRemoved != nil { + + // query param IncludeRemoved + var qrIncludeRemoved bool + if o.IncludeRemoved != nil { + qrIncludeRemoved = *o.IncludeRemoved + } + qIncludeRemoved := swag.FormatBool(qrIncludeRemoved) + if qIncludeRemoved != "" { + if err := r.SetQueryParam("IncludeRemoved", qIncludeRemoved); err != nil { + return err + } + } + + } + + if o.IncludeSubsidiaries != nil { + + // query param IncludeSubsidiaries + var qrIncludeSubsidiaries bool + if o.IncludeSubsidiaries != nil { + qrIncludeSubsidiaries = *o.IncludeSubsidiaries + } + qIncludeSubsidiaries := swag.FormatBool(qrIncludeSubsidiaries) + if qIncludeSubsidiaries != "" { + if err := r.SetQueryParam("IncludeSubsidiaries", qIncludeSubsidiaries); err != nil { + return err + } + } + + } + + if o.Month != nil { + + // query param Month + var qrMonth int32 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt32(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("Month", qMonth); 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.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 o.SentByUserID != nil { + + // query param SentByUserId + var qrSentByUserID string + if o.SentByUserID != nil { + qrSentByUserID = *o.SentByUserID + } + qSentByUserID := qrSentByUserID + if qSentByUserID != "" { + if err := r.SetQueryParam("SentByUserId", qSentByUserID); err != nil { + return err + } + } + + } + + if o.To != nil { + + // query param To + var qrTo strfmt.DateTime + if o.To != nil { + qrTo = *o.To + } + qTo := qrTo.String() + if qTo != "" { + if err := r.SetQueryParam("To", qTo); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param Type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("Type", qType); err != nil { + return err + } + } + + } + + if o.UserID != nil { + + // query param UserId + var qrUserID string + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + if err := r.SetQueryParam("UserId", qUserID); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param Year + var qrYear int32 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt32(qrYear) + if qYear != "" { + if err := r.SetQueryParam("Year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/product_containers/get_product_containers_responses.go b/client/product_containers/get_product_containers_responses.go new file mode 100644 index 0000000..4b7ae63 --- /dev/null +++ b/client/product_containers/get_product_containers_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package product_containers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetProductContainersReader is a Reader for the GetProductContainers structure. +type GetProductContainersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProductContainersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProductContainersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetProductContainersOK creates a GetProductContainersOK with default headers values +func NewGetProductContainersOK() *GetProductContainersOK { + return &GetProductContainersOK{} +} + +/*GetProductContainersOK handles this case with default header values. + +Success +*/ +type GetProductContainersOK struct { + Payload *models.APICollectionOfProductContainer +} + +func (o *GetProductContainersOK) Error() string { + return fmt.Sprintf("[GET /api/v1/ProductContainers][%d] getProductContainersOK %+v", 200, o.Payload) +} + +func (o *GetProductContainersOK) GetPayload() *models.APICollectionOfProductContainer { + return o.Payload +} + +func (o *GetProductContainersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfProductContainer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/product_containers/product_containers_client.go b/client/product_containers/product_containers_client.go index d462d15..dbf79df 100644 --- a/client/product_containers/product_containers_client.go +++ b/client/product_containers/product_containers_client.go @@ -35,8 +35,12 @@ type ClientService interface { GetOrCreateShoppingCart(params *GetOrCreateShoppingCartParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrCreateShoppingCartOK, error) + GetProductContainers(params *GetProductContainersParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductContainersOK, error) + PatchProductRow(params *PatchProductRowParams, authInfo runtime.ClientAuthInfoWriter) (*PatchProductRowOK, error) + PutProductContainers(params *PutProductContainersParams, authInfo runtime.ClientAuthInfoWriter) (*PutProductContainersOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -180,6 +184,41 @@ func (a *Client) GetOrCreateShoppingCart(params *GetOrCreateShoppingCartParams, panic(msg) } +/* + GetProductContainers get product containers API +*/ +func (a *Client) GetProductContainers(params *GetProductContainersParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductContainersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProductContainersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetProductContainers", + Method: "GET", + PathPattern: "/api/v1/ProductContainers", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetProductContainersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProductContainersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetProductContainers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PatchProductRow patch product row API */ @@ -215,6 +254,41 @@ func (a *Client) PatchProductRow(params *PatchProductRowParams, authInfo runtime panic(msg) } +/* + PutProductContainers put product containers API +*/ +func (a *Client) PutProductContainers(params *PutProductContainersParams, authInfo runtime.ClientAuthInfoWriter) (*PutProductContainersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutProductContainersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutProductContainers", + Method: "PUT", + PathPattern: "/api/v1/ProductContainers/{id}", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutProductContainersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutProductContainersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PutProductContainers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/product_containers/put_product_containers_parameters.go b/client/product_containers/put_product_containers_parameters.go new file mode 100644 index 0000000..b93d308 --- /dev/null +++ b/client/product_containers/put_product_containers_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package product_containers + +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutProductContainersParams creates a new PutProductContainersParams object +// with the default values initialized. +func NewPutProductContainersParams() *PutProductContainersParams { + var ( + requireEulaAnalysisDefault = bool(false) + ) + return &PutProductContainersParams{ + RequireEulaAnalysis: &requireEulaAnalysisDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewPutProductContainersParamsWithTimeout creates a new PutProductContainersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutProductContainersParamsWithTimeout(timeout time.Duration) *PutProductContainersParams { + var ( + requireEulaAnalysisDefault = bool(false) + ) + return &PutProductContainersParams{ + RequireEulaAnalysis: &requireEulaAnalysisDefault, + + timeout: timeout, + } +} + +// NewPutProductContainersParamsWithContext creates a new PutProductContainersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutProductContainersParamsWithContext(ctx context.Context) *PutProductContainersParams { + var ( + requireEulaAnalysisDefault = bool(false) + ) + return &PutProductContainersParams{ + RequireEulaAnalysis: &requireEulaAnalysisDefault, + + Context: ctx, + } +} + +// NewPutProductContainersParamsWithHTTPClient creates a new PutProductContainersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutProductContainersParamsWithHTTPClient(client *http.Client) *PutProductContainersParams { + var ( + requireEulaAnalysisDefault = bool(false) + ) + return &PutProductContainersParams{ + RequireEulaAnalysis: &requireEulaAnalysisDefault, + HTTPClient: client, + } +} + +/*PutProductContainersParams contains all the parameters to send to the API endpoint +for the put product containers operation typically these are written to a http.Request +*/ +type PutProductContainersParams struct { + + /*ID*/ + ID int32 + /*ProductContainer*/ + ProductContainer *models.ProductContainer + /*RequireEulaAnalysis*/ + RequireEulaAnalysis *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put product containers params +func (o *PutProductContainersParams) WithTimeout(timeout time.Duration) *PutProductContainersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put product containers params +func (o *PutProductContainersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put product containers params +func (o *PutProductContainersParams) WithContext(ctx context.Context) *PutProductContainersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put product containers params +func (o *PutProductContainersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put product containers params +func (o *PutProductContainersParams) WithHTTPClient(client *http.Client) *PutProductContainersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put product containers params +func (o *PutProductContainersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the put product containers params +func (o *PutProductContainersParams) WithID(id int32) *PutProductContainersParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put product containers params +func (o *PutProductContainersParams) SetID(id int32) { + o.ID = id +} + +// WithProductContainer adds the productContainer to the put product containers params +func (o *PutProductContainersParams) WithProductContainer(productContainer *models.ProductContainer) *PutProductContainersParams { + o.SetProductContainer(productContainer) + return o +} + +// SetProductContainer adds the productContainer to the put product containers params +func (o *PutProductContainersParams) SetProductContainer(productContainer *models.ProductContainer) { + o.ProductContainer = productContainer +} + +// WithRequireEulaAnalysis adds the requireEulaAnalysis to the put product containers params +func (o *PutProductContainersParams) WithRequireEulaAnalysis(requireEulaAnalysis *bool) *PutProductContainersParams { + o.SetRequireEulaAnalysis(requireEulaAnalysis) + return o +} + +// SetRequireEulaAnalysis adds the requireEulaAnalysis to the put product containers params +func (o *PutProductContainersParams) SetRequireEulaAnalysis(requireEulaAnalysis *bool) { + o.RequireEulaAnalysis = requireEulaAnalysis +} + +// WriteToRequest writes these params to a swagger request +func (o *PutProductContainersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if o.ProductContainer != nil { + if err := r.SetBodyParam(o.ProductContainer); err != nil { + return err + } + } + + if o.RequireEulaAnalysis != nil { + + // query param requireEulaAnalysis + var qrRequireEulaAnalysis bool + if o.RequireEulaAnalysis != nil { + qrRequireEulaAnalysis = *o.RequireEulaAnalysis + } + qRequireEulaAnalysis := swag.FormatBool(qrRequireEulaAnalysis) + if qRequireEulaAnalysis != "" { + if err := r.SetQueryParam("requireEulaAnalysis", qRequireEulaAnalysis); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/product_containers/put_product_containers_responses.go b/client/product_containers/put_product_containers_responses.go new file mode 100644 index 0000000..7d06114 --- /dev/null +++ b/client/product_containers/put_product_containers_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package product_containers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutProductContainersReader is a Reader for the PutProductContainers structure. +type PutProductContainersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutProductContainersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutProductContainersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutProductContainersOK creates a PutProductContainersOK with default headers values +func NewPutProductContainersOK() *PutProductContainersOK { + return &PutProductContainersOK{} +} + +/*PutProductContainersOK handles this case with default header values. + +Success +*/ +type PutProductContainersOK struct { + Payload *models.ProductContainer +} + +func (o *PutProductContainersOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/ProductContainers/{id}][%d] putProductContainersOK %+v", 200, o.Payload) +} + +func (o *PutProductContainersOK) GetPayload() *models.ProductContainer { + return o.Payload +} + +func (o *PutProductContainersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ProductContainer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/programs/get_programs_parameters.go b/client/programs/get_programs_parameters.go new file mode 100644 index 0000000..1b967a3 --- /dev/null +++ b/client/programs/get_programs_parameters.go @@ -0,0 +1,289 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package programs + +// 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" +) + +// NewGetProgramsParams creates a new GetProgramsParams object +// with the default values initialized. +func NewGetProgramsParams() *GetProgramsParams { + var () + return &GetProgramsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProgramsParamsWithTimeout creates a new GetProgramsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProgramsParamsWithTimeout(timeout time.Duration) *GetProgramsParams { + var () + return &GetProgramsParams{ + + timeout: timeout, + } +} + +// NewGetProgramsParamsWithContext creates a new GetProgramsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProgramsParamsWithContext(ctx context.Context) *GetProgramsParams { + var () + return &GetProgramsParams{ + + Context: ctx, + } +} + +// NewGetProgramsParamsWithHTTPClient creates a new GetProgramsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProgramsParamsWithHTTPClient(client *http.Client) *GetProgramsParams { + var () + return &GetProgramsParams{ + HTTPClient: client, + } +} + +/*GetProgramsParams contains all the parameters to send to the API endpoint +for the get programs operation typically these are written to a http.Request +*/ +type GetProgramsParams struct { + + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*ProgramType*/ + ProgramType *string + /*PublisherID*/ + PublisherID *int32 + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get programs params +func (o *GetProgramsParams) WithTimeout(timeout time.Duration) *GetProgramsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get programs params +func (o *GetProgramsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get programs params +func (o *GetProgramsParams) WithContext(ctx context.Context) *GetProgramsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get programs params +func (o *GetProgramsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get programs params +func (o *GetProgramsParams) WithHTTPClient(client *http.Client) *GetProgramsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get programs params +func (o *GetProgramsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrganizationID adds the organizationID to the get programs params +func (o *GetProgramsParams) WithOrganizationID(organizationID *int32) *GetProgramsParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get programs params +func (o *GetProgramsParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get programs params +func (o *GetProgramsParams) WithPage(page *int32) *GetProgramsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get programs params +func (o *GetProgramsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get programs params +func (o *GetProgramsParams) WithPageSize(pageSize *int32) *GetProgramsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get programs params +func (o *GetProgramsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithProgramType adds the programType to the get programs params +func (o *GetProgramsParams) WithProgramType(programType *string) *GetProgramsParams { + o.SetProgramType(programType) + return o +} + +// SetProgramType adds the programType to the get programs params +func (o *GetProgramsParams) SetProgramType(programType *string) { + o.ProgramType = programType +} + +// WithPublisherID adds the publisherID to the get programs params +func (o *GetProgramsParams) WithPublisherID(publisherID *int32) *GetProgramsParams { + o.SetPublisherID(publisherID) + return o +} + +// SetPublisherID adds the publisherId to the get programs params +func (o *GetProgramsParams) SetPublisherID(publisherID *int32) { + o.PublisherID = publisherID +} + +// WithSearch adds the search to the get programs params +func (o *GetProgramsParams) WithSearch(search *string) *GetProgramsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get programs params +func (o *GetProgramsParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProgramsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.ProgramType != nil { + + // query param ProgramType + var qrProgramType string + if o.ProgramType != nil { + qrProgramType = *o.ProgramType + } + qProgramType := qrProgramType + if qProgramType != "" { + if err := r.SetQueryParam("ProgramType", qProgramType); 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 +} diff --git a/client/programs/get_programs_responses.go b/client/programs/get_programs_responses.go new file mode 100644 index 0000000..b6fb41b --- /dev/null +++ b/client/programs/get_programs_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package programs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetProgramsReader is a Reader for the GetPrograms structure. +type GetProgramsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProgramsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProgramsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetProgramsOK creates a GetProgramsOK with default headers values +func NewGetProgramsOK() *GetProgramsOK { + return &GetProgramsOK{} +} + +/*GetProgramsOK handles this case with default header values. + +Success +*/ +type GetProgramsOK struct { + Payload *models.APICollectionOfProgram +} + +func (o *GetProgramsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Programs][%d] getProgramsOK %+v", 200, o.Payload) +} + +func (o *GetProgramsOK) GetPayload() *models.APICollectionOfProgram { + return o.Payload +} + +func (o *GetProgramsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfProgram) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/programs/programs_client.go b/client/programs/programs_client.go new file mode 100644 index 0000000..a9ec1cc --- /dev/null +++ b/client/programs/programs_client.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package programs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new programs API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for programs API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPrograms(params *GetProgramsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProgramsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPrograms get programs API +*/ +func (a *Client) GetPrograms(params *GetProgramsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProgramsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProgramsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetPrograms", + Method: "GET", + PathPattern: "/api/v1/Programs", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetProgramsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProgramsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetPrograms: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/publishers/get_publishers_parameters.go b/client/publishers/get_publishers_parameters.go new file mode 100644 index 0000000..07d6ed4 --- /dev/null +++ b/client/publishers/get_publishers_parameters.go @@ -0,0 +1,252 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package publishers + +// 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" +) + +// NewGetPublishersParams creates a new GetPublishersParams object +// with the default values initialized. +func NewGetPublishersParams() *GetPublishersParams { + var () + return &GetPublishersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPublishersParamsWithTimeout creates a new GetPublishersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPublishersParamsWithTimeout(timeout time.Duration) *GetPublishersParams { + var () + return &GetPublishersParams{ + + timeout: timeout, + } +} + +// NewGetPublishersParamsWithContext creates a new GetPublishersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPublishersParamsWithContext(ctx context.Context) *GetPublishersParams { + var () + return &GetPublishersParams{ + + Context: ctx, + } +} + +// NewGetPublishersParamsWithHTTPClient creates a new GetPublishersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPublishersParamsWithHTTPClient(client *http.Client) *GetPublishersParams { + var () + return &GetPublishersParams{ + HTTPClient: client, + } +} + +/*GetPublishersParams contains all the parameters to send to the API endpoint +for the get publishers operation typically these are written to a http.Request +*/ +type GetPublishersParams struct { + + /*Names*/ + Names []string + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*ProgramType*/ + ProgramType *string + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get publishers params +func (o *GetPublishersParams) WithTimeout(timeout time.Duration) *GetPublishersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get publishers params +func (o *GetPublishersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get publishers params +func (o *GetPublishersParams) WithContext(ctx context.Context) *GetPublishersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get publishers params +func (o *GetPublishersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get publishers params +func (o *GetPublishersParams) WithHTTPClient(client *http.Client) *GetPublishersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get publishers params +func (o *GetPublishersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNames adds the names to the get publishers params +func (o *GetPublishersParams) WithNames(names []string) *GetPublishersParams { + o.SetNames(names) + return o +} + +// SetNames adds the names to the get publishers params +func (o *GetPublishersParams) SetNames(names []string) { + o.Names = names +} + +// WithPage adds the page to the get publishers params +func (o *GetPublishersParams) WithPage(page *int32) *GetPublishersParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get publishers params +func (o *GetPublishersParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get publishers params +func (o *GetPublishersParams) WithPageSize(pageSize *int32) *GetPublishersParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get publishers params +func (o *GetPublishersParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithProgramType adds the programType to the get publishers params +func (o *GetPublishersParams) WithProgramType(programType *string) *GetPublishersParams { + o.SetProgramType(programType) + return o +} + +// SetProgramType adds the programType to the get publishers params +func (o *GetPublishersParams) SetProgramType(programType *string) { + o.ProgramType = programType +} + +// WithSearch adds the search to the get publishers params +func (o *GetPublishersParams) WithSearch(search *string) *GetPublishersParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get publishers params +func (o *GetPublishersParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPublishersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + valuesNames := o.Names + + joinedNames := swag.JoinByFormat(valuesNames, "multi") + // query array param Names + if err := r.SetQueryParam("Names", joinedNames...); 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.ProgramType != nil { + + // query param ProgramType + var qrProgramType string + if o.ProgramType != nil { + qrProgramType = *o.ProgramType + } + qProgramType := qrProgramType + if qProgramType != "" { + if err := r.SetQueryParam("ProgramType", qProgramType); 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 +} diff --git a/client/publishers/get_publishers_responses.go b/client/publishers/get_publishers_responses.go new file mode 100644 index 0000000..b3c8691 --- /dev/null +++ b/client/publishers/get_publishers_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package publishers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetPublishersReader is a Reader for the GetPublishers structure. +type GetPublishersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPublishersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPublishersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetPublishersOK creates a GetPublishersOK with default headers values +func NewGetPublishersOK() *GetPublishersOK { + return &GetPublishersOK{} +} + +/*GetPublishersOK handles this case with default header values. + +Success +*/ +type GetPublishersOK struct { + Payload *models.APICollectionOfPublisher +} + +func (o *GetPublishersOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Publishers][%d] getPublishersOK %+v", 200, o.Payload) +} + +func (o *GetPublishersOK) GetPayload() *models.APICollectionOfPublisher { + return o.Payload +} + +func (o *GetPublishersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfPublisher) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/publishers/publishers_client.go b/client/publishers/publishers_client.go index 66f51a0..1e856c2 100644 --- a/client/publishers/publishers_client.go +++ b/client/publishers/publishers_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { GetByID(params *GetByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetByIDOK, error) + GetPublishers(params *GetPublishersParams, authInfo runtime.ClientAuthInfoWriter) (*GetPublishersOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -67,6 +69,41 @@ func (a *Client) GetByID(params *GetByIDParams, authInfo runtime.ClientAuthInfoW panic(msg) } +/* + GetPublishers get publishers API +*/ +func (a *Client) GetPublishers(params *GetPublishersParams, authInfo runtime.ClientAuthInfoWriter) (*GetPublishersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPublishersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetPublishers", + Method: "GET", + PathPattern: "/api/v1/Publishers", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPublishersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPublishersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetPublishers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/regions/get_regions_parameters.go b/client/regions/get_regions_parameters.go new file mode 100644 index 0000000..7e71b93 --- /dev/null +++ b/client/regions/get_regions_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package regions + +// 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" +) + +// NewGetRegionsParams creates a new GetRegionsParams object +// with the default values initialized. +func NewGetRegionsParams() *GetRegionsParams { + var () + return &GetRegionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRegionsParamsWithTimeout creates a new GetRegionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRegionsParamsWithTimeout(timeout time.Duration) *GetRegionsParams { + var () + return &GetRegionsParams{ + + timeout: timeout, + } +} + +// NewGetRegionsParamsWithContext creates a new GetRegionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRegionsParamsWithContext(ctx context.Context) *GetRegionsParams { + var () + return &GetRegionsParams{ + + Context: ctx, + } +} + +// NewGetRegionsParamsWithHTTPClient creates a new GetRegionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRegionsParamsWithHTTPClient(client *http.Client) *GetRegionsParams { + var () + return &GetRegionsParams{ + HTTPClient: client, + } +} + +/*GetRegionsParams contains all the parameters to send to the API endpoint +for the get regions operation typically these are written to a http.Request +*/ +type GetRegionsParams struct { + + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*RegionList*/ + RegionList *string + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get regions params +func (o *GetRegionsParams) WithTimeout(timeout time.Duration) *GetRegionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get regions params +func (o *GetRegionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get regions params +func (o *GetRegionsParams) WithContext(ctx context.Context) *GetRegionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get regions params +func (o *GetRegionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get regions params +func (o *GetRegionsParams) WithHTTPClient(client *http.Client) *GetRegionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get regions params +func (o *GetRegionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrganizationID adds the organizationID to the get regions params +func (o *GetRegionsParams) WithOrganizationID(organizationID *int32) *GetRegionsParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get regions params +func (o *GetRegionsParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get regions params +func (o *GetRegionsParams) WithPage(page *int32) *GetRegionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get regions params +func (o *GetRegionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get regions params +func (o *GetRegionsParams) WithPageSize(pageSize *int32) *GetRegionsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get regions params +func (o *GetRegionsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithRegionList adds the regionList to the get regions params +func (o *GetRegionsParams) WithRegionList(regionList *string) *GetRegionsParams { + o.SetRegionList(regionList) + return o +} + +// SetRegionList adds the regionList to the get regions params +func (o *GetRegionsParams) SetRegionList(regionList *string) { + o.RegionList = regionList +} + +// WithSearch adds the search to the get regions params +func (o *GetRegionsParams) WithSearch(search *string) *GetRegionsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get regions params +func (o *GetRegionsParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRegionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.RegionList != nil { + + // query param RegionList + var qrRegionList string + if o.RegionList != nil { + qrRegionList = *o.RegionList + } + qRegionList := qrRegionList + if qRegionList != "" { + if err := r.SetQueryParam("RegionList", qRegionList); 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 +} diff --git a/client/regions/get_regions_responses.go b/client/regions/get_regions_responses.go new file mode 100644 index 0000000..0a7fd79 --- /dev/null +++ b/client/regions/get_regions_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package regions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetRegionsReader is a Reader for the GetRegions structure. +type GetRegionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRegionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRegionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRegionsOK creates a GetRegionsOK with default headers values +func NewGetRegionsOK() *GetRegionsOK { + return &GetRegionsOK{} +} + +/*GetRegionsOK handles this case with default header values. + +Success +*/ +type GetRegionsOK struct { + Payload *models.APICollectionOfRegion +} + +func (o *GetRegionsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Regions][%d] getRegionsOK %+v", 200, o.Payload) +} + +func (o *GetRegionsOK) GetPayload() *models.APICollectionOfRegion { + return o.Payload +} + +func (o *GetRegionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfRegion) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/regions/regions_client.go b/client/regions/regions_client.go index 7d7cfea..187653e 100644 --- a/client/regions/regions_client.go +++ b/client/regions/regions_client.go @@ -29,6 +29,8 @@ type Client struct { type ClientService interface { GetByRegionCode(params *GetByRegionCodeParams, authInfo runtime.ClientAuthInfoWriter) (*GetByRegionCodeOK, error) + GetRegions(params *GetRegionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRegionsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -67,6 +69,41 @@ func (a *Client) GetByRegionCode(params *GetByRegionCodeParams, authInfo runtime panic(msg) } +/* + GetRegions get regions API +*/ +func (a *Client) GetRegions(params *GetRegionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRegionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRegionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetRegions", + Method: "GET", + PathPattern: "/api/v1/Regions", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRegionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRegionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetRegions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/secrets/delete_secrets_parameters.go b/client/secrets/delete_secrets_parameters.go new file mode 100644 index 0000000..9db96c3 --- /dev/null +++ b/client/secrets/delete_secrets_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewDeleteSecretsParams creates a new DeleteSecretsParams object +// with the default values initialized. +func NewDeleteSecretsParams() *DeleteSecretsParams { + var () + return &DeleteSecretsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSecretsParamsWithTimeout creates a new DeleteSecretsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteSecretsParamsWithTimeout(timeout time.Duration) *DeleteSecretsParams { + var () + return &DeleteSecretsParams{ + + timeout: timeout, + } +} + +// NewDeleteSecretsParamsWithContext creates a new DeleteSecretsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteSecretsParamsWithContext(ctx context.Context) *DeleteSecretsParams { + var () + return &DeleteSecretsParams{ + + Context: ctx, + } +} + +// NewDeleteSecretsParamsWithHTTPClient creates a new DeleteSecretsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteSecretsParamsWithHTTPClient(client *http.Client) *DeleteSecretsParams { + var () + return &DeleteSecretsParams{ + HTTPClient: client, + } +} + +/*DeleteSecretsParams contains all the parameters to send to the API endpoint +for the delete secrets operation typically these are written to a http.Request +*/ +type DeleteSecretsParams struct { + + /*ClientID*/ + ClientID *string + /*SecretID*/ + SecretID *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete secrets params +func (o *DeleteSecretsParams) WithTimeout(timeout time.Duration) *DeleteSecretsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete secrets params +func (o *DeleteSecretsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete secrets params +func (o *DeleteSecretsParams) WithContext(ctx context.Context) *DeleteSecretsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete secrets params +func (o *DeleteSecretsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete secrets params +func (o *DeleteSecretsParams) WithHTTPClient(client *http.Client) *DeleteSecretsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete secrets params +func (o *DeleteSecretsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClientID adds the clientID to the delete secrets params +func (o *DeleteSecretsParams) WithClientID(clientID *string) *DeleteSecretsParams { + o.SetClientID(clientID) + return o +} + +// SetClientID adds the clientId to the delete secrets params +func (o *DeleteSecretsParams) SetClientID(clientID *string) { + o.ClientID = clientID +} + +// WithSecretID adds the secretID to the delete secrets params +func (o *DeleteSecretsParams) WithSecretID(secretID *int32) *DeleteSecretsParams { + o.SetSecretID(secretID) + return o +} + +// SetSecretID adds the secretId to the delete secrets params +func (o *DeleteSecretsParams) SetSecretID(secretID *int32) { + o.SecretID = secretID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSecretsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ClientID != nil { + + // query param clientId + var qrClientID string + if o.ClientID != nil { + qrClientID = *o.ClientID + } + qClientID := qrClientID + if qClientID != "" { + if err := r.SetQueryParam("clientId", qClientID); err != nil { + return err + } + } + + } + + if o.SecretID != nil { + + // query param secretId + var qrSecretID int32 + if o.SecretID != nil { + qrSecretID = *o.SecretID + } + qSecretID := swag.FormatInt32(qrSecretID) + if qSecretID != "" { + if err := r.SetQueryParam("secretId", qSecretID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/secrets/delete_secrets_responses.go b/client/secrets/delete_secrets_responses.go new file mode 100644 index 0000000..cea9bbb --- /dev/null +++ b/client/secrets/delete_secrets_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteSecretsReader is a Reader for the DeleteSecrets structure. +type DeleteSecretsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSecretsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSecretsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSecretsOK creates a DeleteSecretsOK with default headers values +func NewDeleteSecretsOK() *DeleteSecretsOK { + return &DeleteSecretsOK{} +} + +/*DeleteSecretsOK handles this case with default header values. + +Success +*/ +type DeleteSecretsOK struct { + Payload bool +} + +func (o *DeleteSecretsOK) Error() string { + return fmt.Sprintf("[DELETE /api/v1/Secrets][%d] deleteSecretsOK %+v", 200, o.Payload) +} + +func (o *DeleteSecretsOK) GetPayload() bool { + return o.Payload +} + +func (o *DeleteSecretsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/secrets/post_secrets_parameters.go b/client/secrets/post_secrets_parameters.go new file mode 100644 index 0000000..189fc96 --- /dev/null +++ b/client/secrets/post_secrets_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostSecretsParams creates a new PostSecretsParams object +// with the default values initialized. +func NewPostSecretsParams() *PostSecretsParams { + var () + return &PostSecretsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSecretsParamsWithTimeout creates a new PostSecretsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSecretsParamsWithTimeout(timeout time.Duration) *PostSecretsParams { + var () + return &PostSecretsParams{ + + timeout: timeout, + } +} + +// NewPostSecretsParamsWithContext creates a new PostSecretsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSecretsParamsWithContext(ctx context.Context) *PostSecretsParams { + var () + return &PostSecretsParams{ + + Context: ctx, + } +} + +// NewPostSecretsParamsWithHTTPClient creates a new PostSecretsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSecretsParamsWithHTTPClient(client *http.Client) *PostSecretsParams { + var () + return &PostSecretsParams{ + HTTPClient: client, + } +} + +/*PostSecretsParams contains all the parameters to send to the API endpoint +for the post secrets operation typically these are written to a http.Request +*/ +type PostSecretsParams struct { + + /*Secret*/ + Secret *models.Secret + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post secrets params +func (o *PostSecretsParams) WithTimeout(timeout time.Duration) *PostSecretsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post secrets params +func (o *PostSecretsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post secrets params +func (o *PostSecretsParams) WithContext(ctx context.Context) *PostSecretsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post secrets params +func (o *PostSecretsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post secrets params +func (o *PostSecretsParams) WithHTTPClient(client *http.Client) *PostSecretsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post secrets params +func (o *PostSecretsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSecret adds the secret to the post secrets params +func (o *PostSecretsParams) WithSecret(secret *models.Secret) *PostSecretsParams { + o.SetSecret(secret) + return o +} + +// SetSecret adds the secret to the post secrets params +func (o *PostSecretsParams) SetSecret(secret *models.Secret) { + o.Secret = secret +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSecretsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Secret != nil { + if err := r.SetBodyParam(o.Secret); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/secrets/post_secrets_responses.go b/client/secrets/post_secrets_responses.go new file mode 100644 index 0000000..bc0b7ee --- /dev/null +++ b/client/secrets/post_secrets_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostSecretsReader is a Reader for the PostSecrets structure. +type PostSecretsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSecretsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSecretsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostSecretsOK creates a PostSecretsOK with default headers values +func NewPostSecretsOK() *PostSecretsOK { + return &PostSecretsOK{} +} + +/*PostSecretsOK handles this case with default header values. + +Success +*/ +type PostSecretsOK struct { + Payload *models.Secret +} + +func (o *PostSecretsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/Secrets][%d] postSecretsOK %+v", 200, o.Payload) +} + +func (o *PostSecretsOK) GetPayload() *models.Secret { + return o.Payload +} + +func (o *PostSecretsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Secret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/secrets/secrets_client.go b/client/secrets/secrets_client.go index 3ea5b1e..af35f0f 100644 --- a/client/secrets/secrets_client.go +++ b/client/secrets/secrets_client.go @@ -27,29 +27,66 @@ type Client struct { // ClientService is the interface for Client methods type ClientService interface { - Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOK, error) + DeleteSecrets(params *DeleteSecretsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSecretsOK, error) + + PostSecrets(params *PostSecretsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSecretsOK, error) SetTransport(transport runtime.ClientTransport) } /* - Delete delete API + DeleteSecrets delete secrets API */ -func (a *Client) Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOK, error) { +func (a *Client) DeleteSecrets(params *DeleteSecretsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSecretsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteParams() + params = NewDeleteSecretsParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Delete", + ID: "DeleteSecrets", Method: "DELETE", PathPattern: "/api/v1/Secrets", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DeleteReader{formats: a.formats}, + Reader: &DeleteSecretsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSecretsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteSecrets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSecrets post secrets API +*/ +func (a *Client) PostSecrets(params *PostSecretsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSecretsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSecretsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostSecrets", + Method: "POST", + PathPattern: "/api/v1/Secrets", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSecretsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -57,13 +94,13 @@ func (a *Client) Delete(params *DeleteParams, authInfo runtime.ClientAuthInfoWri if err != nil { return nil, err } - success, ok := result.(*DeleteOK) + success, ok := result.(*PostSecretsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for PostSecrets: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/subscriptions/get_subscriptions_parameters.go b/client/subscriptions/get_subscriptions_parameters.go new file mode 100644 index 0000000..670a749 --- /dev/null +++ b/client/subscriptions/get_subscriptions_parameters.go @@ -0,0 +1,405 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package subscriptions + +// 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" +) + +// NewGetSubscriptionsParams creates a new GetSubscriptionsParams object +// with the default values initialized. +func NewGetSubscriptionsParams() *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubscriptionsParamsWithTimeout creates a new GetSubscriptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSubscriptionsParamsWithTimeout(timeout time.Duration) *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + + timeout: timeout, + } +} + +// NewGetSubscriptionsParamsWithContext creates a new GetSubscriptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSubscriptionsParamsWithContext(ctx context.Context) *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + + Context: ctx, + } +} + +// NewGetSubscriptionsParamsWithHTTPClient creates a new GetSubscriptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSubscriptionsParamsWithHTTPClient(client *http.Client) *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + HTTPClient: client, + } +} + +/*GetSubscriptionsParams contains all the parameters to send to the API endpoint +for the get subscriptions operation typically these are written to a http.Request +*/ +type GetSubscriptionsParams struct { + + /*CustomerTenantID*/ + CustomerTenantID *int32 + /*IsTrial*/ + IsTrial *bool + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*PublisherID*/ + PublisherID *int32 + /*Refresh*/ + Refresh *bool + /*RegisteredForReservedInstance*/ + RegisteredForReservedInstance *bool + /*Search*/ + Search *string + /*Statuses*/ + Statuses *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get subscriptions params +func (o *GetSubscriptionsParams) WithTimeout(timeout time.Duration) *GetSubscriptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get subscriptions params +func (o *GetSubscriptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get subscriptions params +func (o *GetSubscriptionsParams) WithContext(ctx context.Context) *GetSubscriptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get subscriptions params +func (o *GetSubscriptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get subscriptions params +func (o *GetSubscriptionsParams) WithHTTPClient(client *http.Client) *GetSubscriptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get subscriptions params +func (o *GetSubscriptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCustomerTenantID adds the customerTenantID to the get subscriptions params +func (o *GetSubscriptionsParams) WithCustomerTenantID(customerTenantID *int32) *GetSubscriptionsParams { + o.SetCustomerTenantID(customerTenantID) + return o +} + +// SetCustomerTenantID adds the customerTenantId to the get subscriptions params +func (o *GetSubscriptionsParams) SetCustomerTenantID(customerTenantID *int32) { + o.CustomerTenantID = customerTenantID +} + +// WithIsTrial adds the isTrial to the get subscriptions params +func (o *GetSubscriptionsParams) WithIsTrial(isTrial *bool) *GetSubscriptionsParams { + o.SetIsTrial(isTrial) + return o +} + +// SetIsTrial adds the isTrial to the get subscriptions params +func (o *GetSubscriptionsParams) SetIsTrial(isTrial *bool) { + o.IsTrial = isTrial +} + +// WithOrganizationID adds the organizationID to the get subscriptions params +func (o *GetSubscriptionsParams) WithOrganizationID(organizationID *int32) *GetSubscriptionsParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get subscriptions params +func (o *GetSubscriptionsParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get subscriptions params +func (o *GetSubscriptionsParams) WithPage(page *int32) *GetSubscriptionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get subscriptions params +func (o *GetSubscriptionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get subscriptions params +func (o *GetSubscriptionsParams) WithPageSize(pageSize *int32) *GetSubscriptionsParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get subscriptions params +func (o *GetSubscriptionsParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithPublisherID adds the publisherID to the get subscriptions params +func (o *GetSubscriptionsParams) WithPublisherID(publisherID *int32) *GetSubscriptionsParams { + o.SetPublisherID(publisherID) + return o +} + +// SetPublisherID adds the publisherId to the get subscriptions params +func (o *GetSubscriptionsParams) SetPublisherID(publisherID *int32) { + o.PublisherID = publisherID +} + +// WithRefresh adds the refresh to the get subscriptions params +func (o *GetSubscriptionsParams) WithRefresh(refresh *bool) *GetSubscriptionsParams { + o.SetRefresh(refresh) + return o +} + +// SetRefresh adds the refresh to the get subscriptions params +func (o *GetSubscriptionsParams) SetRefresh(refresh *bool) { + o.Refresh = refresh +} + +// WithRegisteredForReservedInstance adds the registeredForReservedInstance to the get subscriptions params +func (o *GetSubscriptionsParams) WithRegisteredForReservedInstance(registeredForReservedInstance *bool) *GetSubscriptionsParams { + o.SetRegisteredForReservedInstance(registeredForReservedInstance) + return o +} + +// SetRegisteredForReservedInstance adds the registeredForReservedInstance to the get subscriptions params +func (o *GetSubscriptionsParams) SetRegisteredForReservedInstance(registeredForReservedInstance *bool) { + o.RegisteredForReservedInstance = registeredForReservedInstance +} + +// WithSearch adds the search to the get subscriptions params +func (o *GetSubscriptionsParams) WithSearch(search *string) *GetSubscriptionsParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get subscriptions params +func (o *GetSubscriptionsParams) SetSearch(search *string) { + o.Search = search +} + +// WithStatuses adds the statuses to the get subscriptions params +func (o *GetSubscriptionsParams) WithStatuses(statuses *string) *GetSubscriptionsParams { + o.SetStatuses(statuses) + return o +} + +// SetStatuses adds the statuses to the get subscriptions params +func (o *GetSubscriptionsParams) SetStatuses(statuses *string) { + o.Statuses = statuses +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubscriptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CustomerTenantID != nil { + + // query param CustomerTenantId + var qrCustomerTenantID int32 + if o.CustomerTenantID != nil { + qrCustomerTenantID = *o.CustomerTenantID + } + qCustomerTenantID := swag.FormatInt32(qrCustomerTenantID) + if qCustomerTenantID != "" { + if err := r.SetQueryParam("CustomerTenantId", qCustomerTenantID); err != nil { + return err + } + } + + } + + if o.IsTrial != nil { + + // query param IsTrial + var qrIsTrial bool + if o.IsTrial != nil { + qrIsTrial = *o.IsTrial + } + qIsTrial := swag.FormatBool(qrIsTrial) + if qIsTrial != "" { + if err := r.SetQueryParam("IsTrial", qIsTrial); 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.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.Refresh != nil { + + // query param Refresh + var qrRefresh bool + if o.Refresh != nil { + qrRefresh = *o.Refresh + } + qRefresh := swag.FormatBool(qrRefresh) + if qRefresh != "" { + if err := r.SetQueryParam("Refresh", qRefresh); err != nil { + return err + } + } + + } + + if o.RegisteredForReservedInstance != nil { + + // query param RegisteredForReservedInstance + var qrRegisteredForReservedInstance bool + if o.RegisteredForReservedInstance != nil { + qrRegisteredForReservedInstance = *o.RegisteredForReservedInstance + } + qRegisteredForReservedInstance := swag.FormatBool(qrRegisteredForReservedInstance) + if qRegisteredForReservedInstance != "" { + if err := r.SetQueryParam("RegisteredForReservedInstance", qRegisteredForReservedInstance); 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 o.Statuses != nil { + + // query param Statuses + var qrStatuses string + if o.Statuses != nil { + qrStatuses = *o.Statuses + } + qStatuses := qrStatuses + if qStatuses != "" { + if err := r.SetQueryParam("Statuses", qStatuses); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/subscriptions/get_subscriptions_responses.go b/client/subscriptions/get_subscriptions_responses.go new file mode 100644 index 0000000..d871880 --- /dev/null +++ b/client/subscriptions/get_subscriptions_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetSubscriptionsReader is a Reader for the GetSubscriptions structure. +type GetSubscriptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubscriptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSubscriptionsOK creates a GetSubscriptionsOK with default headers values +func NewGetSubscriptionsOK() *GetSubscriptionsOK { + return &GetSubscriptionsOK{} +} + +/*GetSubscriptionsOK handles this case with default header values. + +Success +*/ +type GetSubscriptionsOK struct { + Payload *models.APICollectionOfSubscription +} + +func (o *GetSubscriptionsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Subscriptions][%d] getSubscriptionsOK %+v", 200, o.Payload) +} + +func (o *GetSubscriptionsOK) GetPayload() *models.APICollectionOfSubscription { + return o.Payload +} + +func (o *GetSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfSubscription) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/subscriptions/post_subscriptions_parameters.go b/client/subscriptions/post_subscriptions_parameters.go new file mode 100644 index 0000000..ca43bef --- /dev/null +++ b/client/subscriptions/post_subscriptions_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package subscriptions + +// 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/bjerkio/crayon-api-go/models" +) + +// NewPostSubscriptionsParams creates a new PostSubscriptionsParams object +// with the default values initialized. +func NewPostSubscriptionsParams() *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSubscriptionsParamsWithTimeout creates a new PostSubscriptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSubscriptionsParamsWithTimeout(timeout time.Duration) *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + + timeout: timeout, + } +} + +// NewPostSubscriptionsParamsWithContext creates a new PostSubscriptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSubscriptionsParamsWithContext(ctx context.Context) *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + + Context: ctx, + } +} + +// NewPostSubscriptionsParamsWithHTTPClient creates a new PostSubscriptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSubscriptionsParamsWithHTTPClient(client *http.Client) *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + HTTPClient: client, + } +} + +/*PostSubscriptionsParams contains all the parameters to send to the API endpoint +for the post subscriptions operation typically these are written to a http.Request +*/ +type PostSubscriptionsParams struct { + + /*Subscription*/ + Subscription *models.SubscriptionDetailed + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post subscriptions params +func (o *PostSubscriptionsParams) WithTimeout(timeout time.Duration) *PostSubscriptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post subscriptions params +func (o *PostSubscriptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post subscriptions params +func (o *PostSubscriptionsParams) WithContext(ctx context.Context) *PostSubscriptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post subscriptions params +func (o *PostSubscriptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post subscriptions params +func (o *PostSubscriptionsParams) WithHTTPClient(client *http.Client) *PostSubscriptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post subscriptions params +func (o *PostSubscriptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubscription adds the subscription to the post subscriptions params +func (o *PostSubscriptionsParams) WithSubscription(subscription *models.SubscriptionDetailed) *PostSubscriptionsParams { + o.SetSubscription(subscription) + return o +} + +// SetSubscription adds the subscription to the post subscriptions params +func (o *PostSubscriptionsParams) SetSubscription(subscription *models.SubscriptionDetailed) { + o.Subscription = subscription +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSubscriptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Subscription != nil { + if err := r.SetBodyParam(o.Subscription); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/subscriptions/post_subscriptions_responses.go b/client/subscriptions/post_subscriptions_responses.go new file mode 100644 index 0000000..84b4a6e --- /dev/null +++ b/client/subscriptions/post_subscriptions_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PostSubscriptionsReader is a Reader for the PostSubscriptions structure. +type PostSubscriptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSubscriptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostSubscriptionsOK creates a PostSubscriptionsOK with default headers values +func NewPostSubscriptionsOK() *PostSubscriptionsOK { + return &PostSubscriptionsOK{} +} + +/*PostSubscriptionsOK handles this case with default header values. + +Success +*/ +type PostSubscriptionsOK struct { + Payload *models.SubscriptionDetailed +} + +func (o *PostSubscriptionsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/Subscriptions][%d] postSubscriptionsOK %+v", 200, o.Payload) +} + +func (o *PostSubscriptionsOK) GetPayload() *models.SubscriptionDetailed { + return o.Payload +} + +func (o *PostSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SubscriptionDetailed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/subscriptions/put_subscriptions_parameters.go b/client/subscriptions/put_subscriptions_parameters.go new file mode 100644 index 0000000..d8ec76a --- /dev/null +++ b/client/subscriptions/put_subscriptions_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package subscriptions + +// 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" + + "github.com/bjerkio/crayon-api-go/models" +) + +// NewPutSubscriptionsParams creates a new PutSubscriptionsParams object +// with the default values initialized. +func NewPutSubscriptionsParams() *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSubscriptionsParamsWithTimeout creates a new PutSubscriptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSubscriptionsParamsWithTimeout(timeout time.Duration) *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + + timeout: timeout, + } +} + +// NewPutSubscriptionsParamsWithContext creates a new PutSubscriptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSubscriptionsParamsWithContext(ctx context.Context) *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + + Context: ctx, + } +} + +// NewPutSubscriptionsParamsWithHTTPClient creates a new PutSubscriptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSubscriptionsParamsWithHTTPClient(client *http.Client) *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + HTTPClient: client, + } +} + +/*PutSubscriptionsParams contains all the parameters to send to the API endpoint +for the put subscriptions operation typically these are written to a http.Request +*/ +type PutSubscriptionsParams struct { + + /*ID*/ + ID int32 + /*Subscription*/ + Subscription *models.SubscriptionDetailed + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put subscriptions params +func (o *PutSubscriptionsParams) WithTimeout(timeout time.Duration) *PutSubscriptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put subscriptions params +func (o *PutSubscriptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put subscriptions params +func (o *PutSubscriptionsParams) WithContext(ctx context.Context) *PutSubscriptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put subscriptions params +func (o *PutSubscriptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put subscriptions params +func (o *PutSubscriptionsParams) WithHTTPClient(client *http.Client) *PutSubscriptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put subscriptions params +func (o *PutSubscriptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the put subscriptions params +func (o *PutSubscriptionsParams) WithID(id int32) *PutSubscriptionsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the put subscriptions params +func (o *PutSubscriptionsParams) SetID(id int32) { + o.ID = id +} + +// WithSubscription adds the subscription to the put subscriptions params +func (o *PutSubscriptionsParams) WithSubscription(subscription *models.SubscriptionDetailed) *PutSubscriptionsParams { + o.SetSubscription(subscription) + return o +} + +// SetSubscription adds the subscription to the put subscriptions params +func (o *PutSubscriptionsParams) SetSubscription(subscription *models.SubscriptionDetailed) { + o.Subscription = subscription +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSubscriptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil { + return err + } + + if o.Subscription != nil { + if err := r.SetBodyParam(o.Subscription); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/subscriptions/put_subscriptions_responses.go b/client/subscriptions/put_subscriptions_responses.go new file mode 100644 index 0000000..c56aa97 --- /dev/null +++ b/client/subscriptions/put_subscriptions_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// PutSubscriptionsReader is a Reader for the PutSubscriptions structure. +type PutSubscriptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSubscriptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutSubscriptionsOK creates a PutSubscriptionsOK with default headers values +func NewPutSubscriptionsOK() *PutSubscriptionsOK { + return &PutSubscriptionsOK{} +} + +/*PutSubscriptionsOK handles this case with default header values. + +Success +*/ +type PutSubscriptionsOK struct { + Payload *models.SubscriptionDetailed +} + +func (o *PutSubscriptionsOK) Error() string { + return fmt.Sprintf("[PUT /api/v1/Subscriptions/{id}][%d] putSubscriptionsOK %+v", 200, o.Payload) +} + +func (o *PutSubscriptionsOK) GetPayload() *models.SubscriptionDetailed { + return o.Payload +} + +func (o *PutSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SubscriptionDetailed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/subscriptions/subscriptions_client.go b/client/subscriptions/subscriptions_client.go index db8ace9..1a43fad 100644 --- a/client/subscriptions/subscriptions_client.go +++ b/client/subscriptions/subscriptions_client.go @@ -41,11 +41,13 @@ type ClientService interface { GetSubscriptionTags(params *GetSubscriptionTagsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionTagsOK, error) - Post(params *PostParams, authInfo runtime.ClientAuthInfoWriter) (*PostOK, error) + GetSubscriptions(params *GetSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionsOK, error) PostSubscriptionConversion(params *PostSubscriptionConversionParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubscriptionConversionOK, error) - Put(params *PutParams, authInfo runtime.ClientAuthInfoWriter) (*PutOK, error) + PostSubscriptions(params *PostSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubscriptionsOK, error) + + PutSubscriptions(params *PutSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubscriptionsOK, error) RegisterReservedInstance(params *RegisterReservedInstanceParams, authInfo runtime.ClientAuthInfoWriter) (*RegisterReservedInstanceOK, error) @@ -304,23 +306,23 @@ func (a *Client) GetSubscriptionTags(params *GetSubscriptionTagsParams, authInfo } /* - Post post API + GetSubscriptions get subscriptions API */ -func (a *Client) Post(params *PostParams, authInfo runtime.ClientAuthInfoWriter) (*PostOK, error) { +func (a *Client) GetSubscriptions(params *GetSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostParams() + params = NewGetSubscriptionsParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Post", - Method: "POST", + ID: "GetSubscriptions", + Method: "GET", PathPattern: "/api/v1/Subscriptions", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, - ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &PostReader{formats: a.formats}, + Reader: &GetSubscriptionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -328,13 +330,13 @@ func (a *Client) Post(params *PostParams, authInfo runtime.ClientAuthInfoWriter) if err != nil { return nil, err } - success, ok := result.(*PostOK) + success, ok := result.(*GetSubscriptionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for GetSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -374,23 +376,58 @@ func (a *Client) PostSubscriptionConversion(params *PostSubscriptionConversionPa } /* - Put put API + PostSubscriptions post subscriptions API +*/ +func (a *Client) PostSubscriptions(params *PostSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubscriptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSubscriptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostSubscriptions", + Method: "POST", + PathPattern: "/api/v1/Subscriptions", + ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, + ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSubscriptionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSubscriptionsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for PostSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSubscriptions put subscriptions API */ -func (a *Client) Put(params *PutParams, authInfo runtime.ClientAuthInfoWriter) (*PutOK, error) { +func (a *Client) PutSubscriptions(params *PutSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubscriptionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutParams() + params = NewPutSubscriptionsParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Put", + ID: "PutSubscriptions", Method: "PUT", PathPattern: "/api/v1/Subscriptions/{id}", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, ConsumesMediaTypes: []string{"application/*+json", "application/json", "application/json-patch+json", "text/json"}, Schemes: []string{"http"}, Params: params, - Reader: &PutReader{formats: a.formats}, + Reader: &PutSubscriptionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -398,13 +435,13 @@ func (a *Client) Put(params *PutParams, authInfo runtime.ClientAuthInfoWriter) ( if err != nil { return nil, err } - success, ok := result.(*PutOK) + success, ok := result.(*PutSubscriptionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for PutSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/users/get_users_parameters.go b/client/users/get_users_parameters.go new file mode 100644 index 0000000..bc1b2da --- /dev/null +++ b/client/users/get_users_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// 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" +) + +// NewGetUsersParams creates a new GetUsersParams object +// with the default values initialized. +func NewGetUsersParams() *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUsersParamsWithTimeout creates a new GetUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: timeout, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + var () + return &GetUsersParams{ + + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + var () + return &GetUsersParams{ + HTTPClient: client, + } +} + +/*GetUsersParams contains all the parameters to send to the API endpoint +for the get users operation typically these are written to a http.Request +*/ +type GetUsersParams struct { + + /*OrganizationID*/ + OrganizationID *int32 + /*Page*/ + Page *int32 + /*PageSize*/ + PageSize *int32 + /*Role*/ + Role *string + /*Search*/ + Search *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get users params +func (o *GetUsersParams) WithTimeout(timeout time.Duration) *GetUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get users params +func (o *GetUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get users params +func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get users params +func (o *GetUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get users params +func (o *GetUsersParams) WithHTTPClient(client *http.Client) *GetUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get users params +func (o *GetUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrganizationID adds the organizationID to the get users params +func (o *GetUsersParams) WithOrganizationID(organizationID *int32) *GetUsersParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get users params +func (o *GetUsersParams) SetOrganizationID(organizationID *int32) { + o.OrganizationID = organizationID +} + +// WithPage adds the page to the get users params +func (o *GetUsersParams) WithPage(page *int32) *GetUsersParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the get users params +func (o *GetUsersParams) SetPage(page *int32) { + o.Page = page +} + +// WithPageSize adds the pageSize to the get users params +func (o *GetUsersParams) WithPageSize(pageSize *int32) *GetUsersParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the get users params +func (o *GetUsersParams) SetPageSize(pageSize *int32) { + o.PageSize = pageSize +} + +// WithRole adds the role to the get users params +func (o *GetUsersParams) WithRole(role *string) *GetUsersParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the get users params +func (o *GetUsersParams) SetRole(role *string) { + o.Role = role +} + +// WithSearch adds the search to the get users params +func (o *GetUsersParams) WithSearch(search *string) *GetUsersParams { + o.SetSearch(search) + return o +} + +// SetSearch adds the search to the get users params +func (o *GetUsersParams) SetSearch(search *string) { + o.Search = search +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.Role != nil { + + // query param Role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("Role", qRole); 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 +} diff --git a/client/users/get_users_responses.go b/client/users/get_users_responses.go new file mode 100644 index 0000000..c8f781f --- /dev/null +++ b/client/users/get_users_responses.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/bjerkio/crayon-api-go/models" +) + +// GetUsersReader is a Reader for the GetUsers structure. +type GetUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/*GetUsersOK handles this case with default header values. + +Success +*/ +type GetUsersOK struct { + Payload *models.APICollectionOfUser +} + +func (o *GetUsersOK) Error() string { + return fmt.Sprintf("[GET /api/v1/Users][%d] getUsersOK %+v", 200, o.Payload) +} + +func (o *GetUsersOK) GetPayload() *models.APICollectionOfUser { + return o.Payload +} + +func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APICollectionOfUser) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/users/users_client.go b/client/users/users_client.go index add04a4..7e027f7 100644 --- a/client/users/users_client.go +++ b/client/users/users_client.go @@ -33,12 +33,12 @@ type ClientService interface { DeleteUser(params *DeleteUserParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteUserOK, error) - Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) (*GetOK, error) - GetUserByID(params *GetUserByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByIDOK, error) GetUserByUserName(params *GetUserByUserNameParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByUserNameOK, error) + GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error) + UpdateUser(params *UpdateUserParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateUserOK, error) SetTransport(transport runtime.ClientTransport) @@ -150,23 +150,23 @@ func (a *Client) DeleteUser(params *DeleteUserParams, authInfo runtime.ClientAut } /* - Get get API + GetUserByID get user by Id API */ -func (a *Client) Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) (*GetOK, error) { +func (a *Client) GetUserByID(params *GetUserByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByIDOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetParams() + params = NewGetUserByIDParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Get", + ID: "GetUserById", Method: "GET", - PathPattern: "/api/v1/Users", + PathPattern: "/api/v1/Users/{id}", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &GetReader{formats: a.formats}, + Reader: &GetUserByIDReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -174,34 +174,34 @@ func (a *Client) Get(params *GetParams, authInfo runtime.ClientAuthInfoWriter) ( if err != nil { return nil, err } - success, ok := result.(*GetOK) + success, ok := result.(*GetUserByIDOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for GetUserById: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - GetUserByID get user by Id API + GetUserByUserName get user by user name API */ -func (a *Client) GetUserByID(params *GetUserByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByIDOK, error) { +func (a *Client) GetUserByUserName(params *GetUserByUserNameParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByUserNameOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetUserByIDParams() + params = NewGetUserByUserNameParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetUserById", + ID: "GetUserByUserName", Method: "GET", - PathPattern: "/api/v1/Users/{id}", + PathPattern: "/api/v1/Users/user", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &GetUserByIDReader{formats: a.formats}, + Reader: &GetUserByUserNameReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -209,34 +209,34 @@ func (a *Client) GetUserByID(params *GetUserByIDParams, authInfo runtime.ClientA if err != nil { return nil, err } - success, ok := result.(*GetUserByIDOK) + success, ok := result.(*GetUserByUserNameOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetUserById: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for GetUserByUserName: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - GetUserByUserName get user by user name API + GetUsers get users API */ -func (a *Client) GetUserByUserName(params *GetUserByUserNameParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByUserNameOK, error) { +func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetUserByUserNameParams() + params = NewGetUsersParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetUserByUserName", + ID: "GetUsers", Method: "GET", - PathPattern: "/api/v1/Users/user", + PathPattern: "/api/v1/Users", ProducesMediaTypes: []string{"application/json", "text/json", "text/plain"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &GetUserByUserNameReader{formats: a.formats}, + Reader: &GetUsersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -244,13 +244,13 @@ func (a *Client) GetUserByUserName(params *GetUserByUserNameParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*GetUserByUserNameOK) + success, ok := result.(*GetUsersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetUserByUserName: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for GetUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/go.mod b/go.mod index 6dc5326..4c1f0ec 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.13 require ( github.com/go-openapi/errors v0.19.6 github.com/go-openapi/runtime v0.19.19 + github.com/go-openapi/spec3 v0.0.0-20200311181749-3fab9faa9094 // indirect github.com/go-openapi/strfmt v0.19.5 github.com/go-openapi/swag v0.19.9 github.com/go-openapi/validate v0.19.10 diff --git a/go.sum b/go.sum index 0a7d920..c50ef85 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,7 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -61,6 +62,8 @@ github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8 github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec3 v0.0.0-20200311181749-3fab9faa9094 h1:wKRG49CC+8Wvq1knpPSRu9sADu0Wb4dT0dptjD5PI7E= +github.com/go-openapi/spec3 v0.0.0-20200311181749-3fab9faa9094/go.mod h1:UMsAMXhvfY4MuGo9YDyezRu8UuTv704RUVQnOuFWWJc= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= @@ -164,6 +167,7 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -188,6 +192,7 @@ golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= diff --git a/internal/cmd/convert-swagger/main.go b/internal/cmd/convert-swagger/main.go new file mode 100644 index 0000000..a0399af --- /dev/null +++ b/internal/cmd/convert-swagger/main.go @@ -0,0 +1,63 @@ +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "os" + "regexp" + "strings" + + "github.com/go-openapi/spec" +) + +func fixMethod(path string, op *spec.Operation) { + if op != nil { + r := regexp.MustCompile(`(delete|get|head|options|patch|post|put)\b`) + if r.MatchString(strings.ToLower(op.ID)) { + op.ID = fmt.Sprintf("%s%s", op.ID, op.Tags[0]) + } + } +} + +func main() { + resp, err := http.Get("https://api.crayon.com/swagger/v1/swagger.json") + if err != nil { + panic(err) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + api := spec.Swagger{} + err = json.Unmarshal(body, &api) + if err != nil { + panic(err) + } + + for i, h := range api.Paths.Paths { + fixMethod(i, h.Delete) + fixMethod(i, h.Get) + fixMethod(i, h.Head) + fixMethod(i, h.Options) + fixMethod(i, h.Patch) + fixMethod(i, h.Post) + fixMethod(i, h.Put) + } + + raw, err := json.MarshalIndent(api, "", " ") + if err != nil { + panic(err) + } + sw, err := os.Create("./swagger.json") + if err != nil { + panic(err) + } + _, err = sw.Write(raw) + if err != nil { + panic(err) + } + defer sw.Close() +} diff --git a/log.txt b/log.txt new file mode 100644 index 0000000..b27b994 --- /dev/null +++ b/log.txt @@ -0,0 +1,12 @@ +docker pull quay.io/goswagger/swagger +Using default tag: latest +latest: Pulling from goswagger/swagger +Digest: sha256:31168c113862cce4cef6b16b20cdef1b126eb755492a6030ca68a9020b7eb657 +Status: Image is up to date for quay.io/goswagger/swagger:latest +quay.io/goswagger/swagger:latest +go generate ./tools.go +curl -o ./swagger.json https://api.crayon.com/swagger/v1/swagger.json +alias swagger="docker run --rm -it -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger" +swagger generate client -f \ + ./swagger.json -t ./ --skip-validation +./bin/addlicense -c "Bjerk AS" **/*.go diff --git a/swagger.json b/swagger.json index 2c7bff9..f616593 100644 --- a/swagger.json +++ b/swagger.json @@ -1,11065 +1,10481 @@ -{ - "swagger": "2.0", - "info": { - "version": "v1", - "title": "Crayon Group Customer API" - }, - "host": "apiv1.crayon.com", - "paths": { - "/api/v1/ActivityLogs": { - "get": { - "tags": [ - "ActivityLogs" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Entity", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Id", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Ids", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "SearchDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "From", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "To", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ActivityLog" - } - } - } - } - }, - "/api/v1/organizations/{organizationId}/Addresses": { - "get": { - "tags": [ - "Addresses" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Invoice", - "Delivery" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfAddress" - } - } - } - } - }, - "/api/v1/organizations/{organizationId}/Addresses/{id}": { - "get": { - "tags": [ - "Addresses" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Address" - } - } - } - } - }, - "/api/v1/AgreementProducts": { - "get": { - "tags": [ - "AgreementProducts" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "AgreementTypeIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "None", - "LicenseAgreement", - "OpenAgreement", - "FrameAgreement", - "SamAgreement", - "ConsultingAgreement", - "CloudSeatAgreement", - "CloudUsageAgreement", - "ReportingAgreement", - "OtherAgreement", - "Reserved1", - "Reserved2", - "Reserved3" - ] - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "PriceListId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "CustomerTenantId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "AgreementId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "IsTrial", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "AgreementIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "SearchDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "Include.PartNumbers", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.PublisherIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.PublisherNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.PoolNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.OperatingSystemNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.LevelNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.LanguageNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.LicenseAgreementTypeNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.LicenseTypeNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.ProductFamilyNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.ProductTypeNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.ProgramNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.OfferingNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.PurchasePeriodNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.PurchaseUnitNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.VersionNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.RegionNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Include.ProductCategoryNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.PartNumbers", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.PublisherIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.PublisherNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.PoolNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.OperatingSystemNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.LevelNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.LanguageNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.LicenseAgreementTypeNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.LicenseTypeNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.ProductFamilyNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.ProductTypeNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.ProgramNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.OfferingNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.PurchasePeriodNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.PurchaseUnitNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.VersionNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.RegionNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Exclude.ProductCategoryNames", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "SortKey", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "IncludeProductInformation", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "SortOrder", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "Ascending", - "Descending" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AgreementProductCollection" - } - } - } - }, - "post": { - "tags": [ - "AgreementProducts" - ], - "operationId": "GetOperationSdk133", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "filter", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AgreementProductFilter" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AgreementProductCollection" - } - } - } - } - }, - "/api/v1/AgreementProducts/file/xlsx": { - "post": { - "tags": [ - "AgreementProducts" - ], - "operationId": "GetAsExcelFile", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "filter", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AgreementProductFilter" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/AgreementProducts/{partNumber}/supportedbillingcycles": { - "get": { - "tags": [ - "AgreementProducts" - ], - "operationId": "GetSupportedBillingCycles", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerCustomerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "partNumber", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "uniqueItems": false, - "type": "array", - "items": { - "enum": [ - "Unknown", - "Monthly", - "Annual", - "None", - "OneTime", - "BiAnnually", - "TwoYears", - "ThreeYears", - "Quarterly" - ], - "type": "string" - } - } - } - } - } - }, - "/api/v1/AgreementReports/{productContainerId}": { - "get": { - "tags": [ - "AgreementReports" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "productContainerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfAgreementReport" - } - } - } - } - }, - "/api/v1/AgreementReports/{agreementId}": { - "put": { - "tags": [ - "AgreementReports" - ], - "operationId": "Update", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "agreementId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "agreementReport", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AgreementReport" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AgreementReport" - } - } - } - } - }, - "/api/v1/Agreements": { - "get": { - "tags": [ - "Agreements" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "OrganizationIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "PricelistIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Status", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Active", - "Inactive", - "ActiveInactive" - ] - }, - { - "name": "AgreementTypes", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string", - "enum": [ - "None", - "LicenseAgreement", - "OpenAgreement", - "FrameAgreement", - "SamAgreement", - "ConsultingAgreement", - "CloudSeatAgreement", - "CloudUsageAgreement", - "ReportingAgreement", - "OtherAgreement", - "Reserved1", - "Reserved2", - "Reserved3" - ] - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "PublisherIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "ProgramIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "SearchDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "AgreementIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "SalesPriceCurrency", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "TermRequired", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "EndDateFrom", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "EndDateTo", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AgreementCollection" - } - } - } - } - }, - "/api/v1/Assets": { - "get": { - "tags": [ - "Assets" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "ResellerCustomerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ExternalOrderId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "ExternalOrderIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "ReservationId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "AssetType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "Reservation", - "Software", - "Subscription" - ] - }, - { - "name": "Status", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Fulfilling", - "Succeeded", - "Cancelled", - "Expired", - "All" - ] - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfAsset" - } - } - } - } - }, - "/api/v1/Assets/{id}": { - "get": { - "tags": [ - "Assets" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Asset" - } - } - } - } - }, - "/api/v1/Assets/orders": { - "get": { - "tags": [ - "Assets" - ], - "operationId": "GetAssetOrdersAsync", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "ResellerCustomerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ExternalOrderId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "ExternalOrderIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "ReservationId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "AssetType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "Reservation", - "Software", - "Subscription" - ] - }, - { - "name": "Status", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Fulfilling", - "Succeeded", - "Cancelled", - "Expired", - "All" - ] - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfAssetOrder" - } - } - } - } - }, - "/api/v1/Assets/verify": { - "post": { - "tags": [ - "Assets" - ], - "operationId": "VerifyAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "order", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AssetOrder" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AssetOrder" - } - } - } - } - }, - "/api/v1/Assets/checkout": { - "post": { - "tags": [ - "Assets" - ], - "operationId": "CheckoutAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "order", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AssetOrder" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/Assets/{assetId}/tags": { - "put": { - "tags": [ - "Assets" - ], - "operationId": "UpdateTagsAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "assetTags", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AssetTags" - } - }, - { - "name": "assetId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - }, - "post": { - "tags": [ - "Assets" - ], - "operationId": "AddTagsAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "assetTags", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AssetTags" - } - }, - { - "name": "assetId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - }, - "delete": { - "tags": [ - "Assets" - ], - "operationId": "DeleteTagsAsync", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "assetId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/AwsAccounts": { - "get": { - "tags": [ - "AwsAccounts" - ], - "operationId": "GetAwsAccounts", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ConsumerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "CustomerTenantType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "T1", - "T2" - ] - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfAwsAccount" - } - } - } - } - }, - "/api/v1/AwsAccounts/{id}": { - "get": { - "tags": [ - "AwsAccounts" - ], - "operationId": "GetAwsAccountById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AwsAccount" - } - } - } - }, - "put": { - "tags": [ - "AwsAccounts" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "awsAccount", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AwsAccount" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AwsAccount" - } - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}": { - "get": { - "tags": [ - "AzurePlans" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzurePlan" - } - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions": { - "get": { - "tags": [ - "AzurePlans" - ], - "operationId": "GetSubscriptions", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfAzureSubscription" - } - } - } - }, - "post": { - "tags": [ - "AzurePlans" - ], - "operationId": "CreateSubscription", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "requestBody", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CreateAzureSubscriptionRequest" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}": { - "get": { - "tags": [ - "AzurePlans" - ], - "operationId": "GetSubscriptionById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzureSubscription" - } - } - } - }, - "put": { - "tags": [ - "AzurePlans" - ], - "operationId": "UpdateSubscription", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "azureSubscription", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PutAzureSubscription" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzureSubscription" - } - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/assign-unique-admin": { - "put": { - "tags": [ - "AzurePlans" - ], - "operationId": "AssignUniqueAdmin", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "body", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AzureSubscriptionAssignAdmin" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/cancel": { - "post": { - "tags": [ - "AzurePlans" - ], - "operationId": "Cancel", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzureSubscriptionUpdated" - } - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/enable": { - "post": { - "tags": [ - "AzurePlans" - ], - "operationId": "Enable", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzureSubscriptionUpdated" - } - } - } - } - }, - "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/rename": { - "patch": { - "tags": [ - "AzurePlans" - ], - "operationId": "Enable", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "azurePlanId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "body", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/AzureSubscriptionRename" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzureSubscriptionUpdated" - } - } - } - } - }, - "/api/v1/BillingCycles": { - "get": { - "tags": [ - "BillingCycles" - ], - "operationId": "GetAllBillingCycles", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "includeUnknown", - "in": "query", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfBillingCycle" - } - } - } - } - }, - "/api/v1/BillingCycles/productVariant/{productVariantId}": { - "get": { - "tags": [ - "BillingCycles" - ], - "operationId": "GetByProductVariantId", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "productVariantId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfBillingCycle" - } - } - } - } - }, - "/api/v1/BillingCycles/cspNameDictionary": { - "get": { - "tags": [ - "BillingCycles" - ], - "operationId": "GetCspNameDictionary", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - } - }, - "/api/v1/BillingStatements": { - "get": { - "tags": [ - "BillingStatements" - ], - "operationId": "GetBillingStatements", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "InvoiceProfileId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ProvisionType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Seat", - "Usage", - "OneTime", - "Crayon", - "AzureMarketplace" - ] - }, - { - "name": "From", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "To", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfBillingStatement" - } - } - } - } - }, - "/api/v1/BillingStatements/grouped": { - "get": { - "tags": [ - "BillingStatements" - ], - "operationId": "GetGroupedBillingStatements", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "InvoiceProfileId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ProvisionType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Seat", - "Usage", - "OneTime", - "Crayon", - "AzureMarketplace" - ] - }, - { - "name": "From", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "To", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfGroupedBillingStatement" - } - } - } - } - }, - "/api/v1/BillingStatements/file/{id}": { - "get": { - "tags": [ - "BillingStatements" - ], - "operationId": "GetBillingStatementFile", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/BillingStatements/{id}/reconciliationfile": { - "get": { - "tags": [ - "BillingStatements" - ], - "operationId": "GetReconciliationFile", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/BillingStatements/{id}/billingrecordsfile": { - "get": { - "tags": [ - "BillingStatements" - ], - "operationId": "GetBillingRecordsFile", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/BlogItems": { - "get": { - "tags": [ - "BlogItems" - ], - "operationId": "GetForDirectCustomers", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "count", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 6 - }, - { - "name": "organizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 0 - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfBlogItem" - } - } - } - } - }, - "/api/v1/Clients": { - "get": { - "tags": [ - "Clients" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfClient" - } - } - } - }, - "post": { - "tags": [ - "Clients" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "client", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Client" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Client" - } - } - } - } - }, - "/api/v1/Clients/{clientId}": { - "get": { - "tags": [ - "Clients" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Client" - } - } - } - }, - "put": { - "tags": [ - "Clients" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "client", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Client" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Client" - } - } - } - }, - "delete": { - "tags": [ - "Clients" - ], - "operationId": "Delete", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/Consumers": { - "get": { - "tags": [ - "Consumers" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfConsumer" - } - } - } - }, - "post": { - "tags": [ - "Consumers" - ], - "operationId": "AddConsumer", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "consumer", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Consumer" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Consumer" - } - } - } - } - }, - "/api/v1/Consumers/{id}": { - "get": { - "tags": [ - "Consumers" - ], - "operationId": "GetConsumerById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Consumer" - } - } - } - }, - "put": { - "tags": [ - "Consumers" - ], - "operationId": "UpdateConsumer", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "consumer", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Consumer" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Consumer" - } - } - } - }, - "delete": { - "tags": [ - "Consumers" - ], - "operationId": "DeleteConsumer", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/CrayonAccounts": { - "get": { - "tags": [ - "CrayonAccounts" - ], - "operationId": "GetCrayonAccounts", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ConsumerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "CustomerTenantType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "T1", - "T2" - ] - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfCrayonAccount" - } - } - } - }, - "post": { - "tags": [ - "CrayonAccounts" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "crayonAccount", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CrayonAccount" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CrayonAccount" - } - } - } - } - }, - "/api/v1/CrayonAccounts/{id}": { - "get": { - "tags": [ - "CrayonAccounts" - ], - "operationId": "GetCrayonAccountById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CrayonAccount" - } - } - } - }, - "put": { - "tags": [ - "CrayonAccounts" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "crayonAccount", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CrayonAccount" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CrayonAccount" - } - } - } - } - }, - "/api/v1/customertenants/{customerTenantId}/agreements": { - "get": { - "tags": [ - "CustomerTenantAgreements" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "customerTenantId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "AgreementTypeConsent", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "MicrosoftCloudAgreement", - "MicrosoftCustomerAgreement" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfServiceAccountAgreement" - } - } - } - }, - "post": { - "tags": [ - "CustomerTenantAgreements" - ], - "operationId": "Add", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "customerTenantId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "agreement", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ServiceAccountAgreement" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ServiceAccountAgreement" - } - } - } - } - }, - "/api/v1/CustomerTenants": { - "get": { - "tags": [ - "CustomerTenants" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ProgramId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ConsumerId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Domain", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "DomainPrefix", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "CustomerTenantType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "T1", - "T2" - ] - }, - { - "name": "InvoiceProfileId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfCustomerTenant" - } - } - } - }, - "post": { - "tags": [ - "CustomerTenants" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "customerTenant", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - } - } - } - }, - "/api/v1/CustomerTenants/{id}": { - "get": { - "tags": [ - "CustomerTenants" - ], - "operationId": "GetCustomerTenantById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CustomerTenant" - } - } - } - }, - "put": { - "tags": [ - "CustomerTenants" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "customerTenant", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - } - } - }, - "delete": { - "tags": [ - "CustomerTenants" - ], - "operationId": "DeleteCustomerById", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/CustomerTenants/{id}/detailed": { - "get": { - "tags": [ - "CustomerTenants" - ], - "operationId": "GetCustomerTenantDetailedById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - } - } - } - }, - "/api/v1/CustomerTenants/existing": { - "post": { - "tags": [ - "CustomerTenants" - ], - "operationId": "AddExisting", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "existingTenant", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - }, - { - "name": "syncFromPublisher", - "in": "query", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CustomerTenantDetailed" - } - } - } - } - }, - "/api/v1/CustomerTenants/{customerTenantId}/azurePlan": { - "get": { - "tags": [ - "CustomerTenants" - ], - "operationId": "GetAzurePlan", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "customerTenantId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/AzurePlan" - } - } - } - } - }, - "/api/v1/connect/token": { - "post": { - "tags": [ - "CustomerToken" - ], - "operationId": "Post", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Token" - } - } - } - } - }, - "/api/v1/FacebookOrders/checkout": { - "post": { - "tags": [ - "FacebookOrders" - ], - "operationId": "CheckoutAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "order", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/FacebookOrder" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/GoogleOrders/checkout": { - "post": { - "tags": [ - "GoogleOrders" - ], - "operationId": "CheckoutAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "order", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/GoogleOrder" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/Groupings": { - "get": { - "tags": [ - "Groupings" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "IncludeRemoved", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfGrouping" - } - } - } - }, - "post": { - "tags": [ - "Groupings" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "grouping", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Grouping" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Grouping" - } - } - } - } - }, - "/api/v1/Groupings/{id}": { - "get": { - "tags": [ - "Groupings" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Grouping" - } - } - } - }, - "put": { - "tags": [ - "Groupings" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "grouping", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Grouping" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Grouping" - } - } - } - }, - "delete": { - "tags": [ - "Groupings" - ], - "operationId": "Delete", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/InvoiceProfiles": { - "get": { - "tags": [ - "InvoiceProfiles" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfInvoiceProfile" - } - } - } - }, - "post": { - "tags": [ - "InvoiceProfiles" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "invoiceProfile", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/InvoiceProfile" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/InvoiceProfile" - } - } - } - } - }, - "/api/v1/InvoiceProfiles/{id}": { - "get": { - "tags": [ - "InvoiceProfiles" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/InvoiceProfile" - } - } - } - }, - "put": { - "tags": [ - "InvoiceProfiles" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "invoiceProfile", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/InvoiceProfile" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/InvoiceProfile" - } - } - } - }, - "delete": { - "tags": [ - "InvoiceProfiles" - ], - "operationId": "Delete", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/ManagementLinks": { - "get": { - "tags": [ - "ManagementLinks" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "SubscriptionIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "ResellerCustomerIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfManagementLink" - } - } - } - } - }, - "/api/v1/ManagementLinks/grouped": { - "get": { - "tags": [ - "ManagementLinks" - ], - "operationId": "GetGrouped", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "SubscriptionIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "ResellerCustomerIds", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfManagementLinkGrouped" - } - } - } - } - }, - "/api/v1/Me": { - "get": { - "tags": [ - "Me" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Me" - } - } - } - } - }, - "/api/v1/OrganizationAccess/grant": { - "get": { - "tags": [ - "OrganizationAccess" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "userId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "organizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 0 - }, - { - "name": "page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 1 - }, - { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 10000 - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfOrganizationAccess" - } - } - } - } - }, - "/api/v1/OrganizationAccess": { - "get": { - "tags": [ - "OrganizationAccess" - ], - "operationId": "GetOrganizationAccess", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "userId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "organizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 0 - }, - { - "name": "page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 1 - }, - { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32", - "default": 10000 - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfOrganizationAccess" - } - } - } - }, - "put": { - "tags": [ - "OrganizationAccess" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "list", - "in": "body", - "required": false, - "schema": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/OrganizationAccess" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/OrganizationAccess" - } - } - } - } - } - }, - "/api/v1/Organizations": { - "get": { - "tags": [ - "Organizations" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfOrganization" - } - } - } - } - }, - "/api/v1/Organizations/{id}": { - "get": { - "tags": [ - "Organizations" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Organization" - } - } - } - } - }, - "/api/v1/Organizations/{organizationId}/salescontact": { - "get": { - "tags": [ - "Organizations" - ], - "operationId": "GetOrganizationSalesContact", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/OrganizationSalesContact" - } - } - } - } - }, - "/api/v1/Organizations/HasAccess/{id}": { - "get": { - "tags": [ - "Organizations" - ], - "operationId": "HasAccessAsync", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/Ping": { - "get": { - "tags": [ - "Ping" - ], - "operationId": "Get", - "consumes": [], - "produces": [], - "parameters": [], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/ProductContainers": { - "get": { - "tags": [ - "ProductContainers" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ActiveDraft", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "ProgramId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Year", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Month", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "UserId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "SentByUserId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "Type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Draft", - "Request", - "Order", - "Quote", - "Template" - ] - }, - { - "name": "Category", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Seat", - "Report" - ] - }, - { - "name": "From", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "To", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "IncludeRemoved", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "IncludeSubsidiaries", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfProductContainer" - } - } - } - } - }, - "/api/v1/ProductContainers/{id}": { - "get": { - "tags": [ - "ProductContainers" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ProductContainer" - } - } - } - }, - "put": { - "tags": [ - "ProductContainers" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "productContainer", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ProductContainer" - } - }, - { - "name": "requireEulaAnalysis", - "in": "query", - "required": false, - "type": "boolean", - "default": false - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ProductContainer" - } - } - } - }, - "delete": { - "tags": [ - "ProductContainers" - ], - "operationId": "DeleteProductContainer", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/ProductContainers/rowissues/{id}": { - "get": { - "tags": [ - "ProductContainers" - ], - "operationId": "GetByIdWithRowIssues", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ProductContainer" - } - } - } - } - }, - "/api/v1/ProductContainers/{productContainerId}/row/{productRowId}": { - "patch": { - "tags": [ - "ProductContainers" - ], - "operationId": "PatchProductRow", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "productContainerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "productRowId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "productRowPatch", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ProductRowPatch" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ProductContainer" - } - } - } - } - }, - "/api/v1/ProductContainers/reportbymonth": { - "post": { - "tags": [ - "ProductContainers" - ], - "operationId": "CreateReportAsync", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "year", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "month", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "programId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "organizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "copyLast", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ProductContainer" - } - } - } - } - }, - "/api/v1/ProductContainers/getorcreateshoppingcart": { - "get": { - "tags": [ - "ProductContainers" - ], - "operationId": "GetOrCreateShoppingCart", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "organizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ProductContainer" - } - } - } - } - }, - "/api/v1/Programs": { - "get": { - "tags": [ - "Programs" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ProgramType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "License", - "Report", - "Cloud" - ] - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfProgram" - } - } - } - } - }, - "/api/v1/Programs/{id}": { - "get": { - "tags": [ - "Programs" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Program" - } - } - } - } - }, - "/api/v1/Publishers": { - "get": { - "tags": [ - "Publishers" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Names", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "uniqueItems": false - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "ProgramType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "License", - "Report", - "Cloud" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfPublisher" - } - } - } - } - }, - "/api/v1/Publishers/{id}": { - "get": { - "tags": [ - "Publishers" - ], - "operationId": "GetById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Publisher" - } - } - } - } - }, - "/api/v1/Regions": { - "get": { - "tags": [ - "Regions" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "RegionList", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "MicrosoftCsp", - "OrganizationSpecific" - ] - }, - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfRegion" - } - } - } - } - }, - "/api/v1/Regions/bycode": { - "get": { - "tags": [ - "Regions" - ], - "operationId": "GetByRegionCode", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "regionCode", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "regionList", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "MicrosoftCsp", - "OrganizationSpecific" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Region" - } - } - } - } - }, - "/api/v1/ResellerSalesPrices": { - "get": { - "tags": [ - "ResellerSalesPrices" - ], - "operationId": "GetAsync", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "License", - "Usage", - "OneTime" - ] - }, - { - "name": "ObjectId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ObjectType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "Organization", - "CustomerTenant", - "Subscription", - "SubscriptionAddon", - "AzureSubscription" - ] - }, - { - "name": "FromDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ResellerSalesPrice" - } - } - } - } - }, - "post": { - "tags": [ - "ResellerSalesPrices" - ], - "operationId": "PostAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerSalesPrice", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ResellerSalesPrice" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ResellerSalesPrice" - } - } - } - }, - "delete": { - "tags": [ - "ResellerSalesPrices" - ], - "operationId": "DeleteByFilterAsync", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "Type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "License", - "Usage", - "OneTime" - ] - }, - { - "name": "ObjectId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ObjectType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "Organization", - "CustomerTenant", - "Subscription", - "SubscriptionAddon", - "AzureSubscription" - ] - }, - { - "name": "FromDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/ResellerSalesPrices/current": { - "get": { - "tags": [ - "ResellerSalesPrices" - ], - "operationId": "GetCurrentAsync", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "License", - "Usage", - "OneTime" - ] - }, - { - "name": "ObjectId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "ObjectType", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "Organization", - "CustomerTenant", - "Subscription", - "SubscriptionAddon", - "AzureSubscription" - ] - }, - { - "name": "FromDate", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ResellerSalesPrice" - } - } - } - } - }, - "/api/v1/ResellerSalesPrices/{oldFromDate}": { - "put": { - "tags": [ - "ResellerSalesPrices" - ], - "operationId": "PutAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "oldFromDate", - "in": "path", - "required": true, - "type": "string", - "format": "date-time" - }, - { - "name": "resellerSalesPrice", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ResellerSalesPrice" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ResellerSalesPrice" - } - } - } - } - }, - "/api/v1/ResellerSalesPrices/toggle": { - "post": { - "tags": [ - "ResellerSalesPrices" - ], - "operationId": "ToggleAsync", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [], - "parameters": [ - { - "name": "resellerSalesPriceToggle", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ResellerSalesPriceToggle" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/Secrets": { - "post": { - "tags": [ - "Secrets" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "secret", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/Secret" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Secret" - } - } - } - }, - "delete": { - "tags": [ - "Secrets" - ], - "operationId": "Delete", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "clientId", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "secretId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/Subscriptions": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "CustomerTenantId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PublisherId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Refresh", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "Statuses", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "Active", - "Suspended", - "Deleted", - "CustomerCancellation", - "Converted", - "Inactive", - "All" - ] - }, - { - "name": "IsTrial", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "RegisteredForReservedInstance", - "in": "query", - "required": false, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscription" - } - } - } - }, - "post": { - "tags": [ - "Subscriptions" - ], - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "subscription", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubscriptionDetailed" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/SubscriptionDetailed" - } - } - } - } - }, - "/api/v1/Subscriptions/{id}": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "Subscription", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/SubscriptionDetailed" - } - } - } - }, - "put": { - "tags": [ - "Subscriptions" - ], - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "subscription", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubscriptionDetailed" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/SubscriptionDetailed" - } - } - } - } - }, - "/api/v1/Subscriptions/{subscriptionId}/conversions": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "GetSubscriptionConversions", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscriptionConversion" - } - } - } - }, - "post": { - "tags": [ - "Subscriptions" - ], - "operationId": "PostSubscriptionConversion", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "conversion", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubscriptionConversion" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/SubscriptionDetailed" - } - } - } - } - }, - "/api/v1/Subscriptions/{id}/activationlink": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "GetActivationLinkAsync", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ActivationLink" - } - } - } - } - }, - "/api/v1/Subscriptions/{reservedInstance}/subscriptionId/{id}": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "GetRegisterReservedInstance", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "reservedInstance", - "in": "path", - "required": true, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfBoolean" - } - } - } - }, - "post": { - "tags": [ - "Subscriptions" - ], - "operationId": "RegisterReservedInstance", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "reservedInstance", - "in": "path", - "required": true, - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/Subscriptions/subscriptionpricetypes": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "GetSubscriptionPriceTypes", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfObjectReference" - } - } - } - } - }, - "/api/v1/Subscriptions/{subscriptionId}/tags": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "GetSubscriptionTags", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/SubscriptionTags" - } - } - } - }, - "post": { - "tags": [ - "Subscriptions" - ], - "operationId": "SetSubscriptionTags", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "tags", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubscriptionTags" - } - }, - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - }, - "delete": { - "tags": [ - "Subscriptions" - ], - "operationId": "DeleteSubscriptionTags", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/api/v1/Subscriptions/{subscriptionId}/addon-offers": { - "get": { - "tags": [ - "Subscriptions" - ], - "operationId": "GetSubscriptionAddons", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscriptionAddOnOffer" - } - } - } - } - }, - "/api/v1/Subscriptions/{subscriptionId}/addons": { - "post": { - "tags": [ - "Subscriptions" - ], - "operationId": "SetSubscriptionAddon", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "addon", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PostSubscriptionAddOn" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/UsageCost/organization/{organizationId}": { - "get": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForOrganization", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "to", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfOrganizationUsageCost" - } - } - } - } - }, - "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/currency/{currencyCode}": { - "get": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForSubscription", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerCustomerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "currencyCode", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "to", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscriptionUsageCost" - } - } - }, - "deprecated": true - } - }, - "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/category/{category}/currency/{currencyCode}": { - "get": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForCategory", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerCustomerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "category", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "currencyCode", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "to", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfCategoryUsageCost" - } - } - }, - "deprecated": true - } - }, - "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/category/{category}/subcategory/{subcategory}/currency/{currencyCode}": { - "get": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForSubcategory", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerCustomerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "category", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "subcategory", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "currencyCode", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "to", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubcategoryUsageCost" - } - } - }, - "deprecated": true - } - }, - "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/currency/{currencyCode}/resourceGroups": { - "get": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForSubscriptionWithResourceGroups", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerCustomerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "currencyCode", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "to", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscriptionResourceGroupUsageCost" - } - } - }, - "deprecated": true - } - }, - "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/resourceGroup/{resourceGroup}/currency/{currencyCode}": { - "get": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForResourceGroup", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "resellerCustomerId", - "in": "path", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "resourceGroup", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "currencyCode", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "to", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfResourceGroupUsageCost" - } - } - }, - "deprecated": true - } - }, - "/api/v1/UsageCost/getForSubscription": { - "post": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForSubscription", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubscriptionUsageCostRequest" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscriptionUsageCost" - } - } - } - } - }, - "/api/v1/UsageCost/getForCategory": { - "post": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForCategory", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/CategoryUsageCostRequest" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfCategoryUsageCost" - } - } - } - } - }, - "/api/v1/UsageCost/getForSubcategory": { - "post": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForSubcategory", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubcategoryUsageCostRequest" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubcategoryUsageCost" - } - } - } - } - }, - "/api/v1/UsageCost/getForSubscription/resourceGroups": { - "post": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForSubscriptionWithResourceGroups", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/SubscriptionUsageCostRequest" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfSubscriptionResourceGroupUsageCost" - } - } - } - } - }, - "/api/v1/UsageCost/getForResourceGroup": { - "post": { - "tags": [ - "UsageCost" - ], - "operationId": "GetForResourceGroup", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ResourceGroupUsageCostRequest" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfResourceGroupUsageCost" - } - } - } - } - }, - "/api/v1/Users": { - "get": { - "tags": [ - "Users" - ], - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "Search", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "OrganizationId", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "Role", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "None", - "User", - "TenantAdmin" - ] - }, - { - "name": "Page", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "PageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ApiCollectionOfUser" - } - } - } - }, - "post": { - "tags": [ - "Users" - ], - "operationId": "AddUser", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "user", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/User" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/User" - } - } - } - } - }, - "/api/v1/Users/{id}": { - "get": { - "tags": [ - "Users" - ], - "operationId": "GetUserById", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/User" - } - } - } - }, - "put": { - "tags": [ - "Users" - ], - "operationId": "UpdateUser", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "user", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/User" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/User" - } - } - } - }, - "delete": { - "tags": [ - "Users" - ], - "operationId": "DeleteUser", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/v1/Users/user": { - "get": { - "tags": [ - "Users" - ], - "operationId": "GetUserByUserName", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "userName", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/User" - } - } - } - } - }, - "/api/v1/Users/{id}/changepassword": { - "put": { - "tags": [ - "Users" - ], - "operationId": "ChangePassword", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "changePassword", - "in": "body", - "required": false, - "schema": { - "$ref": "#/definitions/UserChangePassword" - } - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "boolean" - } - } - } - } - } - }, - "definitions": { - "ActivityLog": { - "type": "object", - "properties": { - "Entity": { - "type": "string" - }, - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ActivityLogItem" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ActivityLogItem": { - "type": "object", - "properties": { - "Entity": { - "type": "string" - }, - "Id": { - "format": "int32", - "type": "integer" - }, - "ChangedBy": { - "type": "string" - }, - "ChangedDate": { - "format": "date-time", - "type": "string" - }, - "ChangedColumn": { - "type": "string" - }, - "ChangedFrom": { - "type": "string" - }, - "ChangedTo": { - "type": "string" - }, - "CustomValues": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "ChangeType": { - "enum": [ - "Delete", - "Insert", - "Update" - ], - "type": "string" - } - } - }, - "ApiCollectionOfAddress": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Address" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Address": { - "type": "object", - "properties": { - "Id": { - "format": "int64", - "type": "integer" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "Name": { - "type": "string" - }, - "CompleteAddress": { - "type": "string" - }, - "Street": { - "type": "string" - }, - "ZipCode": { - "type": "string" - }, - "City": { - "type": "string" - }, - "County": { - "type": "string" - }, - "State": { - "type": "string" - }, - "CountryCode": { - "type": "string" - }, - "Primary": { - "type": "boolean" - }, - "AddressType": { - "enum": [ - "None", - "Invoice", - "Delivery" - ], - "type": "string" - } - } - }, - "ObjectReference": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "AgreementProductCollection": { - "type": "object", - "properties": { - "Publishers": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/PublisherAggregationItem" - } - }, - "Filter": { - "$ref": "#/definitions/AgreementProductFilter" - }, - "Pools": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "OperatingSystems": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Offerings": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Levels": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Languages": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "LicenseAgreementTypes": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "LicenseTypes": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "ProductFamilies": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Programs": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "ProductTypes": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "PurchasePeriods": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "PurchaseUnits": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Versions": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Regions": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "ProductCategories": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - }, - "Agreements": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ObjectReference" - } - }, - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AgreementProduct" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "PublisherAggregationItem": { - "type": "object", - "properties": { - "Key": { - "type": "string" - }, - "DocCount": { - "format": "int64", - "type": "integer" - }, - "Programs": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AggregationItem" - } - } - } - }, - "AgreementProductFilter": { - "type": "object", - "properties": { - "AgreementTypeIds": { - "uniqueItems": false, - "type": "array", - "items": { - "enum": [ - "None", - "LicenseAgreement", - "OpenAgreement", - "FrameAgreement", - "SamAgreement", - "ConsultingAgreement", - "CloudSeatAgreement", - "CloudUsageAgreement", - "ReportingAgreement", - "OtherAgreement", - "Reserved1", - "Reserved2", - "Reserved3" - ], - "type": "string" - } - }, - "Page": { - "format": "int32", - "type": "integer" - }, - "PageSize": { - "format": "int32", - "type": "integer" - }, - "Search": { - "type": "string" - }, - "PriceListId": { - "format": "int32", - "type": "integer" - }, - "OrganizationId": { - "format": "int32", - "type": "integer" - }, - "CustomerTenantId": { - "format": "int32", - "type": "integer" - }, - "AgreementId": { - "format": "int32", - "type": "integer" - }, - "IsTrial": { - "type": "boolean" - }, - "AgreementIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "SearchDate": { - "format": "date-time", - "type": "string" - }, - "Include": { - "$ref": "#/definitions/AgreementProductsSubFilter" - }, - "Exclude": { - "$ref": "#/definitions/AgreementProductsSubFilter" - }, - "SortKey": { - "type": "string" - }, - "IncludeProductInformation": { - "type": "boolean" - }, - "SortOrder": { - "enum": [ - "Ascending", - "Descending" - ], - "type": "string" - } - } - }, - "AggregationItem": { - "type": "object", - "properties": { - "Key": { - "type": "string" - }, - "DocCount": { - "format": "int64", - "type": "integer" - } - } - }, - "AgreementProduct": { - "type": "object", - "properties": { - "UniqueId": { - "type": "string" - }, - "ProductType": { - "enum": [ - "Product", - "Bundle", - "Service", - "Internal" - ], - "type": "string" - }, - "ProductVariant": { - "$ref": "#/definitions/ProductVariant" - }, - "Agreement": { - "$ref": "#/definitions/ObjectReference" - }, - "Name": { - "type": "string" - }, - "PriceId": { - "format": "int32", - "type": "integer" - }, - "RecommendedRetailPrice": { - "$ref": "#/definitions/Price" - }, - "SalesPrice": { - "$ref": "#/definitions/Price" - }, - "AlternativeSalesPrice": { - "$ref": "#/definitions/Price" - }, - "PriceListName": { - "type": "string" - }, - "MonthMultiplier": { - "format": "int32", - "type": "integer" - }, - "PriceCalculationType": { - "enum": [ - "None", - "Default", - "SelectPlus", - "AdobeVip", - "Mpsa" - ], - "type": "string" - }, - "AgreementType": { - "enum": [ - "None", - "LicenseAgreement", - "OpenAgreement", - "FrameAgreement", - "SamAgreement", - "ConsultingAgreement", - "CloudSeatAgreement", - "CloudUsageAgreement", - "ReportingAgreement", - "OtherAgreement", - "Reserved1", - "Reserved2", - "Reserved3" - ], - "type": "string" - }, - "ProductInformation": { - "$ref": "#/definitions/ProductInformation" - }, - "MinimumQuantity": { - "format": "int32", - "type": "integer" - }, - "MaximumQuantity": { - "format": "int32", - "type": "integer" - } - } - }, - "AgreementProductsSubFilter": { - "type": "object", - "properties": { - "PartNumbers": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "PublisherIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "PublisherNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "PoolNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "OperatingSystemNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "LevelNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "LanguageNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "LicenseAgreementTypeNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "LicenseTypeNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "ProductFamilyNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "ProductTypeNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "ProgramNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "OfferingNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "PurchasePeriodNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "PurchaseUnitNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "VersionNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "RegionNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "ProductCategoryNames": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ProductVariant": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Product": { - "$ref": "#/definitions/ProductReference" - }, - "PartNumber": { - "type": "string" - }, - "ProductName": { - "type": "string" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Program": { - "$ref": "#/definitions/ObjectReference" - }, - "ProductFamily": { - "$ref": "#/definitions/ObjectReference" - }, - "Language": { - "$ref": "#/definitions/ObjectReference" - }, - "Level": { - "$ref": "#/definitions/ObjectReference" - }, - "ProductType": { - "$ref": "#/definitions/ObjectReference" - }, - "Pool": { - "$ref": "#/definitions/ObjectReference" - }, - "LicenseType": { - "$ref": "#/definitions/ObjectReference" - }, - "LicenseAgreementType": { - "$ref": "#/definitions/ObjectReference" - }, - "OperatingSystem": { - "$ref": "#/definitions/ObjectReference" - }, - "Offering": { - "$ref": "#/definitions/ObjectReference" - }, - "MinimumCommitment": { - "$ref": "#/definitions/MinimumCommitmentLight" - }, - "UnitCount": { - "format": "int32", - "type": "integer" - }, - "Version": { - "type": "string" - }, - "PurchaseUnit": { - "type": "string" - }, - "AddDate": { - "format": "date-time", - "type": "string" - }, - "DeleteDate": { - "format": "date-time", - "type": "string" - }, - "ProductCategory": { - "type": "string" - }, - "Region": { - "type": "string" - }, - "IsTrial": { - "type": "boolean" - }, - "DefaultBillingCycleId": { - "format": "int32", - "type": "integer" - }, - "AvailableBillingCycleIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "Attributes": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - }, - "Price": { - "type": "object", - "properties": { - "Value": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "ProductInformation": { - "type": "object", - "properties": { - "ExternalProductId": { - "format": "int32", - "type": "integer" - }, - "CultureCode": { - "type": "string" - }, - "Description": { - "type": "string" - }, - "LearnMoreLink": { - "type": "string" - } - } - }, - "ProductReference": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "PartNumber": { - "type": "string" - }, - "PublisherProductId": { - "type": "string" - }, - "ItemLegalName": { - "type": "string" - }, - "ItemName": { - "type": "string" - } - } - }, - "MinimumCommitmentLight": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Months": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "ApiCollectionOfAgreementReport": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AgreementReport" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "AgreementReport": { - "type": "object", - "properties": { - "ProductContainer": { - "$ref": "#/definitions/ObjectReferenceDto" - }, - "Agreement": { - "$ref": "#/definitions/AgreementIdentityReferenceDto" - }, - "Status": { - "enum": [ - "None", - "NotReported", - "ZeroUsageReported", - "UsageReported", - "UsageAndZeroUsageReported" - ], - "type": "string" - }, - "HasValidAgreementTerm": { - "type": "boolean" - } - } - }, - "ObjectReferenceDto": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "AgreementIdentityReferenceDto": { - "type": "object", - "properties": { - "AgreementNumber": { - "type": "string" - }, - "CommitmentLevel": { - "format": "double", - "type": "number" - }, - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "AgreementCollection": { - "type": "object", - "properties": { - "Filter": { - "$ref": "#/definitions/AgreementFilter" - }, - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Agreement" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "AgreementFilter": { - "type": "object", - "properties": { - "OrganizationId": { - "format": "int32", - "type": "integer" - }, - "OrganizationIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "PricelistIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "Status": { - "enum": [ - "None", - "Active", - "Inactive", - "ActiveInactive" - ], - "type": "string" - }, - "AgreementTypes": { - "uniqueItems": false, - "type": "array", - "items": { - "enum": [ - "None", - "LicenseAgreement", - "OpenAgreement", - "FrameAgreement", - "SamAgreement", - "ConsultingAgreement", - "CloudSeatAgreement", - "CloudUsageAgreement", - "ReportingAgreement", - "OtherAgreement", - "Reserved1", - "Reserved2", - "Reserved3" - ], - "type": "string" - } - }, - "PublisherIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "ProgramIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "SearchDate": { - "format": "date-time", - "type": "string" - }, - "AgreementIds": { - "uniqueItems": false, - "type": "array", - "items": { - "format": "int32", - "type": "integer" - } - }, - "SalesPriceCurrency": { - "type": "string" - }, - "TermRequired": { - "type": "boolean" - }, - "PublisherId": { - "format": "int32", - "type": "integer" - }, - "EndDateFrom": { - "format": "date-time", - "type": "string" - }, - "EndDateTo": { - "format": "date-time", - "type": "string" - }, - "Page": { - "format": "int32", - "type": "integer" - }, - "PageSize": { - "format": "int32", - "type": "integer" - }, - "Search": { - "type": "string" - } - } - }, - "Agreement": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "Name": { - "type": "string" - }, - "SalesPriceCurrencyCode": { - "type": "string" - }, - "StartDate": { - "format": "date-time", - "type": "string" - }, - "EndDate": { - "format": "date-time", - "type": "string" - }, - "Disabled": { - "type": "boolean" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Program": { - "$ref": "#/definitions/ObjectReference" - }, - "Number": { - "type": "string" - }, - "CustomerNumber": { - "type": "string" - }, - "MasterAgreement": { - "type": "string" - }, - "HasTerms": { - "type": "boolean" - }, - "AgreementType": { - "enum": [ - "None", - "LicenseAgreement", - "OpenAgreement", - "FrameAgreement", - "SamAgreement", - "ConsultingAgreement", - "CloudSeatAgreement", - "CloudUsageAgreement", - "ReportingAgreement", - "OtherAgreement", - "Reserved1", - "Reserved2", - "Reserved3" - ], - "type": "string" - }, - "ParentAgreementId": { - "format": "int32", - "type": "integer" - }, - "CommitmentLevel": { - "format": "double", - "type": "number" - } - } - }, - "ApiCollectionOfAsset": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Asset" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Asset": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Status": { - "enum": [ - "None", - "Fulfilling", - "Succeeded", - "Cancelled", - "Expired", - "All" - ], - "type": "string" - }, - "ExternalOrderId": { - "type": "string" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "ProductId": { - "format": "int32", - "type": "integer" - }, - "ProductVariantId": { - "format": "int32", - "type": "integer" - }, - "StartDate": { - "format": "date-time", - "type": "string" - }, - "ExpirationDate": { - "format": "date-time", - "type": "string" - }, - "ResellerCustomerId": { - "format": "int32", - "type": "integer" - }, - "Scope": { - "enum": [ - "Shared", - "Single" - ], - "type": "string" - }, - "AssetType": { - "enum": [ - "Reservation", - "Software", - "Subscription" - ], - "type": "string" - }, - "BillingCycle": { - "enum": [ - "Unknown", - "Monthly", - "Annual", - "None", - "OneTime" - ], - "type": "string" - }, - "PublisherId": { - "format": "int32", - "type": "integer" - }, - "ProgramId": { - "format": "int32", - "type": "integer" - }, - "ReservationId": { - "type": "string" - }, - "ReservationUsedInSubscriptionId": { - "format": "int32", - "type": "integer" - }, - "ReservationUsedInSubscription": { - "$ref": "#/definitions/SubscriptionLite" - }, - "PurchaseCurrency": { - "type": "string" - }, - "PurchasePrice": { - "format": "double", - "type": "number" - }, - "SalesCurrency": { - "type": "string" - }, - "SalesPrice": { - "format": "double", - "type": "number" - }, - "CreatedDate": { - "format": "date-time", - "type": "string" - }, - "ModifiedDate": { - "format": "date-time", - "type": "string" - }, - "ChangedBy": { - "type": "string" - }, - "ResellerPriceType": { - "enum": [ - "None", - "Margin", - "Markup", - "FixedPrice", - "ListPrice" - ], - "type": "string" - }, - "ResellerPriceTypeValue": { - "format": "double", - "type": "number" - }, - "ReservedInstanceArtifactResourceId": { - "type": "string" - }, - "PurchaseDate": { - "format": "date-time", - "type": "string" - }, - "ProductVariant": { - "$ref": "#/definitions/ProductVariant" - }, - "Tags": { - "$ref": "#/definitions/AssetTags" - } - } - }, - "SubscriptionLite": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "PublisherSubscriptionId": { - "type": "string" - }, - "ResellerCustomerName": { - "type": "string" - } - } - }, - "AssetTags": { - "type": "object", - "properties": { - "AssetId": { - "format": "int32", - "type": "integer" - }, - "CostCenter": { - "type": "string" - }, - "Department": { - "type": "string" - }, - "Project": { - "type": "string" - }, - "Custom": { - "type": "string" - }, - "Owner": { - "type": "string" - } - } - }, - "ApiCollectionOfAssetOrder": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssetOrder" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "AssetOrder": { - "type": "object", - "properties": { - "ExternalOrderId": { - "type": "string" - }, - "CountryCode": { - "type": "string" - }, - "ResellerCustomerId": { - "format": "int32", - "type": "integer" - }, - "AdminAccount": { - "type": "string" - }, - "NotificationEmail": { - "type": "string" - }, - "Errors": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssetOrderError" - } - }, - "OrderLines": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssetOrderLine" - } - } - } - }, - "AssetOrderError": { - "type": "object", - "properties": { - "OrderGroupId": { - "type": "string" - }, - "Code": { - "format": "int32", - "type": "integer" - }, - "Description": { - "type": "string" - } - } - }, - "AssetOrderLine": { - "type": "object", - "properties": { - "ProductId": { - "type": "string" - }, - "SubscriptionId": { - "format": "int32", - "type": "integer" - }, - "ArmRegionName": { - "type": "string" - }, - "SkuId": { - "type": "string" - }, - "ProductVariantId": { - "format": "int32", - "type": "integer" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "BillingCycle": { - "enum": [ - "Unknown", - "Monthly", - "Annual", - "None", - "OneTime" - ], - "type": "string" - }, - "ProvisioningContext": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "Type": { - "enum": [ - "Reservation", - "Software", - "Subscription" - ], - "type": "string" - }, - "RequiresInventoryCheck": { - "type": "boolean" - }, - "CatalogItemId": { - "type": "string" - }, - "TermDuration": { - "type": "string" - }, - "Scope": { - "enum": [ - "Shared", - "Single" - ], - "type": "string" - }, - "ResellerPriceType": { - "enum": [ - "None", - "Margin", - "Markup", - "FixedPrice", - "ListPrice" - ], - "type": "string" - }, - "ResellerPriceTypeValue": { - "format": "double", - "type": "number" - }, - "Tags": { - "$ref": "#/definitions/AssetTags" - }, - "Errors": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssetOrderLineError" - } - } - } - }, - "AssetOrderLineError": { - "type": "object", - "properties": { - "ReasonCode": { - "type": "string" - }, - "Description": { - "type": "string" - }, - "Properties": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "ApiCollectionOfAwsAccount": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AwsAccount" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "AwsAccount": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "ExternalPublisherCustomerId": { - "type": "string" - }, - "Reference": { - "type": "string" - }, - "CustomerTenantType": { - "enum": [ - "None", - "T1", - "T2" - ], - "type": "string" - }, - "EntityStatus": { - "enum": [ - "None", - "Removed" - ], - "type": "string" - }, - "Organization": { - "$ref": "#/definitions/Organization" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "IsActivated": { - "type": "boolean" - }, - "Tags": { - "$ref": "#/definitions/SubscriptionTags" - } - } - }, - "Organization": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "ParentId": { - "format": "int32", - "type": "integer" - }, - "CrayonCompanyName": { - "type": "string" - }, - "AccountNumber": { - "type": "string" - } - } - }, - "SubscriptionTags": { - "type": "object", - "properties": { - "SubscriptionId": { - "format": "int32", - "type": "integer" - }, - "CostCenter": { - "type": "string" - }, - "Department": { - "type": "string" - }, - "Project": { - "type": "string" - }, - "Custom": { - "type": "string" - }, - "Owner": { - "type": "string" - }, - "CreatedDate": { - "format": "date-time", - "type": "string" - }, - "ModifiedDate": { - "format": "date-time", - "type": "string" - } - } - }, - "AzurePlan": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "PublisherSubscriptionId": { - "type": "string" - }, - "Status": { - "enum": [ - "None", - "Active", - "Suspended", - "Deleted", - "CustomerCancellation", - "Converted", - "Inactive", - "All" - ], - "type": "string" - }, - "RegisteredForReservedInstance": { - "type": "boolean" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "CustomerTenant": { - "$ref": "#/definitions/CustomerTenantReference" - } - } - }, - "CustomerTenantReference": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - } - } - }, - "ApiCollectionOfAzureSubscription": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AzureSubscription" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "AzureSubscription": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "AzurePlanId": { - "format": "int32", - "type": "integer" - }, - "PublisherSubscriptionId": { - "type": "string" - }, - "FriendlyName": { - "type": "string" - }, - "Status": { - "type": "string" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Tags": { - "$ref": "#/definitions/AzureSubscriptionTags" - } - } - }, - "AzureSubscriptionTags": { - "type": "object", - "properties": { - "CostCenter": { - "type": "string" - }, - "Department": { - "type": "string" - }, - "Project": { - "type": "string" - }, - "Custom": { - "type": "string" - }, - "Owner": { - "type": "string" - } - } - }, - "CreateAzureSubscriptionRequest": { - "type": "object", - "properties": { - "Name": { - "type": "string" - } - } - }, - "PutAzureSubscription": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Tags": { - "$ref": "#/definitions/AzureSubscriptionTags" - } - } - }, - "AzureSubscriptionAssignAdmin": { - "type": "object", - "properties": { - "AzurePlanId": { - "format": "int32", - "type": "integer" - }, - "AzureSubscriptionId": { - "format": "int32", - "type": "integer" - }, - "AdminEmail": { - "type": "string" - } - } - }, - "AzureSubscriptionUpdated": { - "type": "object", - "properties": { - "AzureSubscriptionId": { - "type": "string" - } - } - }, - "AzureSubscriptionRename": { - "type": "object", - "properties": { - "AzurePlanId": { - "format": "int32", - "type": "integer" - }, - "AzureSubscriptionId": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "ApiCollectionOfBillingCycle": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/BillingCycle" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "BillingCycle": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "ApiCollectionOfBillingStatement": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/BillingStatement" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "BillingStatement": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "TotalSalesPrice": { - "$ref": "#/definitions/Price" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "StartDate": { - "format": "date-time", - "type": "string" - }, - "EndDate": { - "format": "date-time", - "type": "string" - }, - "ProvisionType": { - "enum": [ - "None", - "Seat", - "Usage", - "OneTime", - "Crayon", - "AzureMarketplace" - ], - "type": "string" - }, - "OrderId": { - "type": "string" - } - } - }, - "ApiCollectionOfGroupedBillingStatement": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/GroupedBillingStatement" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "GroupedBillingStatement": { - "type": "object", - "properties": { - "GroupId": { - "format": "int32", - "type": "integer" - }, - "Id": { - "format": "int32", - "type": "integer" - }, - "TotalSalesPrice": { - "$ref": "#/definitions/Price" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "StartDate": { - "format": "date-time", - "type": "string" - }, - "EndDate": { - "format": "date-time", - "type": "string" - }, - "ProvisionType": { - "enum": [ - "None", - "Seat", - "Usage", - "OneTime", - "Crayon", - "AzureMarketplace" - ], - "type": "string" - }, - "OrderId": { - "type": "string" - } - } - }, - "ApiCollectionOfBlogItem": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/BlogItem" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "BlogItem": { - "type": "object", - "properties": { - "Title": { - "type": "string" - }, - "Author": { - "type": "string" - }, - "Description": { - "type": "string" - }, - "Image": { - "type": "string" - }, - "Link": { - "type": "string" - }, - "PublicationDate": { - "format": "date-time", - "type": "string" - } - } - }, - "ApiCollectionOfClient": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Client" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Client": { - "type": "object", - "properties": { - "ClientId": { - "type": "string" - }, - "ClientName": { - "type": "string" - }, - "ClientUri": { - "type": "string" - }, - "Enabled": { - "type": "boolean" - }, - "ClientSecrets": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Secret" - } - }, - "RedirectUris": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - }, - "TimeStamp": { - "format": "date-time", - "type": "string" - }, - "Flow": { - "enum": [ - "AuthorizationCode", - "Implicit", - "ResourceOwner", - "Other" - ], - "type": "string" - } - } - }, - "Secret": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "ClientId": { - "type": "string" - }, - "Value": { - "type": "string" - }, - "Description": { - "type": "string" - }, - "Expiration": { - "format": "date-time", - "type": "string" - }, - "TimeStamp": { - "format": "date-time", - "type": "string" - } - } - }, - "ApiCollectionOfConsumer": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Consumer" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Consumer": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - } - } - }, - "ApiCollectionOfCrayonAccount": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/CrayonAccount" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "CrayonAccount": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "ExternalPublisherCustomerId": { - "type": "string" - }, - "Reference": { - "type": "string" - }, - "CustomerTenantType": { - "enum": [ - "None", - "T1", - "T2" - ], - "type": "string" - }, - "EntityStatus": { - "enum": [ - "None", - "Removed" - ], - "type": "string" - }, - "Organization": { - "$ref": "#/definitions/Organization" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "IsActivated": { - "type": "boolean" - }, - "Contact": { - "$ref": "#/definitions/CustomerTenantContact" - }, - "Program": { - "$ref": "#/definitions/ObjectReference" - }, - "ResellerMarkup": { - "format": "double", - "type": "number" - } - } - }, - "CustomerTenantContact": { - "type": "object", - "properties": { - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "PhoneNumber": { - "type": "string" - } - } - }, - "ApiCollectionOfServiceAccountAgreement": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ServiceAccountAgreement" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ServiceAccountAgreement": { - "type": "object", - "properties": { - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "PhoneNumber": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "DateAgreed": { - "format": "date-time", - "type": "string" - }, - "AgreementType": { - "enum": [ - "MicrosoftCloudAgreement", - "MicrosoftCustomerAgreement" - ], - "type": "string" - } - } - }, - "ApiCollectionOfCustomerTenant": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/CustomerTenant" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "CustomerTenant": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Program": { - "$ref": "#/definitions/ObjectReference" - }, - "PublisherCustomerId": { - "type": "string" - }, - "ExternalPublisherCustomerId": { - "type": "string" - }, - "Domain": { - "type": "string" - }, - "DomainPrefix": { - "type": "string" - }, - "Reference": { - "type": "string" - }, - "CustomerTenantType": { - "enum": [ - "None", - "T1", - "T2" - ], - "type": "string" - }, - "EntityStatus": { - "enum": [ - "None", - "Removed" - ], - "type": "string" - }, - "Organization": { - "$ref": "#/definitions/Organization" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Consumer": { - "$ref": "#/definitions/ObjectReference" - }, - "ResellerMarkup": { - "format": "double", - "type": "number" - }, - "DefaultSubscriptionPriceType": { - "enum": [ - "PurchasePrice", - "ListPrice", - "FixedPrice" - ], - "type": "string" - }, - "agreement": { - "$ref": "#/definitions/CustomerTenantAgreement" - } - } - }, - "CustomerTenantAgreement": { - "type": "object", - "properties": { - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "PhoneNumber": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "SameAsPrimaryContact": { - "type": "boolean" - }, - "DateAgreed": { - "format": "date-time", - "type": "string" - }, - "Accepted": { - "type": "boolean" - }, - "AgreementType": { - "enum": [ - "MicrosoftCloudAgreement", - "MicrosoftCustomerAgreement" - ], - "type": "string" - } - } - }, - "CustomerTenantDetailed": { - "type": "object", - "properties": { - "Tenant": { - "$ref": "#/definitions/CustomerTenant" - }, - "User": { - "$ref": "#/definitions/CustomerTenantUser" - }, - "Profile": { - "$ref": "#/definitions/CustomerTenantProfile" - } - } - }, - "CustomerTenantUser": { - "type": "object", - "properties": { - "UserName": { - "type": "string" - }, - "Password": { - "type": "string" - } - } - }, - "CustomerTenantProfile": { - "type": "object", - "properties": { - "CultureCode": { - "type": "string" - }, - "LanguageCode": { - "type": "string" - }, - "Contact": { - "$ref": "#/definitions/CustomerTenantContact" - }, - "Address": { - "$ref": "#/definitions/CustomerTenantAddress" - }, - "Agreement": { - "$ref": "#/definitions/CustomerTenantAgreement" - } - } - }, - "CustomerTenantAddress": { - "type": "object", - "properties": { - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "AddressLine1": { - "type": "string" - }, - "AddressLine2": { - "type": "string" - }, - "AddressLine3": { - "type": "string" - }, - "City": { - "type": "string" - }, - "Region": { - "type": "string" - }, - "PostalCode": { - "type": "string" - }, - "CountryCode": { - "type": "string" - }, - "CountryName": { - "type": "string" - } - } - }, - "Token": { - "type": "object", - "properties": { - "AccessToken": { - "type": "string" - }, - "IdentityToken": { - "type": "string" - }, - "Error": { - "type": "string" - }, - "ExpiresIn": { - "format": "int64", - "type": "integer" - }, - "TokenType": { - "type": "string" - }, - "RefreshToken": { - "type": "string" - } - } - }, - "FacebookOrder": { - "type": "object", - "properties": { - "Lines": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/FacebookOrderLine" - } - }, - "ContactName": { - "type": "string" - }, - "ContactEmail": { - "type": "string" - }, - "ConsumerContactName": { - "type": "string" - }, - "ConsumerFullLegalName": { - "type": "string" - }, - "ConsumerContactEmail": { - "type": "string" - }, - "OrganizationId": { - "format": "int32", - "type": "integer" - }, - "InvoiceProfileId": { - "format": "int32", - "type": "integer" - }, - "SubscriptionStartDate": { - "format": "date-time", - "type": "string" - }, - "ConsumerSignupEmail": { - "type": "string" - } - } - }, - "FacebookOrderLine": { - "type": "object", - "properties": { - "PublisherId": { - "format": "int32", - "type": "integer" - }, - "AgreementId": { - "format": "int32", - "type": "integer" - }, - "ProductVariantId": { - "format": "int32", - "type": "integer" - }, - "Sku": { - "type": "string" - }, - "Quantity": { - "format": "int32", - "type": "integer" - } - } - }, - "GoogleOrder": { - "type": "object", - "properties": { - "Lines": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/GoogleOrderLine" - } - }, - "ContactName": { - "type": "string" - }, - "ContactEmail": { - "type": "string" - }, - "ConsumerContactName": { - "type": "string" - }, - "ConsumerFullLegalName": { - "type": "string" - }, - "ConsumerContactEmail": { - "type": "string" - }, - "OrganizationId": { - "format": "int32", - "type": "integer" - }, - "InvoiceProfileId": { - "format": "int32", - "type": "integer" - }, - "SubscriptionStartDate": { - "format": "date-time", - "type": "string" - }, - "DomainName": { - "type": "string" - }, - "ConsumerCountry": { - "type": "string" - }, - "ConsumerStreetAddress": { - "type": "string" - }, - "ConsumerCity": { - "type": "string" - }, - "ConsumerState": { - "type": "string" - }, - "ConsumerZipCode": { - "type": "string" - }, - "ConsumerPhoneNumber": { - "type": "string" - }, - "PrimaryAdminName": { - "type": "string" - }, - "PrimaryAdminUserName": { - "type": "string" - } - } - }, - "GoogleOrderLine": { - "type": "object", - "properties": { - "PublisherId": { - "format": "int32", - "type": "integer" - }, - "AgreementId": { - "format": "int32", - "type": "integer" - }, - "ProductVariantId": { - "format": "int32", - "type": "integer" - }, - "Sku": { - "type": "string" - }, - "Quantity": { - "format": "int32", - "type": "integer" - } - } - }, - "ApiCollectionOfGrouping": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Grouping" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Grouping": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "CreatedDate": { - "format": "date-time", - "type": "string" - }, - "ModifiedDate": { - "format": "date-time", - "type": "string" - }, - "IsDisabled": { - "type": "boolean" - }, - "IsRemoved": { - "type": "boolean" - }, - "InvoiceReference": { - "type": "string" - } - } - }, - "ApiCollectionOfInvoiceProfile": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/InvoiceProfile" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "InvoiceProfile": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "Name": { - "type": "string" - }, - "InvoiceReference": { - "type": "string" - }, - "CustomerReference": { - "type": "string" - }, - "RequisitionNumber": { - "type": "string" - }, - "InvoiceAddressId": { - "format": "int64", - "type": "integer" - }, - "DeliveryAddressId": { - "format": "int64", - "type": "integer" - }, - "DeliveryAddress": { - "$ref": "#/definitions/AddressData" - }, - "InvoiceAddress": { - "$ref": "#/definitions/AddressData" - } - } - }, - "AddressData": { - "type": "object", - "properties": { - "AxAddressId": { - "format": "int64", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "CompleteAddress": { - "type": "string" - }, - "Street": { - "type": "string" - }, - "ZipCode": { - "type": "string" - }, - "City": { - "type": "string" - }, - "County": { - "type": "string" - }, - "State": { - "type": "string" - }, - "CountryCode": { - "type": "string" - } - } - }, - "ApiCollectionOfManagementLink": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ManagementLink" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ManagementLink": { - "type": "object", - "properties": { - "Link": { - "type": "string" - }, - "ResellerCustomer": { - "$ref": "#/definitions/ObjectReference" - }, - "Subscription": { - "$ref": "#/definitions/ObjectReference" - }, - "Text": { - "type": "string" - } - } - }, - "ApiCollectionOfManagementLinkGrouped": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ManagementLinkGrouped" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ManagementLinkGrouped": { - "type": "object", - "properties": { - "Link": { - "type": "string" - }, - "ResellerCustomer": { - "$ref": "#/definitions/ObjectReference" - }, - "Text": { - "type": "string" - } - } - }, - "Me": { - "type": "object", - "properties": { - "UserId": { - "type": "string" - }, - "UserName": { - "type": "string" - }, - "Token": { - "type": "string" - }, - "Claims": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ApiCollectionOfOrganizationAccess": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/OrganizationAccess" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "OrganizationAccess": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "AllAgreements": { - "type": "boolean" - }, - "Agreements": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AgreementAccess" - } - }, - "Organization": { - "$ref": "#/definitions/Organization" - }, - "User": { - "$ref": "#/definitions/UserProfile" - }, - "Role": { - "enum": [ - "None", - "User", - "Administrator", - "Viewer", - "EditRights", - "All" - ], - "type": "string" - }, - "CrayonCompanyName": { - "type": "string" - }, - "Timestamp": { - "format": "date-time", - "type": "string" - } - } - }, - "AgreementAccess": { - "type": "object", - "properties": { - "HasAccess": { - "type": "boolean" - }, - "Agreement": { - "$ref": "#/definitions/Agreement" - } - } - }, - "UserProfile": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "UserName": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - } - } - }, - "ApiCollectionOfOrganization": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Organization" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "OrganizationSalesContact": { - "type": "object", - "properties": { - "FullName": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "Phone": { - "type": "string" - } - } - }, - "ApiCollectionOfProductContainer": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ProductContainer" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ProductContainer": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "OrderListId": { - "format": "int32", - "type": "integer" - }, - "Note": { - "type": "string" - }, - "UsageMonth": { - "format": "date-time", - "type": "string" - }, - "Name": { - "type": "string" - }, - "ActiveDraft": { - "type": "boolean" - }, - "Removed": { - "type": "boolean" - }, - "CreatedByUserId": { - "type": "string" - }, - "AxContactUserId": { - "type": "string" - }, - "CreatedDate": { - "format": "date-time", - "type": "string" - }, - "OrderStatusChangedDate": { - "format": "date-time", - "type": "string" - }, - "ContactUser": { - "$ref": "#/definitions/UserProfile" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Program": { - "$ref": "#/definitions/Program" - }, - "ProductRows": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ProductRow" - } - }, - "Comments": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ProductContainerComment" - } - }, - "InvoiceProfile": { - "$ref": "#/definitions/InvoiceProfile" - }, - "DeliveryAddress": { - "$ref": "#/definitions/AddressData" - }, - "InvoiceAddress": { - "$ref": "#/definitions/AddressData" - }, - "Type": { - "enum": [ - "None", - "Draft", - "Request", - "Order", - "Quote", - "Template" - ], - "type": "string" - }, - "Category": { - "enum": [ - "None", - "Seat", - "Report" - ], - "type": "string" - }, - "QuoteValidToDate": { - "format": "date-time", - "type": "string" - }, - "TotalSalesPrice": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Price" - } - }, - "TotalAlternativeSalesPrice": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Price" - } - }, - "Issues": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ProductContainerIssue" - } - }, - "SubmittedBy": { - "$ref": "#/definitions/ProductContainerCommentUser", - "readOnly": true - }, - "Sent": { - "format": "date-time", - "type": "string", - "readOnly": true - }, - "InvoiceReference": { - "type": "string" - }, - "OrderReference": { - "type": "string" - }, - "Requisition": { - "type": "string" - } - } - }, - "Program": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "IsCommitment": { - "type": "boolean" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - } - } - }, - "ProductRow": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "ProductContainerId": { - "format": "int32", - "type": "integer" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "Comment": { - "type": "string" - }, - "UsageCountryCode": { - "type": "string" - }, - "SalesUnitPrice": { - "$ref": "#/definitions/Price" - }, - "AlternativeSalesUnitPrice": { - "$ref": "#/definitions/Price" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Program": { - "$ref": "#/definitions/ObjectReference" - }, - "Agreement": { - "$ref": "#/definitions/AgreementIdentityReference" - }, - "Product": { - "$ref": "#/definitions/ProductReference" - }, - "User": { - "$ref": "#/definitions/ProductRowUser" - }, - "ProductVariant": { - "$ref": "#/definitions/ObjectReference" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "Grouping": { - "$ref": "#/definitions/Grouping" - }, - "Issues": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ProductContainerIssue" - } - }, - "OfferingType": { - "type": "string" - }, - "PriceCalculation": { - "enum": [ - "None", - "Default", - "SelectPlus", - "AdobeVip", - "Mpsa" - ], - "type": "string" - }, - "InvoiceReference": { - "type": "string" - }, - "CustomerReference": { - "type": "string" - }, - "SalesPricePerAlternativeUnit": { - "format": "double", - "type": "number" - }, - "LevelValue": { - "format": "double", - "type": "number" - } - } - }, - "ProductContainerComment": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "ProductContainerId": { - "format": "int32", - "type": "integer" - }, - "User": { - "$ref": "#/definitions/ProductContainerCommentUser" - }, - "Message": { - "type": "string" - }, - "TimeStamp": { - "format": "date-time", - "type": "string" - }, - "Modified": { - "format": "date-time", - "type": "string" - }, - "Removed": { - "type": "boolean" - }, - "ProductContainerCommentType": { - "enum": [ - "None", - "Comment", - "DraftCreated", - "DraftModified", - "QuoteCreated", - "QuoteModified", - "RequestCreated", - "RequestModifed", - "OrderSubmitted", - "OrderInvoiced", - "Removed", - "TemplateCreated", - "TemplateModifed", - "RequestDeclined", - "SystemMessage" - ], - "type": "string" - } - } - }, - "ProductContainerIssue": { - "type": "object", - "properties": { - "Code": { - "type": "string" - }, - "Message": { - "type": "string" - } - } - }, - "ProductContainerCommentUser": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "UserName": { - "type": "string" - }, - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "CrayonEmployee": { - "type": "boolean" - } - } - }, - "AgreementIdentityReference": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "AgreementNumber": { - "type": "string" - }, - "CommitmentLevel": { - "format": "double", - "type": "number" - } - } - }, - "ProductRowUser": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "UserName": { - "type": "string" - }, - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "CrayonEmployee": { - "type": "boolean" - } - } - }, - "ProductRowPatch": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "Comment": { - "type": "string" - }, - "UsageCountryCode": { - "type": "string" - }, - "UserId": { - "type": "string" - }, - "Agreement": { - "$ref": "#/definitions/ObjectReference" - }, - "ProductVariant": { - "$ref": "#/definitions/ObjectReference" - }, - "Grouping": { - "$ref": "#/definitions/ObjectReference" - } - } - }, - "ApiCollectionOfProgram": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Program" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ApiCollectionOfPublisher": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Publisher" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Publisher": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - } - } - }, - "ApiCollectionOfRegion": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Region" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Region": { - "type": "object", - "properties": { - "Code": { - "type": "string" - }, - "Name": { - "type": "string" - } - } - }, - "ResellerSalesPrice": { - "type": "object", - "properties": { - "ObjectId": { - "format": "int32", - "type": "integer" - }, - "ObjectType": { - "enum": [ - "Organization", - "CustomerTenant", - "Subscription", - "SubscriptionAddon", - "AzureSubscription" - ], - "type": "string" - }, - "Type": { - "enum": [ - "License", - "Usage", - "OneTime" - ], - "type": "string" - }, - "PriceType": { - "enum": [ - "Markup", - "FixedPrice", - "ListPrice" - ], - "type": "string" - }, - "Value": { - "format": "double", - "type": "number" - }, - "FromDate": { - "format": "date-time", - "type": "string" - } - } - }, - "ResellerSalesPriceToggle": { - "type": "object", - "properties": { - "Toggle": { - "type": "boolean" - }, - "ObjectId": { - "format": "int32", - "type": "integer" - }, - "ObjectType": { - "enum": [ - "Organization", - "CustomerTenant", - "Subscription", - "SubscriptionAddon", - "AzureSubscription" - ], - "type": "string" - } - } - }, - "ApiCollectionOfSubscription": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/Subscription" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "Subscription": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "PublisherSubscriptionId": { - "type": "string" - }, - "EntitlementId": { - "type": "string" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "CustomerTenant": { - "$ref": "#/definitions/CustomerTenantReference" - }, - "Product": { - "$ref": "#/definitions/ProductReference" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "Status": { - "enum": [ - "None", - "Active", - "Suspended", - "Deleted", - "CustomerCancellation", - "Converted", - "Inactive", - "All" - ], - "type": "string" - }, - "ProvisionType": { - "enum": [ - "None", - "Seat", - "Usage", - "OneTime", - "Crayon", - "AzureMarketplace" - ], - "type": "string" - }, - "AvailableAddonsCount": { - "format": "int32", - "type": "integer" - }, - "Subscriptions": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubscriptionAddOn" - } - }, - "OrderId": { - "type": "string" - }, - "CreationDate": { - "format": "date-time", - "type": "string" - }, - "BillingCycle": { - "enum": [ - "Unknown", - "Monthly", - "Annual", - "None", - "OneTime", - "BiAnnually", - "TwoYears", - "ThreeYears", - "Quarterly" - ], - "type": "string" - }, - "Markup": { - "format": "double", - "type": "number" - }, - "IsTrial": { - "type": "boolean" - }, - "StartDate": { - "format": "date-time", - "type": "string" - }, - "EndDate": { - "format": "date-time", - "type": "string" - }, - "PriceType": { - "enum": [ - "PurchasePrice", - "ListPrice", - "FixedPrice" - ], - "type": "string" - }, - "SalesPrice": { - "format": "double", - "type": "number" - }, - "RegisteredForReservedInstance": { - "type": "boolean" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "SubscriptionTags": { - "$ref": "#/definitions/SubscriptionTags" - } - } - }, - "SubscriptionAddOn": { - "type": "object", - "properties": { - "Id": { - "format": "int32", - "type": "integer" - }, - "PublisherSubscriptionId": { - "type": "string" - }, - "PublisherCustomerId": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "Status": { - "enum": [ - "None", - "Active", - "Suspended", - "Deleted", - "CustomerCancellation", - "Converted", - "Inactive", - "All" - ], - "type": "string" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "OrderId": { - "type": "string" - }, - "CreationDate": { - "format": "date-time", - "type": "string" - }, - "Product": { - "$ref": "#/definitions/ProductReference" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Markup": { - "format": "double", - "type": "number" - }, - "SubscriptionTags": { - "$ref": "#/definitions/SubscriptionTags" - } - } - }, - "SubscriptionDetailed": { - "type": "object", - "properties": { - "EffectiveStartDate": { - "format": "date-time", - "type": "string" - }, - "CommitmentEndDate": { - "format": "date-time", - "type": "string" - }, - "SuspensionReasons": { - "type": "string" - }, - "OriginalAgreementId": { - "format": "int32", - "type": "integer" - }, - "Pricing": { - "$ref": "#/definitions/SubscriptionPricing" - }, - "Id": { - "format": "int32", - "type": "integer" - }, - "PublisherSubscriptionId": { - "type": "string" - }, - "EntitlementId": { - "type": "string" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - }, - "Organization": { - "$ref": "#/definitions/ObjectReference" - }, - "CustomerTenant": { - "$ref": "#/definitions/CustomerTenantReference" - }, - "Product": { - "$ref": "#/definitions/ProductReference" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "Name": { - "type": "string" - }, - "Status": { - "enum": [ - "None", - "Active", - "Suspended", - "Deleted", - "CustomerCancellation", - "Converted", - "Inactive", - "All" - ], - "type": "string" - }, - "ProvisionType": { - "enum": [ - "None", - "Seat", - "Usage", - "OneTime", - "Crayon", - "AzureMarketplace" - ], - "type": "string" - }, - "AvailableAddonsCount": { - "format": "int32", - "type": "integer" - }, - "Subscriptions": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubscriptionAddOn" - } - }, - "OrderId": { - "type": "string" - }, - "CreationDate": { - "format": "date-time", - "type": "string" - }, - "BillingCycle": { - "enum": [ - "Unknown", - "Monthly", - "Annual", - "None", - "OneTime", - "BiAnnually", - "TwoYears", - "ThreeYears", - "Quarterly" - ], - "type": "string" - }, - "Markup": { - "format": "double", - "type": "number" - }, - "IsTrial": { - "type": "boolean" - }, - "StartDate": { - "format": "date-time", - "type": "string" - }, - "EndDate": { - "format": "date-time", - "type": "string" - }, - "PriceType": { - "enum": [ - "PurchasePrice", - "ListPrice", - "FixedPrice" - ], - "type": "string" - }, - "SalesPrice": { - "format": "double", - "type": "number" - }, - "RegisteredForReservedInstance": { - "type": "boolean" - }, - "InvoiceProfile": { - "$ref": "#/definitions/ObjectReference" - }, - "SubscriptionTags": { - "$ref": "#/definitions/SubscriptionTags" - } - } - }, - "SubscriptionPricing": { - "type": "object", - "properties": { - "CurrencyCode": { - "type": "string" - }, - "PurchasePrice": { - "format": "double", - "type": "number" - }, - "RecommendedRetailPrice": { - "format": "double", - "type": "number" - } - } - }, - "ApiCollectionOfSubscriptionConversion": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubscriptionConversion" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "SubscriptionConversion": { - "type": "object", - "properties": { - "BillingCycle": { - "enum": [ - "Unknown", - "Monthly", - "Annual", - "None", - "OneTime", - "BiAnnually", - "TwoYears", - "ThreeYears", - "Quarterly" - ], - "type": "string" - }, - "OfferId": { - "type": "string" - }, - "OrderId": { - "type": "string" - }, - "Quantity": { - "format": "int32", - "type": "integer" - }, - "TargetOfferId": { - "type": "string" - }, - "ProductName": { - "type": "string" - } - } - }, - "ActivationLink": { - "type": "object", - "properties": { - "SubscriptionId": { - "type": "string" - }, - "Uri": { - "type": "string" - } - } - }, - "ApiCollectionOfBoolean": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "boolean" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ApiCollectionOfObjectReference": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ObjectReference" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ApiCollectionOfSubscriptionAddOnOffer": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubscriptionAddOnOffer" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "SubscriptionAddOnOffer": { - "type": "object", - "properties": { - "Product": { - "$ref": "#/definitions/ProductReference" - }, - "Publisher": { - "$ref": "#/definitions/ObjectReference" - } - } - }, - "PostSubscriptionAddOn": { - "type": "object", - "properties": { - "Quantity": { - "format": "int32", - "type": "integer" - }, - "OfferId": { - "type": "string" - }, - "SubscriptionTags": { - "$ref": "#/definitions/SubscriptionTags" - } - } - }, - "ApiCollectionOfOrganizationUsageCost": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/OrganizationUsageCost" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "OrganizationUsageCost": { - "type": "object", - "properties": { - "Supplier": { - "type": "string" - }, - "AccountId": { - "format": "int32", - "type": "integer" - }, - "AccountName": { - "type": "string" - }, - "SubscriptionName": { - "type": "string" - }, - "SubscriptionId": { - "type": "string" - }, - "Amount": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "ApiCollectionOfSubscriptionUsageCost": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubscriptionUsageCost" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "SubscriptionUsageCost": { - "type": "object", - "properties": { - "Category": { - "type": "string" - }, - "Amount": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "ApiCollectionOfCategoryUsageCost": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/CategoryUsageCost" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "CategoryUsageCost": { - "type": "object", - "properties": { - "Subcategory": { - "type": "string" - }, - "Amount": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "ApiCollectionOfSubcategoryUsageCost": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubcategoryUsageCost" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "SubcategoryUsageCost": { - "type": "object", - "properties": { - "Meter": { - "type": "string" - }, - "Amount": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "ApiCollectionOfSubscriptionResourceGroupUsageCost": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/SubscriptionResourceGroupUsageCost" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "SubscriptionResourceGroupUsageCost": { - "type": "object", - "properties": { - "ResourceGroup": { - "type": "string" - }, - "Amount": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "ApiCollectionOfResourceGroupUsageCost": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/ResourceGroupUsageCost" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "ResourceGroupUsageCost": { - "type": "object", - "properties": { - "Category": { - "type": "string" - }, - "Subcategory": { - "type": "string" - }, - "Meter": { - "type": "string" - }, - "Amount": { - "format": "double", - "type": "number" - }, - "CurrencyCode": { - "type": "string" - } - } - }, - "SubscriptionUsageCostRequest": { - "type": "object", - "properties": { - "ResellerCustomerId": { - "format": "int32", - "type": "integer" - }, - "SubscriptionId": { - "type": "string" - }, - "CurrencyCode": { - "type": "string" - }, - "From": { - "format": "date-time", - "type": "string" - }, - "To": { - "format": "date-time", - "type": "string" - } - } - }, - "CategoryUsageCostRequest": { - "type": "object", - "properties": { - "ResellerCustomerId": { - "format": "int32", - "type": "integer" - }, - "SubscriptionId": { - "type": "string" - }, - "Category": { - "type": "string" - }, - "CurrencyCode": { - "type": "string" - }, - "From": { - "format": "date-time", - "type": "string" - }, - "To": { - "format": "date-time", - "type": "string" - } - } - }, - "SubcategoryUsageCostRequest": { - "type": "object", - "properties": { - "ResellerCustomerId": { - "format": "int32", - "type": "integer" - }, - "SubscriptionId": { - "type": "string" - }, - "Category": { - "type": "string" - }, - "Subcategory": { - "type": "string" - }, - "CurrencyCode": { - "type": "string" - }, - "From": { - "format": "date-time", - "type": "string" - }, - "To": { - "format": "date-time", - "type": "string" - } - } - }, - "ResourceGroupUsageCostRequest": { - "type": "object", - "properties": { - "ResellerCustomerId": { - "format": "int32", - "type": "integer" - }, - "SubscriptionId": { - "type": "string" - }, - "ResourceGroup": { - "type": "string" - }, - "CurrencyCode": { - "type": "string" - }, - "From": { - "format": "date-time", - "type": "string" - }, - "To": { - "format": "date-time", - "type": "string" - } - } - }, - "ApiCollectionOfUser": { - "type": "object", - "properties": { - "Items": { - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/User" - } - }, - "TotalHits": { - "format": "int64", - "type": "integer" - } - } - }, - "User": { - "type": "object", - "properties": { - "Id": { - "type": "string" - }, - "UserName": { - "type": "string" - }, - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "Email": { - "type": "string" - }, - "EmailConfirmed": { - "type": "boolean" - }, - "LockoutEnabled": { - "type": "boolean" - }, - "LockoutEnd": { - "format": "date-time", - "type": "string" - }, - "PhoneNumber": { - "type": "string" - }, - "PhoneNumberConfirmed": { - "type": "boolean" - }, - "TwoFactorEnabled": { - "type": "boolean" - }, - "TenantAdmin": { - "type": "boolean" - } - } - }, - "UserChangePassword": { - "type": "object", - "properties": { - "UserId": { - "type": "string" - }, - "OldPassword": { - "type": "string" - }, - "NewPassword": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "Bearer": { - "name": "Authorization", - "in": "header", - "type": "apiKey", - "description": "Please insert \"Bearer {access token}\" below." - } - }, - "security": [ - { - "Bearer": [] - } - ] +{ + "swagger": "2.0", + "info": { + "title": "Crayon Group Customer API", + "version": "v1" + }, + "host": "apiv1.crayon.com", + "paths": { + "/api/v1/ActivityLogs": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ActivityLogs" + ], + "operationId": "GetActivityLogs", + "parameters": [ + { + "type": "string", + "name": "Entity", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Id", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "Ids", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "SearchDate", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "From", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "To", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ActivityLog" + } + } + } + } + }, + "/api/v1/AgreementProducts": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AgreementProducts" + ], + "operationId": "GetAgreementProducts", + "parameters": [ + { + "type": "array", + "items": { + "enum": [ + "None", + "LicenseAgreement", + "OpenAgreement", + "FrameAgreement", + "SamAgreement", + "ConsultingAgreement", + "CloudSeatAgreement", + "CloudUsageAgreement", + "ReportingAgreement", + "OtherAgreement", + "Reserved1", + "Reserved2", + "Reserved3" + ], + "type": "string" + }, + "collectionFormat": "multi", + "name": "AgreementTypeIds", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PriceListId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "CustomerTenantId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "AgreementId", + "in": "query" + }, + { + "type": "boolean", + "name": "IsTrial", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "AgreementIds", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "SearchDate", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.PartNumbers", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "Include.PublisherIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.PublisherNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.PoolNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.OperatingSystemNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.LevelNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.LanguageNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.LicenseAgreementTypeNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.LicenseTypeNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.ProductFamilyNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.ProductTypeNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.ProgramNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.OfferingNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.PurchasePeriodNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.PurchaseUnitNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.VersionNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.RegionNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Include.ProductCategoryNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.PartNumbers", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "Exclude.PublisherIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.PublisherNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.PoolNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.OperatingSystemNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.LevelNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.LanguageNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.LicenseAgreementTypeNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.LicenseTypeNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.ProductFamilyNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.ProductTypeNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.ProgramNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.OfferingNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.PurchasePeriodNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.PurchaseUnitNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.VersionNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.RegionNames", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Exclude.ProductCategoryNames", + "in": "query" + }, + { + "type": "string", + "name": "SortKey", + "in": "query" + }, + { + "type": "boolean", + "name": "IncludeProductInformation", + "in": "query" + }, + { + "enum": [ + "Ascending", + "Descending" + ], + "type": "string", + "name": "SortOrder", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AgreementProductCollection" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AgreementProducts" + ], + "operationId": "GetOperationSdk133", + "parameters": [ + { + "name": "filter", + "in": "body", + "schema": { + "$ref": "#/definitions/AgreementProductFilter" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AgreementProductCollection" + } + } + } + } + }, + "/api/v1/AgreementProducts/file/xlsx": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "AgreementProducts" + ], + "operationId": "GetAsExcelFile", + "parameters": [ + { + "name": "filter", + "in": "body", + "schema": { + "$ref": "#/definitions/AgreementProductFilter" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/AgreementProducts/{partNumber}/supportedbillingcycles": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AgreementProducts" + ], + "operationId": "GetSupportedBillingCycles", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "resellerCustomerId", + "in": "query" + }, + { + "type": "string", + "name": "partNumber", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", + "Monthly", + "Annual", + "None", + "OneTime", + "BiAnnually", + "TwoYears", + "ThreeYears", + "Quarterly" + ] + } + } + } + } + } + }, + "/api/v1/AgreementReports/{agreementId}": { + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AgreementReports" + ], + "operationId": "Update", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "agreementId", + "in": "path", + "required": true + }, + { + "name": "agreementReport", + "in": "body", + "schema": { + "$ref": "#/definitions/AgreementReport" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AgreementReport" + } + } + } + } + }, + "/api/v1/AgreementReports/{productContainerId}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AgreementReports" + ], + "operationId": "GetAgreementReports", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "productContainerId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfAgreementReport" + } + } + } + } + }, + "/api/v1/Agreements": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Agreements" + ], + "operationId": "GetAgreements", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "OrganizationIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "PricelistIds", + "in": "query" + }, + { + "enum": [ + "None", + "Active", + "Inactive", + "ActiveInactive" + ], + "type": "string", + "name": "Status", + "in": "query" + }, + { + "type": "array", + "items": { + "enum": [ + "None", + "LicenseAgreement", + "OpenAgreement", + "FrameAgreement", + "SamAgreement", + "ConsultingAgreement", + "CloudSeatAgreement", + "CloudUsageAgreement", + "ReportingAgreement", + "OtherAgreement", + "Reserved1", + "Reserved2", + "Reserved3" + ], + "type": "string" + }, + "collectionFormat": "multi", + "name": "AgreementTypes", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "PublisherIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "ProgramIds", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "SearchDate", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "AgreementIds", + "in": "query" + }, + { + "type": "string", + "name": "SalesPriceCurrency", + "in": "query" + }, + { + "type": "boolean", + "name": "TermRequired", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "EndDateFrom", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "EndDateTo", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AgreementCollection" + } + } + } + } + }, + "/api/v1/Assets": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Assets" + ], + "operationId": "GetAssets", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "ResellerCustomerId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "string", + "name": "ExternalOrderId", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "ExternalOrderIds", + "in": "query" + }, + { + "type": "string", + "name": "ReservationId", + "in": "query" + }, + { + "enum": [ + "Reservation", + "Software", + "Subscription" + ], + "type": "string", + "name": "AssetType", + "in": "query" + }, + { + "enum": [ + "None", + "Fulfilling", + "Succeeded", + "Cancelled", + "Expired", + "All" + ], + "type": "string", + "name": "Status", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfAsset" + } + } + } + } + }, + "/api/v1/Assets/checkout": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "Assets" + ], + "operationId": "CheckoutAsync", + "parameters": [ + { + "name": "order", + "in": "body", + "schema": { + "$ref": "#/definitions/AssetOrder" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/Assets/orders": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Assets" + ], + "operationId": "GetAssetOrdersAsync", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "ResellerCustomerId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "string", + "name": "ExternalOrderId", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "ExternalOrderIds", + "in": "query" + }, + { + "type": "string", + "name": "ReservationId", + "in": "query" + }, + { + "enum": [ + "Reservation", + "Software", + "Subscription" + ], + "type": "string", + "name": "AssetType", + "in": "query" + }, + { + "enum": [ + "None", + "Fulfilling", + "Succeeded", + "Cancelled", + "Expired", + "All" + ], + "type": "string", + "name": "Status", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfAssetOrder" + } + } + } + } + }, + "/api/v1/Assets/verify": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Assets" + ], + "operationId": "VerifyAsync", + "parameters": [ + { + "name": "order", + "in": "body", + "schema": { + "$ref": "#/definitions/AssetOrder" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AssetOrder" + } + } + } + } + }, + "/api/v1/Assets/{assetId}/tags": { + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "Assets" + ], + "operationId": "UpdateTagsAsync", + "parameters": [ + { + "name": "assetTags", + "in": "body", + "schema": { + "$ref": "#/definitions/AssetTags" + } + }, + { + "type": "integer", + "format": "int32", + "name": "assetId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "Assets" + ], + "operationId": "AddTagsAsync", + "parameters": [ + { + "name": "assetTags", + "in": "body", + "schema": { + "$ref": "#/definitions/AssetTags" + } + }, + { + "type": "integer", + "format": "int32", + "name": "assetId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + }, + "delete": { + "tags": [ + "Assets" + ], + "operationId": "DeleteTagsAsync", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "assetId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/Assets/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Assets" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Asset" + } + } + } + } + }, + "/api/v1/AwsAccounts": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AwsAccounts" + ], + "operationId": "GetAwsAccounts", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ConsumerId", + "in": "query" + }, + { + "enum": [ + "None", + "T1", + "T2" + ], + "type": "string", + "name": "CustomerTenantType", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfAwsAccount" + } + } + } + } + }, + "/api/v1/AwsAccounts/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AwsAccounts" + ], + "operationId": "GetAwsAccountById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AwsAccount" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AwsAccounts" + ], + "operationId": "PutAwsAccounts", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "awsAccount", + "in": "body", + "schema": { + "$ref": "#/definitions/AwsAccount" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AwsAccount" + } + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzurePlan" + } + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "GetSubscriptions", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfAzureSubscription" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "CreateSubscription", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "name": "requestBody", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateAzureSubscriptionRequest" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "GetSubscriptionById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzureSubscription" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "UpdateSubscription", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "azureSubscription", + "in": "body", + "schema": { + "$ref": "#/definitions/PutAzureSubscription" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzureSubscription" + } + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/assign-unique-admin": { + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "AssignUniqueAdmin", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AzureSubscriptionAssignAdmin" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/cancel": { + "post": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "Cancel", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzureSubscriptionUpdated" + } + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/enable": { + "post": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "Enable", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzureSubscriptionUpdated" + } + } + } + } + }, + "/api/v1/AzurePlans/{azurePlanId}/azureSubscriptions/{id}/rename": { + "patch": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "AzurePlans" + ], + "operationId": "Enable", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "azurePlanId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AzureSubscriptionRename" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzureSubscriptionUpdated" + } + } + } + } + }, + "/api/v1/BillingCycles": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "BillingCycles" + ], + "operationId": "GetAllBillingCycles", + "parameters": [ + { + "type": "boolean", + "default": false, + "name": "includeUnknown", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfBillingCycle" + } + } + } + } + }, + "/api/v1/BillingCycles/cspNameDictionary": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "BillingCycles" + ], + "operationId": "GetCspNameDictionary", + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + }, + "/api/v1/BillingCycles/productVariant/{productVariantId}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "BillingCycles" + ], + "operationId": "GetByProductVariantId", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "productVariantId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfBillingCycle" + } + } + } + } + }, + "/api/v1/BillingStatements": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "BillingStatements" + ], + "operationId": "GetBillingStatements", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "InvoiceProfileId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "enum": [ + "None", + "Seat", + "Usage", + "OneTime", + "Crayon", + "AzureMarketplace" + ], + "type": "string", + "name": "ProvisionType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "From", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "To", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfBillingStatement" + } + } + } + } + }, + "/api/v1/BillingStatements/file/{id}": { + "get": { + "tags": [ + "BillingStatements" + ], + "operationId": "GetBillingStatementFile", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/BillingStatements/grouped": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "BillingStatements" + ], + "operationId": "GetGroupedBillingStatements", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "InvoiceProfileId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "enum": [ + "None", + "Seat", + "Usage", + "OneTime", + "Crayon", + "AzureMarketplace" + ], + "type": "string", + "name": "ProvisionType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "From", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "To", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfGroupedBillingStatement" + } + } + } + } + }, + "/api/v1/BillingStatements/{id}/billingrecordsfile": { + "get": { + "tags": [ + "BillingStatements" + ], + "operationId": "GetBillingRecordsFile", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/BillingStatements/{id}/reconciliationfile": { + "get": { + "tags": [ + "BillingStatements" + ], + "operationId": "GetReconciliationFile", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/BlogItems": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "BlogItems" + ], + "operationId": "GetForDirectCustomers", + "parameters": [ + { + "type": "integer", + "format": "int32", + "default": 6, + "name": "count", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 0, + "name": "organizationId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfBlogItem" + } + } + } + } + }, + "/api/v1/Clients": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Clients" + ], + "operationId": "GetClients", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfClient" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Clients" + ], + "operationId": "PostClients", + "parameters": [ + { + "name": "client", + "in": "body", + "schema": { + "$ref": "#/definitions/Client" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Client" + } + } + } + } + }, + "/api/v1/Clients/{clientId}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Clients" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "string", + "name": "clientId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Client" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Clients" + ], + "operationId": "PutClients", + "parameters": [ + { + "type": "string", + "name": "clientId", + "in": "path", + "required": true + }, + { + "name": "client", + "in": "body", + "schema": { + "$ref": "#/definitions/Client" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Client" + } + } + } + }, + "delete": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Clients" + ], + "operationId": "DeleteClients", + "parameters": [ + { + "type": "string", + "name": "clientId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/Consumers": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Consumers" + ], + "operationId": "GetConsumers", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfConsumer" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Consumers" + ], + "operationId": "AddConsumer", + "parameters": [ + { + "name": "consumer", + "in": "body", + "schema": { + "$ref": "#/definitions/Consumer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Consumer" + } + } + } + } + }, + "/api/v1/Consumers/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Consumers" + ], + "operationId": "GetConsumerById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Consumer" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Consumers" + ], + "operationId": "UpdateConsumer", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "consumer", + "in": "body", + "schema": { + "$ref": "#/definitions/Consumer" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Consumer" + } + } + } + }, + "delete": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Consumers" + ], + "operationId": "DeleteConsumer", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/CrayonAccounts": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CrayonAccounts" + ], + "operationId": "GetCrayonAccounts", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ConsumerId", + "in": "query" + }, + { + "enum": [ + "None", + "T1", + "T2" + ], + "type": "string", + "name": "CustomerTenantType", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfCrayonAccount" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CrayonAccounts" + ], + "operationId": "PostCrayonAccounts", + "parameters": [ + { + "name": "crayonAccount", + "in": "body", + "schema": { + "$ref": "#/definitions/CrayonAccount" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CrayonAccount" + } + } + } + } + }, + "/api/v1/CrayonAccounts/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CrayonAccounts" + ], + "operationId": "GetCrayonAccountById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CrayonAccount" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CrayonAccounts" + ], + "operationId": "PutCrayonAccounts", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "crayonAccount", + "in": "body", + "schema": { + "$ref": "#/definitions/CrayonAccount" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CrayonAccount" + } + } + } + } + }, + "/api/v1/CustomerTenants": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "GetCustomerTenants", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ProgramId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ConsumerId", + "in": "query" + }, + { + "type": "string", + "name": "Domain", + "in": "query" + }, + { + "type": "string", + "name": "DomainPrefix", + "in": "query" + }, + { + "enum": [ + "None", + "T1", + "T2" + ], + "type": "string", + "name": "CustomerTenantType", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "InvoiceProfileId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfCustomerTenant" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "PostCustomerTenants", + "parameters": [ + { + "name": "customerTenant", + "in": "body", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + } + } + } + }, + "/api/v1/CustomerTenants/existing": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "AddExisting", + "parameters": [ + { + "name": "existingTenant", + "in": "body", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + }, + { + "type": "boolean", + "default": false, + "name": "syncFromPublisher", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + } + } + } + }, + "/api/v1/CustomerTenants/{customerTenantId}/azurePlan": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "GetAzurePlan", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "customerTenantId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AzurePlan" + } + } + } + } + }, + "/api/v1/CustomerTenants/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "GetCustomerTenantById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CustomerTenant" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "PutCustomerTenants", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "customerTenant", + "in": "body", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + } + } + }, + "delete": { + "tags": [ + "CustomerTenants" + ], + "operationId": "DeleteCustomerById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/CustomerTenants/{id}/detailed": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenants" + ], + "operationId": "GetCustomerTenantDetailedById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CustomerTenantDetailed" + } + } + } + } + }, + "/api/v1/FacebookOrders/checkout": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "FacebookOrders" + ], + "operationId": "CheckoutAsync", + "parameters": [ + { + "name": "order", + "in": "body", + "schema": { + "$ref": "#/definitions/FacebookOrder" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/GoogleOrders/checkout": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "GoogleOrders" + ], + "operationId": "CheckoutAsync", + "parameters": [ + { + "name": "order", + "in": "body", + "schema": { + "$ref": "#/definitions/GoogleOrder" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/Groupings": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Groupings" + ], + "operationId": "GetGroupings", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "boolean", + "name": "IncludeRemoved", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfGrouping" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Groupings" + ], + "operationId": "PostGroupings", + "parameters": [ + { + "name": "grouping", + "in": "body", + "schema": { + "$ref": "#/definitions/Grouping" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Grouping" + } + } + } + } + }, + "/api/v1/Groupings/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Groupings" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Grouping" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Groupings" + ], + "operationId": "PutGroupings", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "grouping", + "in": "body", + "schema": { + "$ref": "#/definitions/Grouping" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Grouping" + } + } + } + }, + "delete": { + "tags": [ + "Groupings" + ], + "operationId": "DeleteGroupings", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/InvoiceProfiles": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "InvoiceProfiles" + ], + "operationId": "GetInvoiceProfiles", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfInvoiceProfile" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "InvoiceProfiles" + ], + "operationId": "PostInvoiceProfiles", + "parameters": [ + { + "name": "invoiceProfile", + "in": "body", + "schema": { + "$ref": "#/definitions/InvoiceProfile" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/InvoiceProfile" + } + } + } + } + }, + "/api/v1/InvoiceProfiles/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "InvoiceProfiles" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/InvoiceProfile" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "InvoiceProfiles" + ], + "operationId": "PutInvoiceProfiles", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "invoiceProfile", + "in": "body", + "schema": { + "$ref": "#/definitions/InvoiceProfile" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/InvoiceProfile" + } + } + } + }, + "delete": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "InvoiceProfiles" + ], + "operationId": "DeleteInvoiceProfiles", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/ManagementLinks": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ManagementLinks" + ], + "operationId": "GetManagementLinks", + "parameters": [ + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "SubscriptionIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "ResellerCustomerIds", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfManagementLink" + } + } + } + } + }, + "/api/v1/ManagementLinks/grouped": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ManagementLinks" + ], + "operationId": "GetGrouped", + "parameters": [ + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "SubscriptionIds", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "collectionFormat": "multi", + "name": "ResellerCustomerIds", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfManagementLinkGrouped" + } + } + } + } + }, + "/api/v1/Me": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Me" + ], + "operationId": "GetMe", + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Me" + } + } + } + } + }, + "/api/v1/OrganizationAccess": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "OrganizationAccess" + ], + "operationId": "GetOrganizationAccess", + "parameters": [ + { + "type": "string", + "name": "userId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 0, + "name": "organizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 1, + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 10000, + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfOrganizationAccess" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "OrganizationAccess" + ], + "operationId": "PutOrganizationAccess", + "parameters": [ + { + "name": "list", + "in": "body", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationAccess" + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationAccess" + } + } + } + } + } + }, + "/api/v1/OrganizationAccess/grant": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "OrganizationAccess" + ], + "operationId": "GetOrganizationAccess", + "parameters": [ + { + "type": "string", + "name": "userId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 0, + "name": "organizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 1, + "name": "page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "default": 10000, + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfOrganizationAccess" + } + } + } + } + }, + "/api/v1/Organizations": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Organizations" + ], + "operationId": "GetOrganizations", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfOrganization" + } + } + } + } + }, + "/api/v1/Organizations/HasAccess/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Organizations" + ], + "operationId": "HasAccessAsync", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/Organizations/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Organizations" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Organization" + } + } + } + } + }, + "/api/v1/Organizations/{organizationId}/salescontact": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Organizations" + ], + "operationId": "GetOrganizationSalesContact", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "organizationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/OrganizationSalesContact" + } + } + } + } + }, + "/api/v1/Ping": { + "get": { + "tags": [ + "Ping" + ], + "operationId": "GetPing", + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/ProductContainers": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "GetProductContainers", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "boolean", + "name": "ActiveDraft", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ProgramId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Year", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Month", + "in": "query" + }, + { + "type": "string", + "name": "UserId", + "in": "query" + }, + { + "type": "string", + "name": "SentByUserId", + "in": "query" + }, + { + "enum": [ + "None", + "Draft", + "Request", + "Order", + "Quote", + "Template" + ], + "type": "string", + "name": "Type", + "in": "query" + }, + { + "enum": [ + "None", + "Seat", + "Report" + ], + "type": "string", + "name": "Category", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "From", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "To", + "in": "query" + }, + { + "type": "boolean", + "name": "IncludeRemoved", + "in": "query" + }, + { + "type": "boolean", + "name": "IncludeSubsidiaries", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfProductContainer" + } + } + } + } + }, + "/api/v1/ProductContainers/getorcreateshoppingcart": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "GetOrCreateShoppingCart", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "organizationId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + } + } + } + }, + "/api/v1/ProductContainers/reportbymonth": { + "post": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "CreateReportAsync", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "year", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "month", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "programId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "organizationId", + "in": "query" + }, + { + "type": "boolean", + "name": "copyLast", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + } + } + } + }, + "/api/v1/ProductContainers/rowissues/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "GetByIdWithRowIssues", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + } + } + } + }, + "/api/v1/ProductContainers/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "PutProductContainers", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "productContainer", + "in": "body", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + }, + { + "type": "boolean", + "default": false, + "name": "requireEulaAnalysis", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + } + } + }, + "delete": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "DeleteProductContainer", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/ProductContainers/{productContainerId}/row/{productRowId}": { + "patch": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ProductContainers" + ], + "operationId": "PatchProductRow", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "productContainerId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int32", + "name": "productRowId", + "in": "path", + "required": true + }, + { + "name": "productRowPatch", + "in": "body", + "schema": { + "$ref": "#/definitions/ProductRowPatch" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ProductContainer" + } + } + } + } + }, + "/api/v1/Programs": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Programs" + ], + "operationId": "GetPrograms", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "enum": [ + "None", + "License", + "Report", + "Cloud" + ], + "type": "string", + "name": "ProgramType", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfProgram" + } + } + } + } + }, + "/api/v1/Programs/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Programs" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Program" + } + } + } + } + }, + "/api/v1/Publishers": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Publishers" + ], + "operationId": "GetPublishers", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "Names", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "enum": [ + "None", + "License", + "Report", + "Cloud" + ], + "type": "string", + "name": "ProgramType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfPublisher" + } + } + } + } + }, + "/api/v1/Publishers/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Publishers" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Publisher" + } + } + } + } + }, + "/api/v1/Regions": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Regions" + ], + "operationId": "GetRegions", + "parameters": [ + { + "enum": [ + "None", + "MicrosoftCsp", + "OrganizationSpecific" + ], + "type": "string", + "name": "RegionList", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfRegion" + } + } + } + } + }, + "/api/v1/Regions/bycode": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Regions" + ], + "operationId": "GetByRegionCode", + "parameters": [ + { + "type": "string", + "name": "regionCode", + "in": "query" + }, + { + "enum": [ + "None", + "MicrosoftCsp", + "OrganizationSpecific" + ], + "type": "string", + "name": "regionList", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Region" + } + } + } + } + }, + "/api/v1/ResellerSalesPrices": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ResellerSalesPrices" + ], + "operationId": "GetAsync", + "parameters": [ + { + "enum": [ + "License", + "Usage", + "OneTime" + ], + "type": "string", + "name": "Type", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ObjectId", + "in": "query" + }, + { + "enum": [ + "Organization", + "CustomerTenant", + "Subscription", + "SubscriptionAddon", + "AzureSubscription" + ], + "type": "string", + "name": "ObjectType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "FromDate", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ResellerSalesPrice" + } + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ResellerSalesPrices" + ], + "operationId": "PostAsync", + "parameters": [ + { + "name": "resellerSalesPrice", + "in": "body", + "schema": { + "$ref": "#/definitions/ResellerSalesPrice" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ResellerSalesPrice" + } + } + } + }, + "delete": { + "tags": [ + "ResellerSalesPrices" + ], + "operationId": "DeleteByFilterAsync", + "parameters": [ + { + "enum": [ + "License", + "Usage", + "OneTime" + ], + "type": "string", + "name": "Type", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ObjectId", + "in": "query" + }, + { + "enum": [ + "Organization", + "CustomerTenant", + "Subscription", + "SubscriptionAddon", + "AzureSubscription" + ], + "type": "string", + "name": "ObjectType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "FromDate", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/ResellerSalesPrices/current": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ResellerSalesPrices" + ], + "operationId": "GetCurrentAsync", + "parameters": [ + { + "enum": [ + "License", + "Usage", + "OneTime" + ], + "type": "string", + "name": "Type", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "ObjectId", + "in": "query" + }, + { + "enum": [ + "Organization", + "CustomerTenant", + "Subscription", + "SubscriptionAddon", + "AzureSubscription" + ], + "type": "string", + "name": "ObjectType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "FromDate", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ResellerSalesPrice" + } + } + } + } + }, + "/api/v1/ResellerSalesPrices/toggle": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "tags": [ + "ResellerSalesPrices" + ], + "operationId": "ToggleAsync", + "parameters": [ + { + "name": "resellerSalesPriceToggle", + "in": "body", + "schema": { + "$ref": "#/definitions/ResellerSalesPriceToggle" + } + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/ResellerSalesPrices/{oldFromDate}": { + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "ResellerSalesPrices" + ], + "operationId": "PutAsync", + "parameters": [ + { + "type": "string", + "format": "date-time", + "name": "oldFromDate", + "in": "path", + "required": true + }, + { + "name": "resellerSalesPrice", + "in": "body", + "schema": { + "$ref": "#/definitions/ResellerSalesPrice" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ResellerSalesPrice" + } + } + } + } + }, + "/api/v1/Secrets": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Secrets" + ], + "operationId": "PostSecrets", + "parameters": [ + { + "name": "secret", + "in": "body", + "schema": { + "$ref": "#/definitions/Secret" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Secret" + } + } + } + }, + "delete": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Secrets" + ], + "operationId": "DeleteSecrets", + "parameters": [ + { + "type": "string", + "name": "clientId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "secretId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/Subscriptions": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetSubscriptions", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "CustomerTenantId", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PublisherId", + "in": "query" + }, + { + "type": "boolean", + "name": "Refresh", + "in": "query" + }, + { + "enum": [ + "None", + "Active", + "Suspended", + "Deleted", + "CustomerCancellation", + "Converted", + "Inactive", + "All" + ], + "type": "string", + "name": "Statuses", + "in": "query" + }, + { + "type": "boolean", + "name": "IsTrial", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + }, + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "boolean", + "name": "RegisteredForReservedInstance", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscription" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "PostSubscriptions", + "parameters": [ + { + "name": "subscription", + "in": "body", + "schema": { + "$ref": "#/definitions/SubscriptionDetailed" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/SubscriptionDetailed" + } + } + } + } + }, + "/api/v1/Subscriptions/subscriptionpricetypes": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetSubscriptionPriceTypes", + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfObjectReference" + } + } + } + } + }, + "/api/v1/Subscriptions/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "Subscription", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/SubscriptionDetailed" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "PutSubscriptions", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "subscription", + "in": "body", + "schema": { + "$ref": "#/definitions/SubscriptionDetailed" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/SubscriptionDetailed" + } + } + } + } + }, + "/api/v1/Subscriptions/{id}/activationlink": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetActivationLinkAsync", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ActivationLink" + } + } + } + } + }, + "/api/v1/Subscriptions/{reservedInstance}/subscriptionId/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetRegisterReservedInstance", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "name": "reservedInstance", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfBoolean" + } + } + } + }, + "post": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "RegisterReservedInstance", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "name": "reservedInstance", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/Subscriptions/{subscriptionId}/addon-offers": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetSubscriptionAddons", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "subscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscriptionAddOnOffer" + } + } + } + } + }, + "/api/v1/Subscriptions/{subscriptionId}/addons": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "SetSubscriptionAddon", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "name": "addon", + "in": "body", + "schema": { + "$ref": "#/definitions/PostSubscriptionAddOn" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/Subscriptions/{subscriptionId}/conversions": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetSubscriptionConversions", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "subscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscriptionConversion" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "PostSubscriptionConversion", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "name": "conversion", + "in": "body", + "schema": { + "$ref": "#/definitions/SubscriptionConversion" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/SubscriptionDetailed" + } + } + } + } + }, + "/api/v1/Subscriptions/{subscriptionId}/tags": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "GetSubscriptionTags", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "subscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/SubscriptionTags" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Subscriptions" + ], + "operationId": "SetSubscriptionTags", + "parameters": [ + { + "name": "tags", + "in": "body", + "schema": { + "$ref": "#/definitions/SubscriptionTags" + } + }, + { + "type": "string", + "name": "subscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + }, + "delete": { + "tags": [ + "Subscriptions" + ], + "operationId": "DeleteSubscriptionTags", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "subscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/UsageCost/getForCategory": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForCategory", + "parameters": [ + { + "name": "model", + "in": "body", + "schema": { + "$ref": "#/definitions/CategoryUsageCostRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfCategoryUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/getForResourceGroup": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForResourceGroup", + "parameters": [ + { + "name": "model", + "in": "body", + "schema": { + "$ref": "#/definitions/ResourceGroupUsageCostRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfResourceGroupUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/getForSubcategory": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForSubcategory", + "parameters": [ + { + "name": "model", + "in": "body", + "schema": { + "$ref": "#/definitions/SubcategoryUsageCostRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubcategoryUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/getForSubscription": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForSubscription", + "parameters": [ + { + "name": "model", + "in": "body", + "schema": { + "$ref": "#/definitions/SubscriptionUsageCostRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscriptionUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/getForSubscription/resourceGroups": { + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForSubscriptionWithResourceGroups", + "parameters": [ + { + "name": "model", + "in": "body", + "schema": { + "$ref": "#/definitions/SubscriptionUsageCostRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscriptionResourceGroupUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/organization/{organizationId}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForOrganization", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "name": "from", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfOrganizationUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/category/{category}/currency/{currencyCode}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForCategory", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "resellerCustomerId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "category", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "currencyCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "name": "from", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfCategoryUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/category/{category}/subcategory/{subcategory}/currency/{currencyCode}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForSubcategory", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "resellerCustomerId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "category", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "subcategory", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "currencyCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "name": "from", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubcategoryUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/currency/{currencyCode}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForSubscription", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "resellerCustomerId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "currencyCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "name": "from", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscriptionUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/currency/{currencyCode}/resourceGroups": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForSubscriptionWithResourceGroups", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "resellerCustomerId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "currencyCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "name": "from", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfSubscriptionResourceGroupUsageCost" + } + } + } + } + }, + "/api/v1/UsageCost/resellerCustomer/{resellerCustomerId}/subscription/{subscriptionId}/resourceGroup/{resourceGroup}/currency/{currencyCode}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "UsageCost" + ], + "operationId": "GetForResourceGroup", + "deprecated": true, + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "resellerCustomerId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "subscriptionId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "resourceGroup", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "currencyCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "name": "from", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "to", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfResourceGroupUsageCost" + } + } + } + } + }, + "/api/v1/Users": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "GetUsers", + "parameters": [ + { + "type": "string", + "name": "Search", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "OrganizationId", + "in": "query" + }, + { + "enum": [ + "None", + "User", + "TenantAdmin" + ], + "type": "string", + "name": "Role", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "Page", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "name": "PageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfUser" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "AddUser", + "parameters": [ + { + "name": "user", + "in": "body", + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/User" + } + } + } + } + }, + "/api/v1/Users/user": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "GetUserByUserName", + "parameters": [ + { + "type": "string", + "name": "userName", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/User" + } + } + } + } + }, + "/api/v1/Users/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "GetUserById", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/User" + } + } + } + }, + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "UpdateUser", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "user", + "in": "body", + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/User" + } + } + } + }, + "delete": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "DeleteUser", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/Users/{id}/changepassword": { + "put": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Users" + ], + "operationId": "ChangePassword", + "parameters": [ + { + "name": "changePassword", + "in": "body", + "schema": { + "$ref": "#/definitions/UserChangePassword" + } + }, + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "boolean" + } + } + } + } + }, + "/api/v1/connect/token": { + "post": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerToken" + ], + "operationId": "PostCustomerToken", + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Token" + } + } + } + } + }, + "/api/v1/customertenants/{customerTenantId}/agreements": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenantAgreements" + ], + "operationId": "GetCustomerTenantAgreements", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "customerTenantId", + "in": "path", + "required": true + }, + { + "enum": [ + "MicrosoftCloudAgreement", + "MicrosoftCustomerAgreement" + ], + "type": "string", + "name": "AgreementTypeConsent", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfServiceAccountAgreement" + } + } + } + }, + "post": { + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "CustomerTenantAgreements" + ], + "operationId": "Add", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "customerTenantId", + "in": "path", + "required": true + }, + { + "name": "agreement", + "in": "body", + "schema": { + "$ref": "#/definitions/ServiceAccountAgreement" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ServiceAccountAgreement" + } + } + } + } + }, + "/api/v1/organizations/{organizationId}/Addresses": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Addresses" + ], + "operationId": "GetAddresses", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "enum": [ + "None", + "Invoice", + "Delivery" + ], + "type": "string", + "name": "type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ApiCollectionOfAddress" + } + } + } + } + }, + "/api/v1/organizations/{organizationId}/Addresses/{id}": { + "get": { + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "tags": [ + "Addresses" + ], + "operationId": "GetById", + "parameters": [ + { + "type": "integer", + "format": "int32", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Address" + } + } + } + } + } + }, + "definitions": { + "ActivationLink": { + "type": "object", + "properties": { + "SubscriptionId": { + "type": "string" + }, + "Uri": { + "type": "string" + } + } + }, + "ActivityLog": { + "type": "object", + "properties": { + "Entity": { + "type": "string" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ActivityLogItem" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ActivityLogItem": { + "type": "object", + "properties": { + "ChangeType": { + "type": "string", + "enum": [ + "Delete", + "Insert", + "Update" + ] + }, + "ChangedBy": { + "type": "string" + }, + "ChangedColumn": { + "type": "string" + }, + "ChangedDate": { + "type": "string", + "format": "date-time" + }, + "ChangedFrom": { + "type": "string" + }, + "ChangedTo": { + "type": "string" + }, + "CustomValues": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Entity": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + } + } + }, + "Address": { + "type": "object", + "properties": { + "AddressType": { + "type": "string", + "enum": [ + "None", + "Invoice", + "Delivery" + ] + }, + "City": { + "type": "string" + }, + "CompleteAddress": { + "type": "string" + }, + "CountryCode": { + "type": "string" + }, + "County": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int64" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "Primary": { + "type": "boolean" + }, + "State": { + "type": "string" + }, + "Street": { + "type": "string" + }, + "ZipCode": { + "type": "string" + } + } + }, + "AddressData": { + "type": "object", + "properties": { + "AxAddressId": { + "type": "integer", + "format": "int64" + }, + "City": { + "type": "string" + }, + "CompleteAddress": { + "type": "string" + }, + "CountryCode": { + "type": "string" + }, + "County": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "State": { + "type": "string" + }, + "Street": { + "type": "string" + }, + "ZipCode": { + "type": "string" + } + } + }, + "AggregationItem": { + "type": "object", + "properties": { + "DocCount": { + "type": "integer", + "format": "int64" + }, + "Key": { + "type": "string" + } + } + }, + "Agreement": { + "type": "object", + "properties": { + "AgreementType": { + "type": "string", + "enum": [ + "None", + "LicenseAgreement", + "OpenAgreement", + "FrameAgreement", + "SamAgreement", + "ConsultingAgreement", + "CloudSeatAgreement", + "CloudUsageAgreement", + "ReportingAgreement", + "OtherAgreement", + "Reserved1", + "Reserved2", + "Reserved3" + ] + }, + "CommitmentLevel": { + "type": "number", + "format": "double" + }, + "CustomerNumber": { + "type": "string" + }, + "Disabled": { + "type": "boolean" + }, + "EndDate": { + "type": "string", + "format": "date-time" + }, + "HasTerms": { + "type": "boolean" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "MasterAgreement": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Number": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "ParentAgreementId": { + "type": "integer", + "format": "int32" + }, + "Program": { + "$ref": "#/definitions/ObjectReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "SalesPriceCurrencyCode": { + "type": "string" + }, + "StartDate": { + "type": "string", + "format": "date-time" + } + } + }, + "AgreementAccess": { + "type": "object", + "properties": { + "Agreement": { + "$ref": "#/definitions/Agreement" + }, + "HasAccess": { + "type": "boolean" + } + } + }, + "AgreementCollection": { + "type": "object", + "properties": { + "Filter": { + "$ref": "#/definitions/AgreementFilter" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Agreement" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "AgreementFilter": { + "type": "object", + "properties": { + "AgreementIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "AgreementTypes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "None", + "LicenseAgreement", + "OpenAgreement", + "FrameAgreement", + "SamAgreement", + "ConsultingAgreement", + "CloudSeatAgreement", + "CloudUsageAgreement", + "ReportingAgreement", + "OtherAgreement", + "Reserved1", + "Reserved2", + "Reserved3" + ] + } + }, + "EndDateFrom": { + "type": "string", + "format": "date-time" + }, + "EndDateTo": { + "type": "string", + "format": "date-time" + }, + "OrganizationId": { + "type": "integer", + "format": "int32" + }, + "OrganizationIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "Page": { + "type": "integer", + "format": "int32" + }, + "PageSize": { + "type": "integer", + "format": "int32" + }, + "PricelistIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "ProgramIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "PublisherId": { + "type": "integer", + "format": "int32" + }, + "PublisherIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "SalesPriceCurrency": { + "type": "string" + }, + "Search": { + "type": "string" + }, + "SearchDate": { + "type": "string", + "format": "date-time" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "Active", + "Inactive", + "ActiveInactive" + ] + }, + "TermRequired": { + "type": "boolean" + } + } + }, + "AgreementIdentityReference": { + "type": "object", + "properties": { + "AgreementNumber": { + "type": "string" + }, + "CommitmentLevel": { + "type": "number", + "format": "double" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "AgreementIdentityReferenceDto": { + "type": "object", + "properties": { + "AgreementNumber": { + "type": "string" + }, + "CommitmentLevel": { + "type": "number", + "format": "double" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "AgreementProduct": { + "type": "object", + "properties": { + "Agreement": { + "$ref": "#/definitions/ObjectReference" + }, + "AgreementType": { + "type": "string", + "enum": [ + "None", + "LicenseAgreement", + "OpenAgreement", + "FrameAgreement", + "SamAgreement", + "ConsultingAgreement", + "CloudSeatAgreement", + "CloudUsageAgreement", + "ReportingAgreement", + "OtherAgreement", + "Reserved1", + "Reserved2", + "Reserved3" + ] + }, + "AlternativeSalesPrice": { + "$ref": "#/definitions/Price" + }, + "MaximumQuantity": { + "type": "integer", + "format": "int32" + }, + "MinimumQuantity": { + "type": "integer", + "format": "int32" + }, + "MonthMultiplier": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + }, + "PriceCalculationType": { + "type": "string", + "enum": [ + "None", + "Default", + "SelectPlus", + "AdobeVip", + "Mpsa" + ] + }, + "PriceId": { + "type": "integer", + "format": "int32" + }, + "PriceListName": { + "type": "string" + }, + "ProductInformation": { + "$ref": "#/definitions/ProductInformation" + }, + "ProductType": { + "type": "string", + "enum": [ + "Product", + "Bundle", + "Service", + "Internal" + ] + }, + "ProductVariant": { + "$ref": "#/definitions/ProductVariant" + }, + "RecommendedRetailPrice": { + "$ref": "#/definitions/Price" + }, + "SalesPrice": { + "$ref": "#/definitions/Price" + }, + "UniqueId": { + "type": "string" + } + } + }, + "AgreementProductCollection": { + "type": "object", + "properties": { + "Agreements": { + "type": "array", + "items": { + "$ref": "#/definitions/ObjectReference" + } + }, + "Filter": { + "$ref": "#/definitions/AgreementProductFilter" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/AgreementProduct" + } + }, + "Languages": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "Levels": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "LicenseAgreementTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "LicenseTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "Offerings": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "OperatingSystems": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "Pools": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "ProductCategories": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "ProductFamilies": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "ProductTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "Programs": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "Publishers": { + "type": "array", + "items": { + "$ref": "#/definitions/PublisherAggregationItem" + } + }, + "PurchasePeriods": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "PurchaseUnits": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "Regions": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + }, + "Versions": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + } + } + }, + "AgreementProductFilter": { + "type": "object", + "properties": { + "AgreementId": { + "type": "integer", + "format": "int32" + }, + "AgreementIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "AgreementTypeIds": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "None", + "LicenseAgreement", + "OpenAgreement", + "FrameAgreement", + "SamAgreement", + "ConsultingAgreement", + "CloudSeatAgreement", + "CloudUsageAgreement", + "ReportingAgreement", + "OtherAgreement", + "Reserved1", + "Reserved2", + "Reserved3" + ] + } + }, + "CustomerTenantId": { + "type": "integer", + "format": "int32" + }, + "Exclude": { + "$ref": "#/definitions/AgreementProductsSubFilter" + }, + "Include": { + "$ref": "#/definitions/AgreementProductsSubFilter" + }, + "IncludeProductInformation": { + "type": "boolean" + }, + "IsTrial": { + "type": "boolean" + }, + "OrganizationId": { + "type": "integer", + "format": "int32" + }, + "Page": { + "type": "integer", + "format": "int32" + }, + "PageSize": { + "type": "integer", + "format": "int32" + }, + "PriceListId": { + "type": "integer", + "format": "int32" + }, + "Search": { + "type": "string" + }, + "SearchDate": { + "type": "string", + "format": "date-time" + }, + "SortKey": { + "type": "string" + }, + "SortOrder": { + "type": "string", + "enum": [ + "Ascending", + "Descending" + ] + } + } + }, + "AgreementProductsSubFilter": { + "type": "object", + "properties": { + "LanguageNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "LevelNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "LicenseAgreementTypeNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "LicenseTypeNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "OfferingNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "OperatingSystemNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "PartNumbers": { + "type": "array", + "items": { + "type": "string" + } + }, + "PoolNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "ProductCategoryNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "ProductFamilyNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "ProductTypeNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "ProgramNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "PublisherIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "PublisherNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "PurchasePeriodNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "PurchaseUnitNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "RegionNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "VersionNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AgreementReport": { + "type": "object", + "properties": { + "Agreement": { + "$ref": "#/definitions/AgreementIdentityReferenceDto" + }, + "HasValidAgreementTerm": { + "type": "boolean" + }, + "ProductContainer": { + "$ref": "#/definitions/ObjectReferenceDto" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "NotReported", + "ZeroUsageReported", + "UsageReported", + "UsageAndZeroUsageReported" + ] + } + } + }, + "ApiCollectionOfAddress": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfAgreementReport": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/AgreementReport" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfAsset": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Asset" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfAssetOrder": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/AssetOrder" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfAwsAccount": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/AwsAccount" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfAzureSubscription": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/AzureSubscription" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfBillingCycle": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/BillingCycle" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfBillingStatement": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/BillingStatement" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfBlogItem": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/BlogItem" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfBoolean": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "type": "boolean" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfCategoryUsageCost": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/CategoryUsageCost" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfClient": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Client" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfConsumer": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Consumer" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfCrayonAccount": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/CrayonAccount" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfCustomerTenant": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerTenant" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfGroupedBillingStatement": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/GroupedBillingStatement" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfGrouping": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Grouping" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfInvoiceProfile": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/InvoiceProfile" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfManagementLink": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ManagementLink" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfManagementLinkGrouped": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ManagementLinkGrouped" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfObjectReference": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ObjectReference" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfOrganization": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Organization" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfOrganizationAccess": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationAccess" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfOrganizationUsageCost": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/OrganizationUsageCost" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfProductContainer": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ProductContainer" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfProgram": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Program" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfPublisher": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Publisher" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfRegion": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Region" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfResourceGroupUsageCost": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceGroupUsageCost" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfServiceAccountAgreement": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceAccountAgreement" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfSubcategoryUsageCost": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/SubcategoryUsageCost" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfSubscription": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/Subscription" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfSubscriptionAddOnOffer": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionAddOnOffer" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfSubscriptionConversion": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionConversion" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfSubscriptionResourceGroupUsageCost": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionResourceGroupUsageCost" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfSubscriptionUsageCost": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionUsageCost" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "ApiCollectionOfUser": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "TotalHits": { + "type": "integer", + "format": "int64" + } + } + }, + "Asset": { + "type": "object", + "properties": { + "AssetType": { + "type": "string", + "enum": [ + "Reservation", + "Software", + "Subscription" + ] + }, + "BillingCycle": { + "type": "string", + "enum": [ + "Unknown", + "Monthly", + "Annual", + "None", + "OneTime" + ] + }, + "ChangedBy": { + "type": "string" + }, + "CreatedDate": { + "type": "string", + "format": "date-time" + }, + "ExpirationDate": { + "type": "string", + "format": "date-time" + }, + "ExternalOrderId": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "ModifiedDate": { + "type": "string", + "format": "date-time" + }, + "ProductId": { + "type": "integer", + "format": "int32" + }, + "ProductVariant": { + "$ref": "#/definitions/ProductVariant" + }, + "ProductVariantId": { + "type": "integer", + "format": "int32" + }, + "ProgramId": { + "type": "integer", + "format": "int32" + }, + "PublisherId": { + "type": "integer", + "format": "int32" + }, + "PurchaseCurrency": { + "type": "string" + }, + "PurchaseDate": { + "type": "string", + "format": "date-time" + }, + "PurchasePrice": { + "type": "number", + "format": "double" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "ResellerCustomerId": { + "type": "integer", + "format": "int32" + }, + "ResellerPriceType": { + "type": "string", + "enum": [ + "None", + "Margin", + "Markup", + "FixedPrice", + "ListPrice" + ] + }, + "ResellerPriceTypeValue": { + "type": "number", + "format": "double" + }, + "ReservationId": { + "type": "string" + }, + "ReservationUsedInSubscription": { + "$ref": "#/definitions/SubscriptionLite" + }, + "ReservationUsedInSubscriptionId": { + "type": "integer", + "format": "int32" + }, + "ReservedInstanceArtifactResourceId": { + "type": "string" + }, + "SalesCurrency": { + "type": "string" + }, + "SalesPrice": { + "type": "number", + "format": "double" + }, + "Scope": { + "type": "string", + "enum": [ + "Shared", + "Single" + ] + }, + "StartDate": { + "type": "string", + "format": "date-time" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "Fulfilling", + "Succeeded", + "Cancelled", + "Expired", + "All" + ] + }, + "Tags": { + "$ref": "#/definitions/AssetTags" + } + } + }, + "AssetOrder": { + "type": "object", + "properties": { + "AdminAccount": { + "type": "string" + }, + "CountryCode": { + "type": "string" + }, + "Errors": { + "type": "array", + "items": { + "$ref": "#/definitions/AssetOrderError" + } + }, + "ExternalOrderId": { + "type": "string" + }, + "NotificationEmail": { + "type": "string" + }, + "OrderLines": { + "type": "array", + "items": { + "$ref": "#/definitions/AssetOrderLine" + } + }, + "ResellerCustomerId": { + "type": "integer", + "format": "int32" + } + } + }, + "AssetOrderError": { + "type": "object", + "properties": { + "Code": { + "type": "integer", + "format": "int32" + }, + "Description": { + "type": "string" + }, + "OrderGroupId": { + "type": "string" + } + } + }, + "AssetOrderLine": { + "type": "object", + "properties": { + "ArmRegionName": { + "type": "string" + }, + "BillingCycle": { + "type": "string", + "enum": [ + "Unknown", + "Monthly", + "Annual", + "None", + "OneTime" + ] + }, + "CatalogItemId": { + "type": "string" + }, + "Errors": { + "type": "array", + "items": { + "$ref": "#/definitions/AssetOrderLineError" + } + }, + "ProductId": { + "type": "string" + }, + "ProductVariantId": { + "type": "integer", + "format": "int32" + }, + "ProvisioningContext": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "RequiresInventoryCheck": { + "type": "boolean" + }, + "ResellerPriceType": { + "type": "string", + "enum": [ + "None", + "Margin", + "Markup", + "FixedPrice", + "ListPrice" + ] + }, + "ResellerPriceTypeValue": { + "type": "number", + "format": "double" + }, + "Scope": { + "type": "string", + "enum": [ + "Shared", + "Single" + ] + }, + "SkuId": { + "type": "string" + }, + "SubscriptionId": { + "type": "integer", + "format": "int32" + }, + "Tags": { + "$ref": "#/definitions/AssetTags" + }, + "TermDuration": { + "type": "string" + }, + "Type": { + "type": "string", + "enum": [ + "Reservation", + "Software", + "Subscription" + ] + } + } + }, + "AssetOrderLineError": { + "type": "object", + "properties": { + "Description": { + "type": "string" + }, + "Properties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "ReasonCode": { + "type": "string" + } + } + }, + "AssetTags": { + "type": "object", + "properties": { + "AssetId": { + "type": "integer", + "format": "int32" + }, + "CostCenter": { + "type": "string" + }, + "Custom": { + "type": "string" + }, + "Department": { + "type": "string" + }, + "Owner": { + "type": "string" + }, + "Project": { + "type": "string" + } + } + }, + "AwsAccount": { + "type": "object", + "properties": { + "CustomerTenantType": { + "type": "string", + "enum": [ + "None", + "T1", + "T2" + ] + }, + "Email": { + "type": "string" + }, + "EntityStatus": { + "type": "string", + "enum": [ + "None", + "Removed" + ] + }, + "ExternalPublisherCustomerId": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "IsActivated": { + "type": "boolean" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/Organization" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "Reference": { + "type": "string" + }, + "Tags": { + "$ref": "#/definitions/SubscriptionTags" + } + } + }, + "AzurePlan": { + "type": "object", + "properties": { + "CustomerTenant": { + "$ref": "#/definitions/CustomerTenantReference" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "PublisherSubscriptionId": { + "type": "string" + }, + "RegisteredForReservedInstance": { + "type": "boolean" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "Active", + "Suspended", + "Deleted", + "CustomerCancellation", + "Converted", + "Inactive", + "All" + ] + } + } + }, + "AzureSubscription": { + "type": "object", + "properties": { + "AzurePlanId": { + "type": "integer", + "format": "int32" + }, + "FriendlyName": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "PublisherSubscriptionId": { + "type": "string" + }, + "Status": { + "type": "string" + }, + "Tags": { + "$ref": "#/definitions/AzureSubscriptionTags" + } + } + }, + "AzureSubscriptionAssignAdmin": { + "type": "object", + "properties": { + "AdminEmail": { + "type": "string" + }, + "AzurePlanId": { + "type": "integer", + "format": "int32" + }, + "AzureSubscriptionId": { + "type": "integer", + "format": "int32" + } + } + }, + "AzureSubscriptionRename": { + "type": "object", + "properties": { + "AzurePlanId": { + "type": "integer", + "format": "int32" + }, + "AzureSubscriptionId": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "AzureSubscriptionTags": { + "type": "object", + "properties": { + "CostCenter": { + "type": "string" + }, + "Custom": { + "type": "string" + }, + "Department": { + "type": "string" + }, + "Owner": { + "type": "string" + }, + "Project": { + "type": "string" + } + } + }, + "AzureSubscriptionUpdated": { + "type": "object", + "properties": { + "AzureSubscriptionId": { + "type": "string" + } + } + }, + "BillingCycle": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "BillingStatement": { + "type": "object", + "properties": { + "EndDate": { + "type": "string", + "format": "date-time" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "OrderId": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "ProvisionType": { + "type": "string", + "enum": [ + "None", + "Seat", + "Usage", + "OneTime", + "Crayon", + "AzureMarketplace" + ] + }, + "StartDate": { + "type": "string", + "format": "date-time" + }, + "TotalSalesPrice": { + "$ref": "#/definitions/Price" + } + } + }, + "BlogItem": { + "type": "object", + "properties": { + "Author": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Image": { + "type": "string" + }, + "Link": { + "type": "string" + }, + "PublicationDate": { + "type": "string", + "format": "date-time" + }, + "Title": { + "type": "string" + } + } + }, + "CategoryUsageCost": { + "type": "object", + "properties": { + "Amount": { + "type": "number", + "format": "double" + }, + "CurrencyCode": { + "type": "string" + }, + "Subcategory": { + "type": "string" + } + } + }, + "CategoryUsageCostRequest": { + "type": "object", + "properties": { + "Category": { + "type": "string" + }, + "CurrencyCode": { + "type": "string" + }, + "From": { + "type": "string", + "format": "date-time" + }, + "ResellerCustomerId": { + "type": "integer", + "format": "int32" + }, + "SubscriptionId": { + "type": "string" + }, + "To": { + "type": "string", + "format": "date-time" + } + } + }, + "Client": { + "type": "object", + "properties": { + "ClientId": { + "type": "string" + }, + "ClientName": { + "type": "string" + }, + "ClientSecrets": { + "type": "array", + "items": { + "$ref": "#/definitions/Secret" + } + }, + "ClientUri": { + "type": "string" + }, + "Enabled": { + "type": "boolean" + }, + "Flow": { + "type": "string", + "enum": [ + "AuthorizationCode", + "Implicit", + "ResourceOwner", + "Other" + ] + }, + "RedirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "TimeStamp": { + "type": "string", + "format": "date-time" + } + } + }, + "Consumer": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + } + } + }, + "CrayonAccount": { + "type": "object", + "properties": { + "Contact": { + "$ref": "#/definitions/CustomerTenantContact" + }, + "CustomerTenantType": { + "type": "string", + "enum": [ + "None", + "T1", + "T2" + ] + }, + "Email": { + "type": "string" + }, + "EntityStatus": { + "type": "string", + "enum": [ + "None", + "Removed" + ] + }, + "ExternalPublisherCustomerId": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "IsActivated": { + "type": "boolean" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/Organization" + }, + "Program": { + "$ref": "#/definitions/ObjectReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "Reference": { + "type": "string" + }, + "ResellerMarkup": { + "type": "number", + "format": "double" + } + } + }, + "CreateAzureSubscriptionRequest": { + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "CustomerTenant": { + "type": "object", + "properties": { + "Consumer": { + "$ref": "#/definitions/ObjectReference" + }, + "CustomerTenantType": { + "type": "string", + "enum": [ + "None", + "T1", + "T2" + ] + }, + "DefaultSubscriptionPriceType": { + "type": "string", + "enum": [ + "PurchasePrice", + "ListPrice", + "FixedPrice" + ] + }, + "Domain": { + "type": "string" + }, + "DomainPrefix": { + "type": "string" + }, + "EntityStatus": { + "type": "string", + "enum": [ + "None", + "Removed" + ] + }, + "ExternalPublisherCustomerId": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/Organization" + }, + "Program": { + "$ref": "#/definitions/ObjectReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "PublisherCustomerId": { + "type": "string" + }, + "Reference": { + "type": "string" + }, + "ResellerMarkup": { + "type": "number", + "format": "double" + }, + "agreement": { + "$ref": "#/definitions/CustomerTenantAgreement" + } + } + }, + "CustomerTenantAddress": { + "type": "object", + "properties": { + "AddressLine1": { + "type": "string" + }, + "AddressLine2": { + "type": "string" + }, + "AddressLine3": { + "type": "string" + }, + "City": { + "type": "string" + }, + "CountryCode": { + "type": "string" + }, + "CountryName": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "PostalCode": { + "type": "string" + }, + "Region": { + "type": "string" + } + } + }, + "CustomerTenantAgreement": { + "type": "object", + "properties": { + "Accepted": { + "type": "boolean" + }, + "AgreementType": { + "type": "string", + "enum": [ + "MicrosoftCloudAgreement", + "MicrosoftCustomerAgreement" + ] + }, + "DateAgreed": { + "type": "string", + "format": "date-time" + }, + "Email": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "PhoneNumber": { + "type": "string" + }, + "SameAsPrimaryContact": { + "type": "boolean" + } + } + }, + "CustomerTenantContact": { + "type": "object", + "properties": { + "Email": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "PhoneNumber": { + "type": "string" + } + } + }, + "CustomerTenantDetailed": { + "type": "object", + "properties": { + "Profile": { + "$ref": "#/definitions/CustomerTenantProfile" + }, + "Tenant": { + "$ref": "#/definitions/CustomerTenant" + }, + "User": { + "$ref": "#/definitions/CustomerTenantUser" + } + } + }, + "CustomerTenantProfile": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/CustomerTenantAddress" + }, + "Agreement": { + "$ref": "#/definitions/CustomerTenantAgreement" + }, + "Contact": { + "$ref": "#/definitions/CustomerTenantContact" + }, + "CultureCode": { + "type": "string" + }, + "LanguageCode": { + "type": "string" + } + } + }, + "CustomerTenantReference": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + } + } + }, + "CustomerTenantUser": { + "type": "object", + "properties": { + "Password": { + "type": "string" + }, + "UserName": { + "type": "string" + } + } + }, + "FacebookOrder": { + "type": "object", + "properties": { + "ConsumerContactEmail": { + "type": "string" + }, + "ConsumerContactName": { + "type": "string" + }, + "ConsumerFullLegalName": { + "type": "string" + }, + "ConsumerSignupEmail": { + "type": "string" + }, + "ContactEmail": { + "type": "string" + }, + "ContactName": { + "type": "string" + }, + "InvoiceProfileId": { + "type": "integer", + "format": "int32" + }, + "Lines": { + "type": "array", + "items": { + "$ref": "#/definitions/FacebookOrderLine" + } + }, + "OrganizationId": { + "type": "integer", + "format": "int32" + }, + "SubscriptionStartDate": { + "type": "string", + "format": "date-time" + } + } + }, + "FacebookOrderLine": { + "type": "object", + "properties": { + "AgreementId": { + "type": "integer", + "format": "int32" + }, + "ProductVariantId": { + "type": "integer", + "format": "int32" + }, + "PublisherId": { + "type": "integer", + "format": "int32" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "Sku": { + "type": "string" + } + } + }, + "GoogleOrder": { + "type": "object", + "properties": { + "ConsumerCity": { + "type": "string" + }, + "ConsumerContactEmail": { + "type": "string" + }, + "ConsumerContactName": { + "type": "string" + }, + "ConsumerCountry": { + "type": "string" + }, + "ConsumerFullLegalName": { + "type": "string" + }, + "ConsumerPhoneNumber": { + "type": "string" + }, + "ConsumerState": { + "type": "string" + }, + "ConsumerStreetAddress": { + "type": "string" + }, + "ConsumerZipCode": { + "type": "string" + }, + "ContactEmail": { + "type": "string" + }, + "ContactName": { + "type": "string" + }, + "DomainName": { + "type": "string" + }, + "InvoiceProfileId": { + "type": "integer", + "format": "int32" + }, + "Lines": { + "type": "array", + "items": { + "$ref": "#/definitions/GoogleOrderLine" + } + }, + "OrganizationId": { + "type": "integer", + "format": "int32" + }, + "PrimaryAdminName": { + "type": "string" + }, + "PrimaryAdminUserName": { + "type": "string" + }, + "SubscriptionStartDate": { + "type": "string", + "format": "date-time" + } + } + }, + "GoogleOrderLine": { + "type": "object", + "properties": { + "AgreementId": { + "type": "integer", + "format": "int32" + }, + "ProductVariantId": { + "type": "integer", + "format": "int32" + }, + "PublisherId": { + "type": "integer", + "format": "int32" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "Sku": { + "type": "string" + } + } + }, + "GroupedBillingStatement": { + "type": "object", + "properties": { + "EndDate": { + "type": "string", + "format": "date-time" + }, + "GroupId": { + "type": "integer", + "format": "int32" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "OrderId": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "ProvisionType": { + "type": "string", + "enum": [ + "None", + "Seat", + "Usage", + "OneTime", + "Crayon", + "AzureMarketplace" + ] + }, + "StartDate": { + "type": "string", + "format": "date-time" + }, + "TotalSalesPrice": { + "$ref": "#/definitions/Price" + } + } + }, + "Grouping": { + "type": "object", + "properties": { + "CreatedDate": { + "type": "string", + "format": "date-time" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "InvoiceReference": { + "type": "string" + }, + "IsDisabled": { + "type": "boolean" + }, + "IsRemoved": { + "type": "boolean" + }, + "ModifiedDate": { + "type": "string", + "format": "date-time" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + } + } + }, + "InvoiceProfile": { + "type": "object", + "properties": { + "CustomerReference": { + "type": "string" + }, + "DeliveryAddress": { + "$ref": "#/definitions/AddressData" + }, + "DeliveryAddressId": { + "type": "integer", + "format": "int64" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceAddress": { + "$ref": "#/definitions/AddressData" + }, + "InvoiceAddressId": { + "type": "integer", + "format": "int64" + }, + "InvoiceReference": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "RequisitionNumber": { + "type": "string" + } + } + }, + "ManagementLink": { + "type": "object", + "properties": { + "Link": { + "type": "string" + }, + "ResellerCustomer": { + "$ref": "#/definitions/ObjectReference" + }, + "Subscription": { + "$ref": "#/definitions/ObjectReference" + }, + "Text": { + "type": "string" + } + } + }, + "ManagementLinkGrouped": { + "type": "object", + "properties": { + "Link": { + "type": "string" + }, + "ResellerCustomer": { + "$ref": "#/definitions/ObjectReference" + }, + "Text": { + "type": "string" + } + } + }, + "Me": { + "type": "object", + "properties": { + "Claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "Token": { + "type": "string" + }, + "UserId": { + "type": "string" + }, + "UserName": { + "type": "string" + } + } + }, + "MinimumCommitmentLight": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Months": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "ObjectReference": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "ObjectReferenceDto": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "AccountNumber": { + "type": "string" + }, + "CrayonCompanyName": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + }, + "ParentId": { + "type": "integer", + "format": "int32" + } + } + }, + "OrganizationAccess": { + "type": "object", + "properties": { + "Agreements": { + "type": "array", + "items": { + "$ref": "#/definitions/AgreementAccess" + } + }, + "AllAgreements": { + "type": "boolean" + }, + "CrayonCompanyName": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "Organization": { + "$ref": "#/definitions/Organization" + }, + "Role": { + "type": "string", + "enum": [ + "None", + "User", + "Administrator", + "Viewer", + "EditRights", + "All" + ] + }, + "Timestamp": { + "type": "string", + "format": "date-time" + }, + "User": { + "$ref": "#/definitions/UserProfile" + } + } + }, + "OrganizationSalesContact": { + "type": "object", + "properties": { + "Email": { + "type": "string" + }, + "FullName": { + "type": "string" + }, + "Phone": { + "type": "string" + } + } + }, + "OrganizationUsageCost": { + "type": "object", + "properties": { + "AccountId": { + "type": "integer", + "format": "int32" + }, + "AccountName": { + "type": "string" + }, + "Amount": { + "type": "number", + "format": "double" + }, + "CurrencyCode": { + "type": "string" + }, + "SubscriptionId": { + "type": "string" + }, + "SubscriptionName": { + "type": "string" + }, + "Supplier": { + "type": "string" + } + } + }, + "PostSubscriptionAddOn": { + "type": "object", + "properties": { + "OfferId": { + "type": "string" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "SubscriptionTags": { + "$ref": "#/definitions/SubscriptionTags" + } + } + }, + "Price": { + "type": "object", + "properties": { + "CurrencyCode": { + "type": "string" + }, + "Value": { + "type": "number", + "format": "double" + } + } + }, + "ProductContainer": { + "type": "object", + "properties": { + "ActiveDraft": { + "type": "boolean" + }, + "AxContactUserId": { + "type": "string" + }, + "Category": { + "type": "string", + "enum": [ + "None", + "Seat", + "Report" + ] + }, + "Comments": { + "type": "array", + "items": { + "$ref": "#/definitions/ProductContainerComment" + } + }, + "ContactUser": { + "$ref": "#/definitions/UserProfile" + }, + "CreatedByUserId": { + "type": "string" + }, + "CreatedDate": { + "type": "string", + "format": "date-time" + }, + "DeliveryAddress": { + "$ref": "#/definitions/AddressData" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceAddress": { + "$ref": "#/definitions/AddressData" + }, + "InvoiceProfile": { + "$ref": "#/definitions/InvoiceProfile" + }, + "InvoiceReference": { + "type": "string" + }, + "Issues": { + "type": "array", + "items": { + "$ref": "#/definitions/ProductContainerIssue" + } + }, + "Name": { + "type": "string" + }, + "Note": { + "type": "string" + }, + "OrderListId": { + "type": "integer", + "format": "int32" + }, + "OrderReference": { + "type": "string" + }, + "OrderStatusChangedDate": { + "type": "string", + "format": "date-time" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "ProductRows": { + "type": "array", + "items": { + "$ref": "#/definitions/ProductRow" + } + }, + "Program": { + "$ref": "#/definitions/Program" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "QuoteValidToDate": { + "type": "string", + "format": "date-time" + }, + "Removed": { + "type": "boolean" + }, + "Requisition": { + "type": "string" + }, + "Sent": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "SubmittedBy": { + "$ref": "#/definitions/ProductContainerCommentUser", + "readOnly": true + }, + "TotalAlternativeSalesPrice": { + "type": "array", + "items": { + "$ref": "#/definitions/Price" + } + }, + "TotalSalesPrice": { + "type": "array", + "items": { + "$ref": "#/definitions/Price" + } + }, + "Type": { + "type": "string", + "enum": [ + "None", + "Draft", + "Request", + "Order", + "Quote", + "Template" + ] + }, + "UsageMonth": { + "type": "string", + "format": "date-time" + } + } + }, + "ProductContainerComment": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Message": { + "type": "string" + }, + "Modified": { + "type": "string", + "format": "date-time" + }, + "ProductContainerCommentType": { + "type": "string", + "enum": [ + "None", + "Comment", + "DraftCreated", + "DraftModified", + "QuoteCreated", + "QuoteModified", + "RequestCreated", + "RequestModifed", + "OrderSubmitted", + "OrderInvoiced", + "Removed", + "TemplateCreated", + "TemplateModifed", + "RequestDeclined", + "SystemMessage" + ] + }, + "ProductContainerId": { + "type": "integer", + "format": "int32" + }, + "Removed": { + "type": "boolean" + }, + "TimeStamp": { + "type": "string", + "format": "date-time" + }, + "User": { + "$ref": "#/definitions/ProductContainerCommentUser" + } + } + }, + "ProductContainerCommentUser": { + "type": "object", + "properties": { + "CrayonEmployee": { + "type": "boolean" + }, + "FirstName": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "UserName": { + "type": "string" + } + } + }, + "ProductContainerIssue": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, + "ProductInformation": { + "type": "object", + "properties": { + "CultureCode": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "ExternalProductId": { + "type": "integer", + "format": "int32" + }, + "LearnMoreLink": { + "type": "string" + } + } + }, + "ProductReference": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "ItemLegalName": { + "type": "string" + }, + "ItemName": { + "type": "string" + }, + "PartNumber": { + "type": "string" + }, + "PublisherProductId": { + "type": "string" + } + } + }, + "ProductRow": { + "type": "object", + "properties": { + "Agreement": { + "$ref": "#/definitions/AgreementIdentityReference" + }, + "AlternativeSalesUnitPrice": { + "$ref": "#/definitions/Price" + }, + "Comment": { + "type": "string" + }, + "CustomerReference": { + "type": "string" + }, + "Grouping": { + "$ref": "#/definitions/Grouping" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "InvoiceReference": { + "type": "string" + }, + "Issues": { + "type": "array", + "items": { + "$ref": "#/definitions/ProductContainerIssue" + } + }, + "LevelValue": { + "type": "number", + "format": "double" + }, + "OfferingType": { + "type": "string" + }, + "PriceCalculation": { + "type": "string", + "enum": [ + "None", + "Default", + "SelectPlus", + "AdobeVip", + "Mpsa" + ] + }, + "Product": { + "$ref": "#/definitions/ProductReference" + }, + "ProductContainerId": { + "type": "integer", + "format": "int32" + }, + "ProductVariant": { + "$ref": "#/definitions/ObjectReference" + }, + "Program": { + "$ref": "#/definitions/ObjectReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "SalesPricePerAlternativeUnit": { + "type": "number", + "format": "double" + }, + "SalesUnitPrice": { + "$ref": "#/definitions/Price" + }, + "UsageCountryCode": { + "type": "string" + }, + "User": { + "$ref": "#/definitions/ProductRowUser" + } + } + }, + "ProductRowPatch": { + "type": "object", + "properties": { + "Agreement": { + "$ref": "#/definitions/ObjectReference" + }, + "Comment": { + "type": "string" + }, + "Grouping": { + "$ref": "#/definitions/ObjectReference" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "ProductVariant": { + "$ref": "#/definitions/ObjectReference" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "UsageCountryCode": { + "type": "string" + }, + "UserId": { + "type": "string" + } + } + }, + "ProductRowUser": { + "type": "object", + "properties": { + "CrayonEmployee": { + "type": "boolean" + }, + "FirstName": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "UserName": { + "type": "string" + } + } + }, + "ProductVariant": { + "type": "object", + "properties": { + "AddDate": { + "type": "string", + "format": "date-time" + }, + "Attributes": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "AvailableBillingCycleIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "DefaultBillingCycleId": { + "type": "integer", + "format": "int32" + }, + "DeleteDate": { + "type": "string", + "format": "date-time" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "IsTrial": { + "type": "boolean" + }, + "Language": { + "$ref": "#/definitions/ObjectReference" + }, + "Level": { + "$ref": "#/definitions/ObjectReference" + }, + "LicenseAgreementType": { + "$ref": "#/definitions/ObjectReference" + }, + "LicenseType": { + "$ref": "#/definitions/ObjectReference" + }, + "MinimumCommitment": { + "$ref": "#/definitions/MinimumCommitmentLight" + }, + "Offering": { + "$ref": "#/definitions/ObjectReference" + }, + "OperatingSystem": { + "$ref": "#/definitions/ObjectReference" + }, + "PartNumber": { + "type": "string" + }, + "Pool": { + "$ref": "#/definitions/ObjectReference" + }, + "Product": { + "$ref": "#/definitions/ProductReference" + }, + "ProductCategory": { + "type": "string" + }, + "ProductFamily": { + "$ref": "#/definitions/ObjectReference" + }, + "ProductName": { + "type": "string" + }, + "ProductType": { + "$ref": "#/definitions/ObjectReference" + }, + "Program": { + "$ref": "#/definitions/ObjectReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "PurchaseUnit": { + "type": "string" + }, + "Region": { + "type": "string" + }, + "UnitCount": { + "type": "integer", + "format": "int32" + }, + "Version": { + "type": "string" + } + } + }, + "Program": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "IsCommitment": { + "type": "boolean" + }, + "Name": { + "type": "string" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + } + } + }, + "Publisher": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + } + } + }, + "PublisherAggregationItem": { + "type": "object", + "properties": { + "DocCount": { + "type": "integer", + "format": "int64" + }, + "Key": { + "type": "string" + }, + "Programs": { + "type": "array", + "items": { + "$ref": "#/definitions/AggregationItem" + } + } + } + }, + "PutAzureSubscription": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "Tags": { + "$ref": "#/definitions/AzureSubscriptionTags" + } + } + }, + "Region": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + }, + "ResellerSalesPrice": { + "type": "object", + "properties": { + "FromDate": { + "type": "string", + "format": "date-time" + }, + "ObjectId": { + "type": "integer", + "format": "int32" + }, + "ObjectType": { + "type": "string", + "enum": [ + "Organization", + "CustomerTenant", + "Subscription", + "SubscriptionAddon", + "AzureSubscription" + ] + }, + "PriceType": { + "type": "string", + "enum": [ + "Markup", + "FixedPrice", + "ListPrice" + ] + }, + "Type": { + "type": "string", + "enum": [ + "License", + "Usage", + "OneTime" + ] + }, + "Value": { + "type": "number", + "format": "double" + } + } + }, + "ResellerSalesPriceToggle": { + "type": "object", + "properties": { + "ObjectId": { + "type": "integer", + "format": "int32" + }, + "ObjectType": { + "type": "string", + "enum": [ + "Organization", + "CustomerTenant", + "Subscription", + "SubscriptionAddon", + "AzureSubscription" + ] + }, + "Toggle": { + "type": "boolean" + } + } + }, + "ResourceGroupUsageCost": { + "type": "object", + "properties": { + "Amount": { + "type": "number", + "format": "double" + }, + "Category": { + "type": "string" + }, + "CurrencyCode": { + "type": "string" + }, + "Meter": { + "type": "string" + }, + "Subcategory": { + "type": "string" + } + } + }, + "ResourceGroupUsageCostRequest": { + "type": "object", + "properties": { + "CurrencyCode": { + "type": "string" + }, + "From": { + "type": "string", + "format": "date-time" + }, + "ResellerCustomerId": { + "type": "integer", + "format": "int32" + }, + "ResourceGroup": { + "type": "string" + }, + "SubscriptionId": { + "type": "string" + }, + "To": { + "type": "string", + "format": "date-time" + } + } + }, + "Secret": { + "type": "object", + "properties": { + "ClientId": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "Expiration": { + "type": "string", + "format": "date-time" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "TimeStamp": { + "type": "string", + "format": "date-time" + }, + "Value": { + "type": "string" + } + } + }, + "ServiceAccountAgreement": { + "type": "object", + "properties": { + "AgreementType": { + "type": "string", + "enum": [ + "MicrosoftCloudAgreement", + "MicrosoftCustomerAgreement" + ] + }, + "DateAgreed": { + "type": "string", + "format": "date-time" + }, + "Email": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "PhoneNumber": { + "type": "string" + } + } + }, + "SubcategoryUsageCost": { + "type": "object", + "properties": { + "Amount": { + "type": "number", + "format": "double" + }, + "CurrencyCode": { + "type": "string" + }, + "Meter": { + "type": "string" + } + } + }, + "SubcategoryUsageCostRequest": { + "type": "object", + "properties": { + "Category": { + "type": "string" + }, + "CurrencyCode": { + "type": "string" + }, + "From": { + "type": "string", + "format": "date-time" + }, + "ResellerCustomerId": { + "type": "integer", + "format": "int32" + }, + "Subcategory": { + "type": "string" + }, + "SubscriptionId": { + "type": "string" + }, + "To": { + "type": "string", + "format": "date-time" + } + } + }, + "Subscription": { + "type": "object", + "properties": { + "AvailableAddonsCount": { + "type": "integer", + "format": "int32" + }, + "BillingCycle": { + "type": "string", + "enum": [ + "Unknown", + "Monthly", + "Annual", + "None", + "OneTime", + "BiAnnually", + "TwoYears", + "ThreeYears", + "Quarterly" + ] + }, + "CreationDate": { + "type": "string", + "format": "date-time" + }, + "CustomerTenant": { + "$ref": "#/definitions/CustomerTenantReference" + }, + "EndDate": { + "type": "string", + "format": "date-time" + }, + "EntitlementId": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "IsTrial": { + "type": "boolean" + }, + "Markup": { + "type": "number", + "format": "double" + }, + "Name": { + "type": "string" + }, + "OrderId": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "PriceType": { + "type": "string", + "enum": [ + "PurchasePrice", + "ListPrice", + "FixedPrice" + ] + }, + "Product": { + "$ref": "#/definitions/ProductReference" + }, + "ProvisionType": { + "type": "string", + "enum": [ + "None", + "Seat", + "Usage", + "OneTime", + "Crayon", + "AzureMarketplace" + ] + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "PublisherSubscriptionId": { + "type": "string" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "RegisteredForReservedInstance": { + "type": "boolean" + }, + "SalesPrice": { + "type": "number", + "format": "double" + }, + "StartDate": { + "type": "string", + "format": "date-time" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "Active", + "Suspended", + "Deleted", + "CustomerCancellation", + "Converted", + "Inactive", + "All" + ] + }, + "SubscriptionTags": { + "$ref": "#/definitions/SubscriptionTags" + }, + "Subscriptions": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionAddOn" + } + } + } + }, + "SubscriptionAddOn": { + "type": "object", + "properties": { + "CreationDate": { + "type": "string", + "format": "date-time" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "Markup": { + "type": "number", + "format": "double" + }, + "Name": { + "type": "string" + }, + "OrderId": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "Product": { + "$ref": "#/definitions/ProductReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "PublisherCustomerId": { + "type": "string" + }, + "PublisherSubscriptionId": { + "type": "string" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "Active", + "Suspended", + "Deleted", + "CustomerCancellation", + "Converted", + "Inactive", + "All" + ] + }, + "SubscriptionTags": { + "$ref": "#/definitions/SubscriptionTags" + } + } + }, + "SubscriptionAddOnOffer": { + "type": "object", + "properties": { + "Product": { + "$ref": "#/definitions/ProductReference" + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + } + } + }, + "SubscriptionConversion": { + "type": "object", + "properties": { + "BillingCycle": { + "type": "string", + "enum": [ + "Unknown", + "Monthly", + "Annual", + "None", + "OneTime", + "BiAnnually", + "TwoYears", + "ThreeYears", + "Quarterly" + ] + }, + "OfferId": { + "type": "string" + }, + "OrderId": { + "type": "string" + }, + "ProductName": { + "type": "string" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "TargetOfferId": { + "type": "string" + } + } + }, + "SubscriptionDetailed": { + "type": "object", + "properties": { + "AvailableAddonsCount": { + "type": "integer", + "format": "int32" + }, + "BillingCycle": { + "type": "string", + "enum": [ + "Unknown", + "Monthly", + "Annual", + "None", + "OneTime", + "BiAnnually", + "TwoYears", + "ThreeYears", + "Quarterly" + ] + }, + "CommitmentEndDate": { + "type": "string", + "format": "date-time" + }, + "CreationDate": { + "type": "string", + "format": "date-time" + }, + "CustomerTenant": { + "$ref": "#/definitions/CustomerTenantReference" + }, + "EffectiveStartDate": { + "type": "string", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "format": "date-time" + }, + "EntitlementId": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "InvoiceProfile": { + "$ref": "#/definitions/ObjectReference" + }, + "IsTrial": { + "type": "boolean" + }, + "Markup": { + "type": "number", + "format": "double" + }, + "Name": { + "type": "string" + }, + "OrderId": { + "type": "string" + }, + "Organization": { + "$ref": "#/definitions/ObjectReference" + }, + "OriginalAgreementId": { + "type": "integer", + "format": "int32" + }, + "PriceType": { + "type": "string", + "enum": [ + "PurchasePrice", + "ListPrice", + "FixedPrice" + ] + }, + "Pricing": { + "$ref": "#/definitions/SubscriptionPricing" + }, + "Product": { + "$ref": "#/definitions/ProductReference" + }, + "ProvisionType": { + "type": "string", + "enum": [ + "None", + "Seat", + "Usage", + "OneTime", + "Crayon", + "AzureMarketplace" + ] + }, + "Publisher": { + "$ref": "#/definitions/ObjectReference" + }, + "PublisherSubscriptionId": { + "type": "string" + }, + "Quantity": { + "type": "integer", + "format": "int32" + }, + "RegisteredForReservedInstance": { + "type": "boolean" + }, + "SalesPrice": { + "type": "number", + "format": "double" + }, + "StartDate": { + "type": "string", + "format": "date-time" + }, + "Status": { + "type": "string", + "enum": [ + "None", + "Active", + "Suspended", + "Deleted", + "CustomerCancellation", + "Converted", + "Inactive", + "All" + ] + }, + "SubscriptionTags": { + "$ref": "#/definitions/SubscriptionTags" + }, + "Subscriptions": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionAddOn" + } + }, + "SuspensionReasons": { + "type": "string" + } + } + }, + "SubscriptionLite": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string" + }, + "PublisherSubscriptionId": { + "type": "string" + }, + "ResellerCustomerName": { + "type": "string" + } + } + }, + "SubscriptionPricing": { + "type": "object", + "properties": { + "CurrencyCode": { + "type": "string" + }, + "PurchasePrice": { + "type": "number", + "format": "double" + }, + "RecommendedRetailPrice": { + "type": "number", + "format": "double" + } + } + }, + "SubscriptionResourceGroupUsageCost": { + "type": "object", + "properties": { + "Amount": { + "type": "number", + "format": "double" + }, + "CurrencyCode": { + "type": "string" + }, + "ResourceGroup": { + "type": "string" + } + } + }, + "SubscriptionTags": { + "type": "object", + "properties": { + "CostCenter": { + "type": "string" + }, + "CreatedDate": { + "type": "string", + "format": "date-time" + }, + "Custom": { + "type": "string" + }, + "Department": { + "type": "string" + }, + "ModifiedDate": { + "type": "string", + "format": "date-time" + }, + "Owner": { + "type": "string" + }, + "Project": { + "type": "string" + }, + "SubscriptionId": { + "type": "integer", + "format": "int32" + } + } + }, + "SubscriptionUsageCost": { + "type": "object", + "properties": { + "Amount": { + "type": "number", + "format": "double" + }, + "Category": { + "type": "string" + }, + "CurrencyCode": { + "type": "string" + } + } + }, + "SubscriptionUsageCostRequest": { + "type": "object", + "properties": { + "CurrencyCode": { + "type": "string" + }, + "From": { + "type": "string", + "format": "date-time" + }, + "ResellerCustomerId": { + "type": "integer", + "format": "int32" + }, + "SubscriptionId": { + "type": "string" + }, + "To": { + "type": "string", + "format": "date-time" + } + } + }, + "Token": { + "type": "object", + "properties": { + "AccessToken": { + "type": "string" + }, + "Error": { + "type": "string" + }, + "ExpiresIn": { + "type": "integer", + "format": "int64" + }, + "IdentityToken": { + "type": "string" + }, + "RefreshToken": { + "type": "string" + }, + "TokenType": { + "type": "string" + } + } + }, + "User": { + "type": "object", + "properties": { + "Email": { + "type": "string" + }, + "EmailConfirmed": { + "type": "boolean" + }, + "FirstName": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "LockoutEnabled": { + "type": "boolean" + }, + "LockoutEnd": { + "type": "string", + "format": "date-time" + }, + "PhoneNumber": { + "type": "string" + }, + "PhoneNumberConfirmed": { + "type": "boolean" + }, + "TenantAdmin": { + "type": "boolean" + }, + "TwoFactorEnabled": { + "type": "boolean" + }, + "UserName": { + "type": "string" + } + } + }, + "UserChangePassword": { + "type": "object", + "properties": { + "NewPassword": { + "type": "string" + }, + "OldPassword": { + "type": "string" + }, + "UserId": { + "type": "string" + } + } + }, + "UserProfile": { + "type": "object", + "properties": { + "Email": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "Id": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "UserName": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "Bearer": { + "description": "Please insert \"Bearer {access token}\" below.", + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "security": [ + { + "Bearer": [] + } + ] } \ No newline at end of file diff --git a/tools.go b/tools.go index 60622ac..23b0bd3 100644 --- a/tools.go +++ b/tools.go @@ -12,4 +12,5 @@ import ( // If you want to use tools, please run the following command: // go generate ./tools.go // +//go:generate go run internal/cmd/convert-swagger/main.go //go:generate go build -v -o=./bin/addlicense github.com/google/addlicense