From 0a2113a39cda75e91825159c658b1ae1fd6a3814 Mon Sep 17 00:00:00 2001 From: polyaxon-ci Date: Fri, 28 Jan 2022 10:36:57 +0100 Subject: [PATCH] Add suggestions and history sdks --- .../get_organization_run_parameters.go | 185 ++++++++++ .../get_organization_run_responses.go | 237 +++++++++++++ .../organizations_v1_client.go | 42 +++ .../users_v1/get_history_parameters.go | 316 +++++++++++++++++ .../users_v1/get_history_responses.go | 237 +++++++++++++ .../users_v1/get_suggestions_parameters.go | 316 +++++++++++++++++ .../users_v1/get_suggestions_responses.go | 235 +++++++++++++ .../users_v1/users_v1_client.go | 84 +++++ java/http_client/v1/README.md | 3 + java/http_client/v1/api/openapi.yaml | 183 ++++++++++ .../http_client/v1/docs/OrganizationsV1Api.md | 74 ++++ java/http_client/v1/docs/UsersV1Api.md | 160 +++++++++ .../client/api/OrganizationsV1Api.java | 139 ++++++++ .../openapitools/client/api/UsersV1Api.java | 317 +++++++++++++++++ .../client/api/OrganizationsV1ApiTest.java | 17 + .../client/api/UsersV1ApiTest.java | 39 +++ js/http_client/v1/README.md | 3 + js/http_client/v1/docs/OrganizationsV1Api.md | 52 +++ js/http_client/v1/docs/UsersV1Api.md | 120 +++++++ .../v1/src/api/OrganizationsV1Api.js | 49 +++ js/http_client/v1/src/api/UsersV1Api.js | 97 ++++++ .../v1/test/api/OrganizationsV1Api.spec.js | 10 + js/http_client/v1/test/api/UsersV1Api.spec.js | 20 ++ protos/v1/polyaxon_sdk.proto | 21 ++ python/http_client/v1/README.md | 3 + .../http_client/v1/docs/OrganizationsV1Api.md | 78 +++++ python/http_client/v1/docs/UsersV1Api.md | 168 +++++++++ .../polyaxon_sdk/api/organizations_v1_api.py | 147 ++++++++ .../v1/polyaxon_sdk/api/users_v1_api.py | 320 ++++++++++++++++++ swagger/v1/polyaxon_sdk.swagger.json | 199 +++++++++++ .../v1/src/apis/OrganizationsV1Api.ts | 46 +++ ts/http_client/v1/src/apis/UsersV1Api.ts | 119 +++++++ 32 files changed, 4036 insertions(+) create mode 100644 go/http_client/v1/service_client/organizations_v1/get_organization_run_parameters.go create mode 100644 go/http_client/v1/service_client/organizations_v1/get_organization_run_responses.go create mode 100644 go/http_client/v1/service_client/users_v1/get_history_parameters.go create mode 100644 go/http_client/v1/service_client/users_v1/get_history_responses.go create mode 100644 go/http_client/v1/service_client/users_v1/get_suggestions_parameters.go create mode 100644 go/http_client/v1/service_client/users_v1/get_suggestions_responses.go diff --git a/go/http_client/v1/service_client/organizations_v1/get_organization_run_parameters.go b/go/http_client/v1/service_client/organizations_v1/get_organization_run_parameters.go new file mode 100644 index 0000000000..af646d884e --- /dev/null +++ b/go/http_client/v1/service_client/organizations_v1/get_organization_run_parameters.go @@ -0,0 +1,185 @@ +// Copyright 2018-2021 Polyaxon, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package organizations_v1 + +// 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" +) + +// NewGetOrganizationRunParams creates a new GetOrganizationRunParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetOrganizationRunParams() *GetOrganizationRunParams { + return &GetOrganizationRunParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOrganizationRunParamsWithTimeout creates a new GetOrganizationRunParams object +// with the ability to set a timeout on a request. +func NewGetOrganizationRunParamsWithTimeout(timeout time.Duration) *GetOrganizationRunParams { + return &GetOrganizationRunParams{ + timeout: timeout, + } +} + +// NewGetOrganizationRunParamsWithContext creates a new GetOrganizationRunParams object +// with the ability to set a context for a request. +func NewGetOrganizationRunParamsWithContext(ctx context.Context) *GetOrganizationRunParams { + return &GetOrganizationRunParams{ + Context: ctx, + } +} + +// NewGetOrganizationRunParamsWithHTTPClient creates a new GetOrganizationRunParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOrganizationRunParamsWithHTTPClient(client *http.Client) *GetOrganizationRunParams { + return &GetOrganizationRunParams{ + HTTPClient: client, + } +} + +/* GetOrganizationRunParams contains all the parameters to send to the API endpoint + for the get organization run operation. + + Typically these are written to a http.Request. +*/ +type GetOrganizationRunParams struct { + + /* Owner. + + Owner of the namespace + */ + Owner string + + /* UUID. + + Uuid identifier of the entity + */ + UUID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get organization run params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOrganizationRunParams) WithDefaults() *GetOrganizationRunParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get organization run params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOrganizationRunParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get organization run params +func (o *GetOrganizationRunParams) WithTimeout(timeout time.Duration) *GetOrganizationRunParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get organization run params +func (o *GetOrganizationRunParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get organization run params +func (o *GetOrganizationRunParams) WithContext(ctx context.Context) *GetOrganizationRunParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get organization run params +func (o *GetOrganizationRunParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get organization run params +func (o *GetOrganizationRunParams) WithHTTPClient(client *http.Client) *GetOrganizationRunParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get organization run params +func (o *GetOrganizationRunParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOwner adds the owner to the get organization run params +func (o *GetOrganizationRunParams) WithOwner(owner string) *GetOrganizationRunParams { + o.SetOwner(owner) + return o +} + +// SetOwner adds the owner to the get organization run params +func (o *GetOrganizationRunParams) SetOwner(owner string) { + o.Owner = owner +} + +// WithUUID adds the uuid to the get organization run params +func (o *GetOrganizationRunParams) WithUUID(uuid string) *GetOrganizationRunParams { + o.SetUUID(uuid) + return o +} + +// SetUUID adds the uuid to the get organization run params +func (o *GetOrganizationRunParams) SetUUID(uuid string) { + o.UUID = uuid +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOrganizationRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param owner + if err := r.SetPathParam("owner", o.Owner); err != nil { + return err + } + + // path param uuid + if err := r.SetPathParam("uuid", o.UUID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/http_client/v1/service_client/organizations_v1/get_organization_run_responses.go b/go/http_client/v1/service_client/organizations_v1/get_organization_run_responses.go new file mode 100644 index 0000000000..f5d8e4894f --- /dev/null +++ b/go/http_client/v1/service_client/organizations_v1/get_organization_run_responses.go @@ -0,0 +1,237 @@ +// Copyright 2018-2021 Polyaxon, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package organizations_v1 + +// 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/polyaxon/sdks/go/http_client/v1/service_model" +) + +// GetOrganizationRunReader is a Reader for the GetOrganizationRun structure. +type GetOrganizationRunReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrganizationRunReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOrganizationRunOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewGetOrganizationRunNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGetOrganizationRunForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetOrganizationRunNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewGetOrganizationRunDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetOrganizationRunOK creates a GetOrganizationRunOK with default headers values +func NewGetOrganizationRunOK() *GetOrganizationRunOK { + return &GetOrganizationRunOK{} +} + +/* GetOrganizationRunOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetOrganizationRunOK struct { + Payload *service_model.V1Run +} + +func (o *GetOrganizationRunOK) Error() string { + return fmt.Sprintf("[GET /api/v1/orgs/{owner}/runs/{uuid}][%d] getOrganizationRunOK %+v", 200, o.Payload) +} +func (o *GetOrganizationRunOK) GetPayload() *service_model.V1Run { + return o.Payload +} + +func (o *GetOrganizationRunOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(service_model.V1Run) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganizationRunNoContent creates a GetOrganizationRunNoContent with default headers values +func NewGetOrganizationRunNoContent() *GetOrganizationRunNoContent { + return &GetOrganizationRunNoContent{} +} + +/* GetOrganizationRunNoContent describes a response with status code 204, with default header values. + +No content. +*/ +type GetOrganizationRunNoContent struct { + Payload interface{} +} + +func (o *GetOrganizationRunNoContent) Error() string { + return fmt.Sprintf("[GET /api/v1/orgs/{owner}/runs/{uuid}][%d] getOrganizationRunNoContent %+v", 204, o.Payload) +} +func (o *GetOrganizationRunNoContent) GetPayload() interface{} { + return o.Payload +} + +func (o *GetOrganizationRunNoContent) 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 +} + +// NewGetOrganizationRunForbidden creates a GetOrganizationRunForbidden with default headers values +func NewGetOrganizationRunForbidden() *GetOrganizationRunForbidden { + return &GetOrganizationRunForbidden{} +} + +/* GetOrganizationRunForbidden describes a response with status code 403, with default header values. + +You don't have permission to access the resource. +*/ +type GetOrganizationRunForbidden struct { + Payload interface{} +} + +func (o *GetOrganizationRunForbidden) Error() string { + return fmt.Sprintf("[GET /api/v1/orgs/{owner}/runs/{uuid}][%d] getOrganizationRunForbidden %+v", 403, o.Payload) +} +func (o *GetOrganizationRunForbidden) GetPayload() interface{} { + return o.Payload +} + +func (o *GetOrganizationRunForbidden) 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 +} + +// NewGetOrganizationRunNotFound creates a GetOrganizationRunNotFound with default headers values +func NewGetOrganizationRunNotFound() *GetOrganizationRunNotFound { + return &GetOrganizationRunNotFound{} +} + +/* GetOrganizationRunNotFound describes a response with status code 404, with default header values. + +Resource does not exist. +*/ +type GetOrganizationRunNotFound struct { + Payload interface{} +} + +func (o *GetOrganizationRunNotFound) Error() string { + return fmt.Sprintf("[GET /api/v1/orgs/{owner}/runs/{uuid}][%d] getOrganizationRunNotFound %+v", 404, o.Payload) +} +func (o *GetOrganizationRunNotFound) GetPayload() interface{} { + return o.Payload +} + +func (o *GetOrganizationRunNotFound) 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 +} + +// NewGetOrganizationRunDefault creates a GetOrganizationRunDefault with default headers values +func NewGetOrganizationRunDefault(code int) *GetOrganizationRunDefault { + return &GetOrganizationRunDefault{ + _statusCode: code, + } +} + +/* GetOrganizationRunDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetOrganizationRunDefault struct { + _statusCode int + + Payload *service_model.RuntimeError +} + +// Code gets the status code for the get organization run default response +func (o *GetOrganizationRunDefault) Code() int { + return o._statusCode +} + +func (o *GetOrganizationRunDefault) Error() string { + return fmt.Sprintf("[GET /api/v1/orgs/{owner}/runs/{uuid}][%d] GetOrganizationRun default %+v", o._statusCode, o.Payload) +} +func (o *GetOrganizationRunDefault) GetPayload() *service_model.RuntimeError { + return o.Payload +} + +func (o *GetOrganizationRunDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(service_model.RuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/http_client/v1/service_client/organizations_v1/organizations_v1_client.go b/go/http_client/v1/service_client/organizations_v1/organizations_v1_client.go index 147da3185a..acef3dd6b8 100644 --- a/go/http_client/v1/service_client/organizations_v1/organizations_v1_client.go +++ b/go/http_client/v1/service_client/organizations_v1/organizations_v1_client.go @@ -68,6 +68,8 @@ type ClientService interface { GetOrganizationMember(params *GetOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrganizationMemberOK, *GetOrganizationMemberNoContent, error) + GetOrganizationRun(params *GetOrganizationRunParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrganizationRunOK, *GetOrganizationRunNoContent, error) + GetOrganizationRuns(params *GetOrganizationRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrganizationRunsOK, *GetOrganizationRunsNoContent, error) GetOrganizationSettings(params *GetOrganizationSettingsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrganizationSettingsOK, *GetOrganizationSettingsNoContent, error) @@ -635,6 +637,46 @@ func (a *Client) GetOrganizationMember(params *GetOrganizationMemberParams, auth return nil, nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + GetOrganizationRun gets a run in an organization +*/ +func (a *Client) GetOrganizationRun(params *GetOrganizationRunParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrganizationRunOK, *GetOrganizationRunNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOrganizationRunParams() + } + op := &runtime.ClientOperation{ + ID: "GetOrganizationRun", + Method: "GET", + PathPattern: "/api/v1/orgs/{owner}/runs/{uuid}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetOrganizationRunReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *GetOrganizationRunOK: + return value, nil, nil + case *GetOrganizationRunNoContent: + return nil, value, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetOrganizationRunDefault) + return nil, nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetOrganizationRuns gets all runs in an organization */ diff --git a/go/http_client/v1/service_client/users_v1/get_history_parameters.go b/go/http_client/v1/service_client/users_v1/get_history_parameters.go new file mode 100644 index 0000000000..211c695eac --- /dev/null +++ b/go/http_client/v1/service_client/users_v1/get_history_parameters.go @@ -0,0 +1,316 @@ +// Copyright 2018-2021 Polyaxon, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package users_v1 + +// 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" +) + +// NewGetHistoryParams creates a new GetHistoryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetHistoryParams() *GetHistoryParams { + return &GetHistoryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetHistoryParamsWithTimeout creates a new GetHistoryParams object +// with the ability to set a timeout on a request. +func NewGetHistoryParamsWithTimeout(timeout time.Duration) *GetHistoryParams { + return &GetHistoryParams{ + timeout: timeout, + } +} + +// NewGetHistoryParamsWithContext creates a new GetHistoryParams object +// with the ability to set a context for a request. +func NewGetHistoryParamsWithContext(ctx context.Context) *GetHistoryParams { + return &GetHistoryParams{ + Context: ctx, + } +} + +// NewGetHistoryParamsWithHTTPClient creates a new GetHistoryParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetHistoryParamsWithHTTPClient(client *http.Client) *GetHistoryParams { + return &GetHistoryParams{ + HTTPClient: client, + } +} + +/* GetHistoryParams contains all the parameters to send to the API endpoint + for the get history operation. + + Typically these are written to a http.Request. +*/ +type GetHistoryParams struct { + + /* Limit. + + Limit size. + + Format: int32 + */ + Limit *int32 + + /* NoPage. + + No pagination. + */ + NoPage *bool + + /* Offset. + + Pagination offset. + + Format: int32 + */ + Offset *int32 + + /* Query. + + Query filter the search. + */ + Query *string + + /* Sort. + + Sort to order the search. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get history params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHistoryParams) WithDefaults() *GetHistoryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get history params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHistoryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get history params +func (o *GetHistoryParams) WithTimeout(timeout time.Duration) *GetHistoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get history params +func (o *GetHistoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get history params +func (o *GetHistoryParams) WithContext(ctx context.Context) *GetHistoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get history params +func (o *GetHistoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get history params +func (o *GetHistoryParams) WithHTTPClient(client *http.Client) *GetHistoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get history params +func (o *GetHistoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get history params +func (o *GetHistoryParams) WithLimit(limit *int32) *GetHistoryParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get history params +func (o *GetHistoryParams) SetLimit(limit *int32) { + o.Limit = limit +} + +// WithNoPage adds the noPage to the get history params +func (o *GetHistoryParams) WithNoPage(noPage *bool) *GetHistoryParams { + o.SetNoPage(noPage) + return o +} + +// SetNoPage adds the noPage to the get history params +func (o *GetHistoryParams) SetNoPage(noPage *bool) { + o.NoPage = noPage +} + +// WithOffset adds the offset to the get history params +func (o *GetHistoryParams) WithOffset(offset *int32) *GetHistoryParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get history params +func (o *GetHistoryParams) SetOffset(offset *int32) { + o.Offset = offset +} + +// WithQuery adds the query to the get history params +func (o *GetHistoryParams) WithQuery(query *string) *GetHistoryParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the get history params +func (o *GetHistoryParams) SetQuery(query *string) { + o.Query = query +} + +// WithSort adds the sort to the get history params +func (o *GetHistoryParams) WithSort(sort *string) *GetHistoryParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the get history params +func (o *GetHistoryParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *GetHistoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int32 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt32(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.NoPage != nil { + + // query param no_page + var qrNoPage bool + + if o.NoPage != nil { + qrNoPage = *o.NoPage + } + qNoPage := swag.FormatBool(qrNoPage) + if qNoPage != "" { + + if err := r.SetQueryParam("no_page", qNoPage); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int32 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt32(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/http_client/v1/service_client/users_v1/get_history_responses.go b/go/http_client/v1/service_client/users_v1/get_history_responses.go new file mode 100644 index 0000000000..7bbe15935f --- /dev/null +++ b/go/http_client/v1/service_client/users_v1/get_history_responses.go @@ -0,0 +1,237 @@ +// Copyright 2018-2021 Polyaxon, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package users_v1 + +// 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/polyaxon/sdks/go/http_client/v1/service_model" +) + +// GetHistoryReader is a Reader for the GetHistory structure. +type GetHistoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetHistoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetHistoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewGetHistoryNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGetHistoryForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetHistoryNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewGetHistoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetHistoryOK creates a GetHistoryOK with default headers values +func NewGetHistoryOK() *GetHistoryOK { + return &GetHistoryOK{} +} + +/* GetHistoryOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetHistoryOK struct { + Payload *service_model.V1ListActivitiesResponse +} + +func (o *GetHistoryOK) Error() string { + return fmt.Sprintf("[GET /api/v1/users/history][%d] getHistoryOK %+v", 200, o.Payload) +} +func (o *GetHistoryOK) GetPayload() *service_model.V1ListActivitiesResponse { + return o.Payload +} + +func (o *GetHistoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(service_model.V1ListActivitiesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHistoryNoContent creates a GetHistoryNoContent with default headers values +func NewGetHistoryNoContent() *GetHistoryNoContent { + return &GetHistoryNoContent{} +} + +/* GetHistoryNoContent describes a response with status code 204, with default header values. + +No content. +*/ +type GetHistoryNoContent struct { + Payload interface{} +} + +func (o *GetHistoryNoContent) Error() string { + return fmt.Sprintf("[GET /api/v1/users/history][%d] getHistoryNoContent %+v", 204, o.Payload) +} +func (o *GetHistoryNoContent) GetPayload() interface{} { + return o.Payload +} + +func (o *GetHistoryNoContent) 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 +} + +// NewGetHistoryForbidden creates a GetHistoryForbidden with default headers values +func NewGetHistoryForbidden() *GetHistoryForbidden { + return &GetHistoryForbidden{} +} + +/* GetHistoryForbidden describes a response with status code 403, with default header values. + +You don't have permission to access the resource. +*/ +type GetHistoryForbidden struct { + Payload interface{} +} + +func (o *GetHistoryForbidden) Error() string { + return fmt.Sprintf("[GET /api/v1/users/history][%d] getHistoryForbidden %+v", 403, o.Payload) +} +func (o *GetHistoryForbidden) GetPayload() interface{} { + return o.Payload +} + +func (o *GetHistoryForbidden) 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 +} + +// NewGetHistoryNotFound creates a GetHistoryNotFound with default headers values +func NewGetHistoryNotFound() *GetHistoryNotFound { + return &GetHistoryNotFound{} +} + +/* GetHistoryNotFound describes a response with status code 404, with default header values. + +Resource does not exist. +*/ +type GetHistoryNotFound struct { + Payload interface{} +} + +func (o *GetHistoryNotFound) Error() string { + return fmt.Sprintf("[GET /api/v1/users/history][%d] getHistoryNotFound %+v", 404, o.Payload) +} +func (o *GetHistoryNotFound) GetPayload() interface{} { + return o.Payload +} + +func (o *GetHistoryNotFound) 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 +} + +// NewGetHistoryDefault creates a GetHistoryDefault with default headers values +func NewGetHistoryDefault(code int) *GetHistoryDefault { + return &GetHistoryDefault{ + _statusCode: code, + } +} + +/* GetHistoryDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetHistoryDefault struct { + _statusCode int + + Payload *service_model.RuntimeError +} + +// Code gets the status code for the get history default response +func (o *GetHistoryDefault) Code() int { + return o._statusCode +} + +func (o *GetHistoryDefault) Error() string { + return fmt.Sprintf("[GET /api/v1/users/history][%d] GetHistory default %+v", o._statusCode, o.Payload) +} +func (o *GetHistoryDefault) GetPayload() *service_model.RuntimeError { + return o.Payload +} + +func (o *GetHistoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(service_model.RuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/http_client/v1/service_client/users_v1/get_suggestions_parameters.go b/go/http_client/v1/service_client/users_v1/get_suggestions_parameters.go new file mode 100644 index 0000000000..0c725e2c20 --- /dev/null +++ b/go/http_client/v1/service_client/users_v1/get_suggestions_parameters.go @@ -0,0 +1,316 @@ +// Copyright 2018-2021 Polyaxon, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package users_v1 + +// 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" +) + +// NewGetSuggestionsParams creates a new GetSuggestionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSuggestionsParams() *GetSuggestionsParams { + return &GetSuggestionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSuggestionsParamsWithTimeout creates a new GetSuggestionsParams object +// with the ability to set a timeout on a request. +func NewGetSuggestionsParamsWithTimeout(timeout time.Duration) *GetSuggestionsParams { + return &GetSuggestionsParams{ + timeout: timeout, + } +} + +// NewGetSuggestionsParamsWithContext creates a new GetSuggestionsParams object +// with the ability to set a context for a request. +func NewGetSuggestionsParamsWithContext(ctx context.Context) *GetSuggestionsParams { + return &GetSuggestionsParams{ + Context: ctx, + } +} + +// NewGetSuggestionsParamsWithHTTPClient creates a new GetSuggestionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSuggestionsParamsWithHTTPClient(client *http.Client) *GetSuggestionsParams { + return &GetSuggestionsParams{ + HTTPClient: client, + } +} + +/* GetSuggestionsParams contains all the parameters to send to the API endpoint + for the get suggestions operation. + + Typically these are written to a http.Request. +*/ +type GetSuggestionsParams struct { + + /* Limit. + + Limit size. + + Format: int32 + */ + Limit *int32 + + /* NoPage. + + No pagination. + */ + NoPage *bool + + /* Offset. + + Pagination offset. + + Format: int32 + */ + Offset *int32 + + /* Query. + + Query filter the search. + */ + Query *string + + /* Sort. + + Sort to order the search. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get suggestions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSuggestionsParams) WithDefaults() *GetSuggestionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get suggestions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSuggestionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get suggestions params +func (o *GetSuggestionsParams) WithTimeout(timeout time.Duration) *GetSuggestionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get suggestions params +func (o *GetSuggestionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get suggestions params +func (o *GetSuggestionsParams) WithContext(ctx context.Context) *GetSuggestionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get suggestions params +func (o *GetSuggestionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get suggestions params +func (o *GetSuggestionsParams) WithHTTPClient(client *http.Client) *GetSuggestionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get suggestions params +func (o *GetSuggestionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get suggestions params +func (o *GetSuggestionsParams) WithLimit(limit *int32) *GetSuggestionsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get suggestions params +func (o *GetSuggestionsParams) SetLimit(limit *int32) { + o.Limit = limit +} + +// WithNoPage adds the noPage to the get suggestions params +func (o *GetSuggestionsParams) WithNoPage(noPage *bool) *GetSuggestionsParams { + o.SetNoPage(noPage) + return o +} + +// SetNoPage adds the noPage to the get suggestions params +func (o *GetSuggestionsParams) SetNoPage(noPage *bool) { + o.NoPage = noPage +} + +// WithOffset adds the offset to the get suggestions params +func (o *GetSuggestionsParams) WithOffset(offset *int32) *GetSuggestionsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get suggestions params +func (o *GetSuggestionsParams) SetOffset(offset *int32) { + o.Offset = offset +} + +// WithQuery adds the query to the get suggestions params +func (o *GetSuggestionsParams) WithQuery(query *string) *GetSuggestionsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the get suggestions params +func (o *GetSuggestionsParams) SetQuery(query *string) { + o.Query = query +} + +// WithSort adds the sort to the get suggestions params +func (o *GetSuggestionsParams) WithSort(sort *string) *GetSuggestionsParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the get suggestions params +func (o *GetSuggestionsParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSuggestionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int32 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt32(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.NoPage != nil { + + // query param no_page + var qrNoPage bool + + if o.NoPage != nil { + qrNoPage = *o.NoPage + } + qNoPage := swag.FormatBool(qrNoPage) + if qNoPage != "" { + + if err := r.SetQueryParam("no_page", qNoPage); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int32 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt32(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/go/http_client/v1/service_client/users_v1/get_suggestions_responses.go b/go/http_client/v1/service_client/users_v1/get_suggestions_responses.go new file mode 100644 index 0000000000..a39ba61a7a --- /dev/null +++ b/go/http_client/v1/service_client/users_v1/get_suggestions_responses.go @@ -0,0 +1,235 @@ +// Copyright 2018-2021 Polyaxon, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package users_v1 + +// 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/polyaxon/sdks/go/http_client/v1/service_model" +) + +// GetSuggestionsReader is a Reader for the GetSuggestions structure. +type GetSuggestionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSuggestionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSuggestionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewGetSuggestionsNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGetSuggestionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSuggestionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewGetSuggestionsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetSuggestionsOK creates a GetSuggestionsOK with default headers values +func NewGetSuggestionsOK() *GetSuggestionsOK { + return &GetSuggestionsOK{} +} + +/* GetSuggestionsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetSuggestionsOK struct { + Payload interface{} +} + +func (o *GetSuggestionsOK) Error() string { + return fmt.Sprintf("[GET /api/v1/users/suggestions][%d] getSuggestionsOK %+v", 200, o.Payload) +} +func (o *GetSuggestionsOK) GetPayload() interface{} { + return o.Payload +} + +func (o *GetSuggestionsOK) 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 +} + +// NewGetSuggestionsNoContent creates a GetSuggestionsNoContent with default headers values +func NewGetSuggestionsNoContent() *GetSuggestionsNoContent { + return &GetSuggestionsNoContent{} +} + +/* GetSuggestionsNoContent describes a response with status code 204, with default header values. + +No content. +*/ +type GetSuggestionsNoContent struct { + Payload interface{} +} + +func (o *GetSuggestionsNoContent) Error() string { + return fmt.Sprintf("[GET /api/v1/users/suggestions][%d] getSuggestionsNoContent %+v", 204, o.Payload) +} +func (o *GetSuggestionsNoContent) GetPayload() interface{} { + return o.Payload +} + +func (o *GetSuggestionsNoContent) 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 +} + +// NewGetSuggestionsForbidden creates a GetSuggestionsForbidden with default headers values +func NewGetSuggestionsForbidden() *GetSuggestionsForbidden { + return &GetSuggestionsForbidden{} +} + +/* GetSuggestionsForbidden describes a response with status code 403, with default header values. + +You don't have permission to access the resource. +*/ +type GetSuggestionsForbidden struct { + Payload interface{} +} + +func (o *GetSuggestionsForbidden) Error() string { + return fmt.Sprintf("[GET /api/v1/users/suggestions][%d] getSuggestionsForbidden %+v", 403, o.Payload) +} +func (o *GetSuggestionsForbidden) GetPayload() interface{} { + return o.Payload +} + +func (o *GetSuggestionsForbidden) 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 +} + +// NewGetSuggestionsNotFound creates a GetSuggestionsNotFound with default headers values +func NewGetSuggestionsNotFound() *GetSuggestionsNotFound { + return &GetSuggestionsNotFound{} +} + +/* GetSuggestionsNotFound describes a response with status code 404, with default header values. + +Resource does not exist. +*/ +type GetSuggestionsNotFound struct { + Payload interface{} +} + +func (o *GetSuggestionsNotFound) Error() string { + return fmt.Sprintf("[GET /api/v1/users/suggestions][%d] getSuggestionsNotFound %+v", 404, o.Payload) +} +func (o *GetSuggestionsNotFound) GetPayload() interface{} { + return o.Payload +} + +func (o *GetSuggestionsNotFound) 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 +} + +// NewGetSuggestionsDefault creates a GetSuggestionsDefault with default headers values +func NewGetSuggestionsDefault(code int) *GetSuggestionsDefault { + return &GetSuggestionsDefault{ + _statusCode: code, + } +} + +/* GetSuggestionsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetSuggestionsDefault struct { + _statusCode int + + Payload *service_model.RuntimeError +} + +// Code gets the status code for the get suggestions default response +func (o *GetSuggestionsDefault) Code() int { + return o._statusCode +} + +func (o *GetSuggestionsDefault) Error() string { + return fmt.Sprintf("[GET /api/v1/users/suggestions][%d] GetSuggestions default %+v", o._statusCode, o.Payload) +} +func (o *GetSuggestionsDefault) GetPayload() *service_model.RuntimeError { + return o.Payload +} + +func (o *GetSuggestionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(service_model.RuntimeError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/go/http_client/v1/service_client/users_v1/users_v1_client.go b/go/http_client/v1/service_client/users_v1/users_v1_client.go index cdf55e5680..7433e7050f 100644 --- a/go/http_client/v1/service_client/users_v1/users_v1_client.go +++ b/go/http_client/v1/service_client/users_v1/users_v1_client.go @@ -46,6 +46,10 @@ type ClientService interface { DeleteToken(params *DeleteTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTokenOK, *DeleteTokenNoContent, error) + GetHistory(params *GetHistoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetHistoryOK, *GetHistoryNoContent, error) + + GetSuggestions(params *GetSuggestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSuggestionsOK, *GetSuggestionsNoContent, error) + GetToken(params *GetTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTokenOK, *GetTokenNoContent, error) GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, *GetUserNoContent, error) @@ -143,6 +147,86 @@ func (a *Client) DeleteToken(params *DeleteTokenParams, authInfo runtime.ClientA return nil, nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + GetHistory users history +*/ +func (a *Client) GetHistory(params *GetHistoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetHistoryOK, *GetHistoryNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHistoryParams() + } + op := &runtime.ClientOperation{ + ID: "GetHistory", + Method: "GET", + PathPattern: "/api/v1/users/history", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetHistoryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *GetHistoryOK: + return value, nil, nil + case *GetHistoryNoContent: + return nil, value, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetHistoryDefault) + return nil, nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetSuggestions users suggestions +*/ +func (a *Client) GetSuggestions(params *GetSuggestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSuggestionsOK, *GetSuggestionsNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSuggestionsParams() + } + op := &runtime.ClientOperation{ + ID: "GetSuggestions", + Method: "GET", + PathPattern: "/api/v1/users/suggestions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSuggestionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *GetSuggestionsOK: + return value, nil, nil + case *GetSuggestionsNoContent: + return nil, value, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetSuggestionsDefault) + return nil, nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetToken gets token */ diff --git a/java/http_client/v1/README.md b/java/http_client/v1/README.md index 44bdee1760..436221d822 100644 --- a/java/http_client/v1/README.md +++ b/java/http_client/v1/README.md @@ -164,6 +164,7 @@ Class | Method | HTTP request | Description *OrganizationsV1Api* | [**getOrganizationActivities**](docs/OrganizationsV1Api.md#getOrganizationActivities) | **GET** /api/v1/orgs/{owner}/activities | Get organization activities *OrganizationsV1Api* | [**getOrganizationInvitation**](docs/OrganizationsV1Api.md#getOrganizationInvitation) | **GET** /api/v1/orgs/{owner}/invitations | Get organization invitation details *OrganizationsV1Api* | [**getOrganizationMember**](docs/OrganizationsV1Api.md#getOrganizationMember) | **GET** /api/v1/orgs/{owner}/members/{name} | Get organization member details +*OrganizationsV1Api* | [**getOrganizationRun**](docs/OrganizationsV1Api.md#getOrganizationRun) | **GET** /api/v1/orgs/{owner}/runs/{uuid} | Get a run in an organization *OrganizationsV1Api* | [**getOrganizationRuns**](docs/OrganizationsV1Api.md#getOrganizationRuns) | **GET** /api/v1/orgs/{owner}/runs | Get all runs in an organization *OrganizationsV1Api* | [**getOrganizationSettings**](docs/OrganizationsV1Api.md#getOrganizationSettings) | **GET** /api/v1/orgs/{owner}/settings | Get organization settings *OrganizationsV1Api* | [**getOrganizationStats**](docs/OrganizationsV1Api.md#getOrganizationStats) | **GET** /api/v1/orgs/{owner}/stats | Get organization stats @@ -354,6 +355,8 @@ Class | Method | HTTP request | Description *TeamsV1Api* | [**updateTeamMember**](docs/TeamsV1Api.md#updateTeamMember) | **PUT** /api/v1/orgs/{owner}/teams/{team}/members/{member.user} | Update team member *UsersV1Api* | [**createToken**](docs/UsersV1Api.md#createToken) | **POST** /api/v1/users/tokens | Create token *UsersV1Api* | [**deleteToken**](docs/UsersV1Api.md#deleteToken) | **DELETE** /api/v1/users/tokens/{uuid} | Delete token +*UsersV1Api* | [**getHistory**](docs/UsersV1Api.md#getHistory) | **GET** /api/v1/users/history | User History +*UsersV1Api* | [**getSuggestions**](docs/UsersV1Api.md#getSuggestions) | **GET** /api/v1/users/suggestions | User suggestions *UsersV1Api* | [**getToken**](docs/UsersV1Api.md#getToken) | **GET** /api/v1/users/tokens/{uuid} | Get token *UsersV1Api* | [**getUser**](docs/UsersV1Api.md#getUser) | **GET** /api/v1/users | Get current user *UsersV1Api* | [**listTokens**](docs/UsersV1Api.md#listTokens) | **GET** /api/v1/users/tokens | List tokens diff --git a/java/http_client/v1/api/openapi.yaml b/java/http_client/v1/api/openapi.yaml index d36ea31027..b863d91693 100644 --- a/java/http_client/v1/api/openapi.yaml +++ b/java/http_client/v1/api/openapi.yaml @@ -5340,6 +5340,57 @@ paths: x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /api/v1/orgs/{owner}/runs/{uuid}: + get: + operationId: GetOrganizationRun + parameters: + - description: Owner of the namespace + in: path + name: owner + required: true + schema: + type: string + - description: Uuid identifier of the entity + in: path + name: uuid + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1Run' + description: A successful response. + "204": + content: + application/json: + schema: + type: object + description: No content. + "403": + content: + application/json: + schema: + type: object + description: You don't have permission to access the resource. + "404": + content: + application/json: + schema: + type: object + description: Resource does not exist. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/runtimeError' + description: An unexpected error response. + summary: Get a run in an organization + tags: + - OrganizationsV1 + x-accepts: application/json /api/v1/orgs/{owner}/sa: get: operationId: ListServiceAccounts @@ -8340,6 +8391,138 @@ paths: x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /api/v1/users/history: + get: + operationId: GetHistory + parameters: + - description: Pagination offset. + in: query + name: offset + schema: + format: int32 + type: integer + - description: Limit size. + in: query + name: limit + schema: + format: int32 + type: integer + - description: Sort to order the search. + in: query + name: sort + schema: + type: string + - description: Query filter the search. + in: query + name: query + schema: + type: string + - description: No pagination. + in: query + name: no_page + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1ListActivitiesResponse' + description: A successful response. + "204": + content: + application/json: + schema: + type: object + description: No content. + "403": + content: + application/json: + schema: + type: object + description: You don't have permission to access the resource. + "404": + content: + application/json: + schema: + type: object + description: Resource does not exist. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/runtimeError' + description: An unexpected error response. + summary: User History + tags: + - UsersV1 + x-accepts: application/json + /api/v1/users/suggestions: + get: + operationId: GetSuggestions + parameters: + - description: Pagination offset. + in: query + name: offset + schema: + format: int32 + type: integer + - description: Limit size. + in: query + name: limit + schema: + format: int32 + type: integer + - description: Sort to order the search. + in: query + name: sort + schema: + type: string + - description: Query filter the search. + in: query + name: query + schema: + type: string + - description: No pagination. + in: query + name: no_page + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + type: object + description: A successful response. + "204": + content: + application/json: + schema: + type: object + description: No content. + "403": + content: + application/json: + schema: + type: object + description: You don't have permission to access the resource. + "404": + content: + application/json: + schema: + type: object + description: Resource does not exist. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/runtimeError' + description: An unexpected error response. + summary: User suggestions + tags: + - UsersV1 + x-accepts: application/json /api/v1/users/tokens: get: operationId: ListTokens diff --git a/java/http_client/v1/docs/OrganizationsV1Api.md b/java/http_client/v1/docs/OrganizationsV1Api.md index fb06aa39e3..b9a55e0c45 100644 --- a/java/http_client/v1/docs/OrganizationsV1Api.md +++ b/java/http_client/v1/docs/OrganizationsV1Api.md @@ -18,6 +18,7 @@ Method | HTTP request | Description [**getOrganizationActivities**](OrganizationsV1Api.md#getOrganizationActivities) | **GET** /api/v1/orgs/{owner}/activities | Get organization activities [**getOrganizationInvitation**](OrganizationsV1Api.md#getOrganizationInvitation) | **GET** /api/v1/orgs/{owner}/invitations | Get organization invitation details [**getOrganizationMember**](OrganizationsV1Api.md#getOrganizationMember) | **GET** /api/v1/orgs/{owner}/members/{name} | Get organization member details +[**getOrganizationRun**](OrganizationsV1Api.md#getOrganizationRun) | **GET** /api/v1/orgs/{owner}/runs/{uuid} | Get a run in an organization [**getOrganizationRuns**](OrganizationsV1Api.md#getOrganizationRuns) | **GET** /api/v1/orgs/{owner}/runs | Get all runs in an organization [**getOrganizationSettings**](OrganizationsV1Api.md#getOrganizationSettings) | **GET** /api/v1/orgs/{owner}/settings | Get organization settings [**getOrganizationStats**](OrganizationsV1Api.md#getOrganizationStats) | **GET** /api/v1/orgs/{owner}/stats | Get organization stats @@ -1020,6 +1021,79 @@ Name | Type | Description | Notes **404** | Resource does not exist. | - | **0** | An unexpected error response. | - | + +# **getOrganizationRun** +> V1Run getOrganizationRun(owner, uuid) + +Get a run in an organization + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.OrganizationsV1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKey + ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey"); + ApiKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKey.setApiKeyPrefix("Token"); + + OrganizationsV1Api apiInstance = new OrganizationsV1Api(defaultClient); + String owner = "owner_example"; // String | Owner of the namespace + String uuid = "uuid_example"; // String | Uuid identifier of the entity + try { + V1Run result = apiInstance.getOrganizationRun(owner, uuid); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationsV1Api#getOrganizationRun"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| Owner of the namespace | + **uuid** | **String**| Uuid identifier of the entity | + +### Return type + +[**V1Run**](V1Run.md) + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**204** | No content. | - | +**403** | You don't have permission to access the resource. | - | +**404** | Resource does not exist. | - | +**0** | An unexpected error response. | - | + # **getOrganizationRuns** > V1ListRunsResponse getOrganizationRuns(owner, offset, limit, sort, query, bookmarks, mode, noPage) diff --git a/java/http_client/v1/docs/UsersV1Api.md b/java/http_client/v1/docs/UsersV1Api.md index f932da684f..955556e3a9 100644 --- a/java/http_client/v1/docs/UsersV1Api.md +++ b/java/http_client/v1/docs/UsersV1Api.md @@ -7,6 +7,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**createToken**](UsersV1Api.md#createToken) | **POST** /api/v1/users/tokens | Create token [**deleteToken**](UsersV1Api.md#deleteToken) | **DELETE** /api/v1/users/tokens/{uuid} | Delete token +[**getHistory**](UsersV1Api.md#getHistory) | **GET** /api/v1/users/history | User History +[**getSuggestions**](UsersV1Api.md#getSuggestions) | **GET** /api/v1/users/suggestions | User suggestions [**getToken**](UsersV1Api.md#getToken) | **GET** /api/v1/users/tokens/{uuid} | Get token [**getUser**](UsersV1Api.md#getUser) | **GET** /api/v1/users | Get current user [**listTokens**](UsersV1Api.md#listTokens) | **GET** /api/v1/users/tokens | List tokens @@ -157,6 +159,164 @@ null (empty response body) **404** | Resource does not exist. | - | **0** | An unexpected error response. | - | + +# **getHistory** +> V1ListActivitiesResponse getHistory(offset, limit, sort, query, noPage) + +User History + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UsersV1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKey + ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey"); + ApiKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKey.setApiKeyPrefix("Token"); + + UsersV1Api apiInstance = new UsersV1Api(defaultClient); + Integer offset = 56; // Integer | Pagination offset. + Integer limit = 56; // Integer | Limit size. + String sort = "sort_example"; // String | Sort to order the search. + String query = "query_example"; // String | Query filter the search. + Boolean noPage = true; // Boolean | No pagination. + try { + V1ListActivitiesResponse result = apiInstance.getHistory(offset, limit, sort, query, noPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersV1Api#getHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **Integer**| Pagination offset. | [optional] + **limit** | **Integer**| Limit size. | [optional] + **sort** | **String**| Sort to order the search. | [optional] + **query** | **String**| Query filter the search. | [optional] + **noPage** | **Boolean**| No pagination. | [optional] + +### Return type + +[**V1ListActivitiesResponse**](V1ListActivitiesResponse.md) + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**204** | No content. | - | +**403** | You don't have permission to access the resource. | - | +**404** | Resource does not exist. | - | +**0** | An unexpected error response. | - | + + +# **getSuggestions** +> Object getSuggestions(offset, limit, sort, query, noPage) + +User suggestions + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UsersV1Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKey + ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey"); + ApiKey.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKey.setApiKeyPrefix("Token"); + + UsersV1Api apiInstance = new UsersV1Api(defaultClient); + Integer offset = 56; // Integer | Pagination offset. + Integer limit = 56; // Integer | Limit size. + String sort = "sort_example"; // String | Sort to order the search. + String query = "query_example"; // String | Query filter the search. + Boolean noPage = true; // Boolean | No pagination. + try { + Object result = apiInstance.getSuggestions(offset, limit, sort, query, noPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersV1Api#getSuggestions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **Integer**| Pagination offset. | [optional] + **limit** | **Integer**| Limit size. | [optional] + **sort** | **String**| Sort to order the search. | [optional] + **query** | **String**| Query filter the search. | [optional] + **noPage** | **Boolean**| No pagination. | [optional] + +### Return type + +**Object** + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**204** | No content. | - | +**403** | You don't have permission to access the resource. | - | +**404** | Resource does not exist. | - | +**0** | An unexpected error response. | - | + # **getToken** > V1Token getToken(uuid) diff --git a/java/http_client/v1/src/main/java/org/openapitools/client/api/OrganizationsV1Api.java b/java/http_client/v1/src/main/java/org/openapitools/client/api/OrganizationsV1Api.java index 8016e9246e..4ba1134e88 100644 --- a/java/http_client/v1/src/main/java/org/openapitools/client/api/OrganizationsV1Api.java +++ b/java/http_client/v1/src/main/java/org/openapitools/client/api/OrganizationsV1Api.java @@ -51,6 +51,7 @@ import org.openapitools.client.model.V1ListRunsResponse; import org.openapitools.client.model.V1Organization; import org.openapitools.client.model.V1OrganizationMember; +import org.openapitools.client.model.V1Run; import org.openapitools.client.model.V1Uuids; import java.lang.reflect.Type; @@ -1970,6 +1971,144 @@ public okhttp3.Call getOrganizationMemberAsync(String owner, String name, final localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getOrganizationRun + * @param owner Owner of the namespace (required) + * @param uuid Uuid identifier of the entity (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public okhttp3.Call getOrganizationRunCall(String owner, String uuid, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/orgs/{owner}/runs/{uuid}" + .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "ApiKey" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationRunValidateBeforeCall(String owner, String uuid, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'owner' is set + if (owner == null) { + throw new ApiException("Missing the required parameter 'owner' when calling getOrganizationRun(Async)"); + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException("Missing the required parameter 'uuid' when calling getOrganizationRun(Async)"); + } + + + okhttp3.Call localVarCall = getOrganizationRunCall(owner, uuid, _callback); + return localVarCall; + + } + + /** + * Get a run in an organization + * + * @param owner Owner of the namespace (required) + * @param uuid Uuid identifier of the entity (required) + * @return V1Run + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public V1Run getOrganizationRun(String owner, String uuid) throws ApiException { + ApiResponse localVarResp = getOrganizationRunWithHttpInfo(owner, uuid); + return localVarResp.getData(); + } + + /** + * Get a run in an organization + * + * @param owner Owner of the namespace (required) + * @param uuid Uuid identifier of the entity (required) + * @return ApiResponse<V1Run> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public ApiResponse getOrganizationRunWithHttpInfo(String owner, String uuid) throws ApiException { + okhttp3.Call localVarCall = getOrganizationRunValidateBeforeCall(owner, uuid, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a run in an organization (asynchronously) + * + * @param owner Owner of the namespace (required) + * @param uuid Uuid identifier of the entity (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public okhttp3.Call getOrganizationRunAsync(String owner, String uuid, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationRunValidateBeforeCall(owner, uuid, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getOrganizationRuns * @param owner Owner of the namespace (required) diff --git a/java/http_client/v1/src/main/java/org/openapitools/client/api/UsersV1Api.java b/java/http_client/v1/src/main/java/org/openapitools/client/api/UsersV1Api.java index 9a9b65f4c5..d1e8123477 100644 --- a/java/http_client/v1/src/main/java/org/openapitools/client/api/UsersV1Api.java +++ b/java/http_client/v1/src/main/java/org/openapitools/client/api/UsersV1Api.java @@ -42,6 +42,7 @@ import org.openapitools.client.model.RuntimeError; +import org.openapitools.client.model.V1ListActivitiesResponse; import org.openapitools.client.model.V1ListTokenResponse; import org.openapitools.client.model.V1Token; import org.openapitools.client.model.V1User; @@ -322,6 +323,322 @@ public okhttp3.Call deleteTokenAsync(String uuid, final ApiCallback _callb localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for getHistory + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public okhttp3.Call getHistoryCall(Integer offset, Integer limit, String sort, String query, Boolean noPage, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/users/history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (query != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query)); + } + + if (noPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("no_page", noPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "ApiKey" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHistoryValidateBeforeCall(Integer offset, Integer limit, String sort, String query, Boolean noPage, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getHistoryCall(offset, limit, sort, query, noPage, _callback); + return localVarCall; + + } + + /** + * User History + * + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @return V1ListActivitiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public V1ListActivitiesResponse getHistory(Integer offset, Integer limit, String sort, String query, Boolean noPage) throws ApiException { + ApiResponse localVarResp = getHistoryWithHttpInfo(offset, limit, sort, query, noPage); + return localVarResp.getData(); + } + + /** + * User History + * + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @return ApiResponse<V1ListActivitiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public ApiResponse getHistoryWithHttpInfo(Integer offset, Integer limit, String sort, String query, Boolean noPage) throws ApiException { + okhttp3.Call localVarCall = getHistoryValidateBeforeCall(offset, limit, sort, query, noPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * User History (asynchronously) + * + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public okhttp3.Call getHistoryAsync(Integer offset, Integer limit, String sort, String query, Boolean noPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHistoryValidateBeforeCall(offset, limit, sort, query, noPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSuggestions + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public okhttp3.Call getSuggestionsCall(Integer offset, Integer limit, String sort, String query, Boolean noPage, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/users/suggestions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (query != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query)); + } + + if (noPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("no_page", noPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "ApiKey" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSuggestionsValidateBeforeCall(Integer offset, Integer limit, String sort, String query, Boolean noPage, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getSuggestionsCall(offset, limit, sort, query, noPage, _callback); + return localVarCall; + + } + + /** + * User suggestions + * + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public Object getSuggestions(Integer offset, Integer limit, String sort, String query, Boolean noPage) throws ApiException { + ApiResponse localVarResp = getSuggestionsWithHttpInfo(offset, limit, sort, query, noPage); + return localVarResp.getData(); + } + + /** + * User suggestions + * + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public ApiResponse getSuggestionsWithHttpInfo(Integer offset, Integer limit, String sort, String query, Boolean noPage) throws ApiException { + okhttp3.Call localVarCall = getSuggestionsValidateBeforeCall(offset, limit, sort, query, noPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * User suggestions (asynchronously) + * + * @param offset Pagination offset. (optional) + * @param limit Limit size. (optional) + * @param sort Sort to order the search. (optional) + * @param query Query filter the search. (optional) + * @param noPage No pagination. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 A successful response. -
204 No content. -
403 You don't have permission to access the resource. -
404 Resource does not exist. -
0 An unexpected error response. -
+ */ + public okhttp3.Call getSuggestionsAsync(Integer offset, Integer limit, String sort, String query, Boolean noPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSuggestionsValidateBeforeCall(offset, limit, sort, query, noPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getToken * @param uuid UUid of the namespace (required) diff --git a/java/http_client/v1/src/test/java/org/openapitools/client/api/OrganizationsV1ApiTest.java b/java/http_client/v1/src/test/java/org/openapitools/client/api/OrganizationsV1ApiTest.java index d8bb068529..d013e5b778 100644 --- a/java/http_client/v1/src/test/java/org/openapitools/client/api/OrganizationsV1ApiTest.java +++ b/java/http_client/v1/src/test/java/org/openapitools/client/api/OrganizationsV1ApiTest.java @@ -38,6 +38,7 @@ import org.openapitools.client.model.V1ListRunsResponse; import org.openapitools.client.model.V1Organization; import org.openapitools.client.model.V1OrganizationMember; +import org.openapitools.client.model.V1Run; import org.openapitools.client.model.V1Uuids; import org.junit.Test; import org.junit.Ignore; @@ -282,6 +283,22 @@ public void getOrganizationMemberTest() throws ApiException { // TODO: test validations } + /** + * Get a run in an organization + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrganizationRunTest() throws ApiException { + String owner = null; + String uuid = null; + V1Run response = api.getOrganizationRun(owner, uuid); + // TODO: test validations + } + /** * Get all runs in an organization * diff --git a/java/http_client/v1/src/test/java/org/openapitools/client/api/UsersV1ApiTest.java b/java/http_client/v1/src/test/java/org/openapitools/client/api/UsersV1ApiTest.java index f2e45f2433..763dea520e 100644 --- a/java/http_client/v1/src/test/java/org/openapitools/client/api/UsersV1ApiTest.java +++ b/java/http_client/v1/src/test/java/org/openapitools/client/api/UsersV1ApiTest.java @@ -29,6 +29,7 @@ import org.openapitools.client.ApiException; import org.openapitools.client.model.RuntimeError; +import org.openapitools.client.model.V1ListActivitiesResponse; import org.openapitools.client.model.V1ListTokenResponse; import org.openapitools.client.model.V1Token; import org.openapitools.client.model.V1User; @@ -79,6 +80,44 @@ public void deleteTokenTest() throws ApiException { // TODO: test validations } + /** + * User History + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getHistoryTest() throws ApiException { + Integer offset = null; + Integer limit = null; + String sort = null; + String query = null; + Boolean noPage = null; + V1ListActivitiesResponse response = api.getHistory(offset, limit, sort, query, noPage); + // TODO: test validations + } + + /** + * User suggestions + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getSuggestionsTest() throws ApiException { + Integer offset = null; + Integer limit = null; + String sort = null; + String query = null; + Boolean noPage = null; + Object response = api.getSuggestions(offset, limit, sort, query, noPage); + // TODO: test validations + } + /** * Get token * diff --git a/js/http_client/v1/README.md b/js/http_client/v1/README.md index 98a11ccf1b..09a9b65b81 100644 --- a/js/http_client/v1/README.md +++ b/js/http_client/v1/README.md @@ -177,6 +177,7 @@ Class | Method | HTTP request | Description *PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationActivities**](docs/OrganizationsV1Api.md#getOrganizationActivities) | **GET** /api/v1/orgs/{owner}/activities | Get organization activities *PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationInvitation**](docs/OrganizationsV1Api.md#getOrganizationInvitation) | **GET** /api/v1/orgs/{owner}/invitations | Get organization invitation details *PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationMember**](docs/OrganizationsV1Api.md#getOrganizationMember) | **GET** /api/v1/orgs/{owner}/members/{name} | Get organization member details +*PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationRun**](docs/OrganizationsV1Api.md#getOrganizationRun) | **GET** /api/v1/orgs/{owner}/runs/{uuid} | Get a run in an organization *PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationRuns**](docs/OrganizationsV1Api.md#getOrganizationRuns) | **GET** /api/v1/orgs/{owner}/runs | Get all runs in an organization *PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationSettings**](docs/OrganizationsV1Api.md#getOrganizationSettings) | **GET** /api/v1/orgs/{owner}/settings | Get organization settings *PolyaxonSdk.OrganizationsV1Api* | [**getOrganizationStats**](docs/OrganizationsV1Api.md#getOrganizationStats) | **GET** /api/v1/orgs/{owner}/stats | Get organization stats @@ -367,6 +368,8 @@ Class | Method | HTTP request | Description *PolyaxonSdk.TeamsV1Api* | [**updateTeamMember**](docs/TeamsV1Api.md#updateTeamMember) | **PUT** /api/v1/orgs/{owner}/teams/{team}/members/{member.user} | Update team member *PolyaxonSdk.UsersV1Api* | [**createToken**](docs/UsersV1Api.md#createToken) | **POST** /api/v1/users/tokens | Create token *PolyaxonSdk.UsersV1Api* | [**deleteToken**](docs/UsersV1Api.md#deleteToken) | **DELETE** /api/v1/users/tokens/{uuid} | Delete token +*PolyaxonSdk.UsersV1Api* | [**getHistory**](docs/UsersV1Api.md#getHistory) | **GET** /api/v1/users/history | User History +*PolyaxonSdk.UsersV1Api* | [**getSuggestions**](docs/UsersV1Api.md#getSuggestions) | **GET** /api/v1/users/suggestions | User suggestions *PolyaxonSdk.UsersV1Api* | [**getToken**](docs/UsersV1Api.md#getToken) | **GET** /api/v1/users/tokens/{uuid} | Get token *PolyaxonSdk.UsersV1Api* | [**getUser**](docs/UsersV1Api.md#getUser) | **GET** /api/v1/users | Get current user *PolyaxonSdk.UsersV1Api* | [**listTokens**](docs/UsersV1Api.md#listTokens) | **GET** /api/v1/users/tokens | List tokens diff --git a/js/http_client/v1/docs/OrganizationsV1Api.md b/js/http_client/v1/docs/OrganizationsV1Api.md index df952bfe60..2a7c6acb79 100644 --- a/js/http_client/v1/docs/OrganizationsV1Api.md +++ b/js/http_client/v1/docs/OrganizationsV1Api.md @@ -19,6 +19,7 @@ Method | HTTP request | Description [**getOrganizationActivities**](OrganizationsV1Api.md#getOrganizationActivities) | **GET** /api/v1/orgs/{owner}/activities | Get organization activities [**getOrganizationInvitation**](OrganizationsV1Api.md#getOrganizationInvitation) | **GET** /api/v1/orgs/{owner}/invitations | Get organization invitation details [**getOrganizationMember**](OrganizationsV1Api.md#getOrganizationMember) | **GET** /api/v1/orgs/{owner}/members/{name} | Get organization member details +[**getOrganizationRun**](OrganizationsV1Api.md#getOrganizationRun) | **GET** /api/v1/orgs/{owner}/runs/{uuid} | Get a run in an organization [**getOrganizationRuns**](OrganizationsV1Api.md#getOrganizationRuns) | **GET** /api/v1/orgs/{owner}/runs | Get all runs in an organization [**getOrganizationSettings**](OrganizationsV1Api.md#getOrganizationSettings) | **GET** /api/v1/orgs/{owner}/settings | Get organization settings [**getOrganizationStats**](OrganizationsV1Api.md#getOrganizationStats) | **GET** /api/v1/orgs/{owner}/stats | Get organization stats @@ -755,6 +756,57 @@ Name | Type | Description | Notes - **Accept**: application/json +## getOrganizationRun + +> V1Run getOrganizationRun(owner, uuid) + +Get a run in an organization + +### Example + +```javascript +import PolyaxonSdk from 'polyaxon-sdk'; +let defaultClient = PolyaxonSdk.ApiClient.instance; +// Configure API key authorization: ApiKey +let ApiKey = defaultClient.authentications['ApiKey']; +ApiKey.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//ApiKey.apiKeyPrefix = 'Token'; + +let apiInstance = new PolyaxonSdk.OrganizationsV1Api(); +let owner = "owner_example"; // String | Owner of the namespace +let uuid = "uuid_example"; // String | Uuid identifier of the entity +apiInstance.getOrganizationRun(owner, uuid, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| Owner of the namespace | + **uuid** | **String**| Uuid identifier of the entity | + +### Return type + +[**V1Run**](V1Run.md) + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## getOrganizationRuns > V1ListRunsResponse getOrganizationRuns(owner, opts) diff --git a/js/http_client/v1/docs/UsersV1Api.md b/js/http_client/v1/docs/UsersV1Api.md index d26e6411bd..cb11a6472c 100644 --- a/js/http_client/v1/docs/UsersV1Api.md +++ b/js/http_client/v1/docs/UsersV1Api.md @@ -8,6 +8,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**createToken**](UsersV1Api.md#createToken) | **POST** /api/v1/users/tokens | Create token [**deleteToken**](UsersV1Api.md#deleteToken) | **DELETE** /api/v1/users/tokens/{uuid} | Delete token +[**getHistory**](UsersV1Api.md#getHistory) | **GET** /api/v1/users/history | User History +[**getSuggestions**](UsersV1Api.md#getSuggestions) | **GET** /api/v1/users/suggestions | User suggestions [**getToken**](UsersV1Api.md#getToken) | **GET** /api/v1/users/tokens/{uuid} | Get token [**getUser**](UsersV1Api.md#getUser) | **GET** /api/v1/users | Get current user [**listTokens**](UsersV1Api.md#listTokens) | **GET** /api/v1/users/tokens | List tokens @@ -116,6 +118,124 @@ null (empty response body) - **Accept**: application/json +## getHistory + +> V1ListActivitiesResponse getHistory(opts) + +User History + +### Example + +```javascript +import PolyaxonSdk from 'polyaxon-sdk'; +let defaultClient = PolyaxonSdk.ApiClient.instance; +// Configure API key authorization: ApiKey +let ApiKey = defaultClient.authentications['ApiKey']; +ApiKey.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//ApiKey.apiKeyPrefix = 'Token'; + +let apiInstance = new PolyaxonSdk.UsersV1Api(); +let opts = { + 'offset': 56, // Number | Pagination offset. + 'limit': 56, // Number | Limit size. + 'sort': "sort_example", // String | Sort to order the search. + 'query': "query_example", // String | Query filter the search. + 'no_page': true // Boolean | No pagination. +}; +apiInstance.getHistory(opts, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **Number**| Pagination offset. | [optional] + **limit** | **Number**| Limit size. | [optional] + **sort** | **String**| Sort to order the search. | [optional] + **query** | **String**| Query filter the search. | [optional] + **no_page** | **Boolean**| No pagination. | [optional] + +### Return type + +[**V1ListActivitiesResponse**](V1ListActivitiesResponse.md) + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getSuggestions + +> Object getSuggestions(opts) + +User suggestions + +### Example + +```javascript +import PolyaxonSdk from 'polyaxon-sdk'; +let defaultClient = PolyaxonSdk.ApiClient.instance; +// Configure API key authorization: ApiKey +let ApiKey = defaultClient.authentications['ApiKey']; +ApiKey.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//ApiKey.apiKeyPrefix = 'Token'; + +let apiInstance = new PolyaxonSdk.UsersV1Api(); +let opts = { + 'offset': 56, // Number | Pagination offset. + 'limit': 56, // Number | Limit size. + 'sort': "sort_example", // String | Sort to order the search. + 'query': "query_example", // String | Query filter the search. + 'no_page': true // Boolean | No pagination. +}; +apiInstance.getSuggestions(opts, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **Number**| Pagination offset. | [optional] + **limit** | **Number**| Limit size. | [optional] + **sort** | **String**| Sort to order the search. | [optional] + **query** | **String**| Query filter the search. | [optional] + **no_page** | **Boolean**| No pagination. | [optional] + +### Return type + +**Object** + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## getToken > V1Token getToken(uuid) diff --git a/js/http_client/v1/src/api/OrganizationsV1Api.js b/js/http_client/v1/src/api/OrganizationsV1Api.js index 18fa69ffef..643136d8a1 100644 --- a/js/http_client/v1/src/api/OrganizationsV1Api.js +++ b/js/http_client/v1/src/api/OrganizationsV1Api.js @@ -36,6 +36,7 @@ import V1ListOrganizationsResponse from '../model/V1ListOrganizationsResponse'; import V1ListRunsResponse from '../model/V1ListRunsResponse'; import V1Organization from '../model/V1Organization'; import V1OrganizationMember from '../model/V1OrganizationMember'; +import V1Run from '../model/V1Run'; import V1Uuids from '../model/V1Uuids'; /** @@ -693,6 +694,54 @@ export default class OrganizationsV1Api { ); } + /** + * Callback function to receive the result of the getOrganizationRun operation. + * @callback module:api/OrganizationsV1Api~getOrganizationRunCallback + * @param {String} error Error message, if any. + * @param {module:model/V1Run} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Get a run in an organization + * @param {String} owner Owner of the namespace + * @param {String} uuid Uuid identifier of the entity + * @param {module:api/OrganizationsV1Api~getOrganizationRunCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/V1Run} + */ + getOrganizationRun(owner, uuid, callback) { + let postBody = null; + // verify the required parameter 'owner' is set + if (owner === undefined || owner === null) { + throw new Error("Missing the required parameter 'owner' when calling getOrganizationRun"); + } + // verify the required parameter 'uuid' is set + if (uuid === undefined || uuid === null) { + throw new Error("Missing the required parameter 'uuid' when calling getOrganizationRun"); + } + + let pathParams = { + 'owner': owner, + 'uuid': uuid + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['ApiKey']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = V1Run; + return this.apiClient.callApi( + '/api/v1/orgs/{owner}/runs/{uuid}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + /** * Callback function to receive the result of the getOrganizationRuns operation. * @callback module:api/OrganizationsV1Api~getOrganizationRunsCallback diff --git a/js/http_client/v1/src/api/UsersV1Api.js b/js/http_client/v1/src/api/UsersV1Api.js index d5a5960929..f0923557f3 100644 --- a/js/http_client/v1/src/api/UsersV1Api.js +++ b/js/http_client/v1/src/api/UsersV1Api.js @@ -28,6 +28,7 @@ import ApiClient from "../ApiClient"; import RuntimeError from '../model/RuntimeError'; +import V1ListActivitiesResponse from '../model/V1ListActivitiesResponse'; import V1ListTokenResponse from '../model/V1ListTokenResponse'; import V1Token from '../model/V1Token'; import V1User from '../model/V1User'; @@ -134,6 +135,102 @@ export default class UsersV1Api { ); } + /** + * Callback function to receive the result of the getHistory operation. + * @callback module:api/UsersV1Api~getHistoryCallback + * @param {String} error Error message, if any. + * @param {module:model/V1ListActivitiesResponse} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * User History + * @param {Object} opts Optional parameters + * @param {Number} opts.offset Pagination offset. + * @param {Number} opts.limit Limit size. + * @param {String} opts.sort Sort to order the search. + * @param {String} opts.query Query filter the search. + * @param {Boolean} opts.no_page No pagination. + * @param {module:api/UsersV1Api~getHistoryCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/V1ListActivitiesResponse} + */ + getHistory(opts, callback) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + }; + let queryParams = { + 'offset': opts['offset'], + 'limit': opts['limit'], + 'sort': opts['sort'], + 'query': opts['query'], + 'no_page': opts['no_page'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['ApiKey']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = V1ListActivitiesResponse; + return this.apiClient.callApi( + '/api/v1/users/history', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the getSuggestions operation. + * @callback module:api/UsersV1Api~getSuggestionsCallback + * @param {String} error Error message, if any. + * @param {Object} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * User suggestions + * @param {Object} opts Optional parameters + * @param {Number} opts.offset Pagination offset. + * @param {Number} opts.limit Limit size. + * @param {String} opts.sort Sort to order the search. + * @param {String} opts.query Query filter the search. + * @param {Boolean} opts.no_page No pagination. + * @param {module:api/UsersV1Api~getSuggestionsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link Object} + */ + getSuggestions(opts, callback) { + opts = opts || {}; + let postBody = null; + + let pathParams = { + }; + let queryParams = { + 'offset': opts['offset'], + 'limit': opts['limit'], + 'sort': opts['sort'], + 'query': opts['query'], + 'no_page': opts['no_page'] + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['ApiKey']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = Object; + return this.apiClient.callApi( + '/api/v1/users/suggestions', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + /** * Callback function to receive the result of the getToken operation. * @callback module:api/UsersV1Api~getTokenCallback diff --git a/js/http_client/v1/test/api/OrganizationsV1Api.spec.js b/js/http_client/v1/test/api/OrganizationsV1Api.spec.js index 30c0859338..0b2d11710e 100644 --- a/js/http_client/v1/test/api/OrganizationsV1Api.spec.js +++ b/js/http_client/v1/test/api/OrganizationsV1Api.spec.js @@ -192,6 +192,16 @@ done(); }); }); + describe('getOrganizationRun', function() { + it('should call getOrganizationRun successfully', function(done) { + //uncomment below and update the code to test getOrganizationRun + //instance.getOrganizationRun(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); describe('getOrganizationRuns', function() { it('should call getOrganizationRuns successfully', function(done) { //uncomment below and update the code to test getOrganizationRuns diff --git a/js/http_client/v1/test/api/UsersV1Api.spec.js b/js/http_client/v1/test/api/UsersV1Api.spec.js index 37dc195a14..ea36fcd9d2 100644 --- a/js/http_client/v1/test/api/UsersV1Api.spec.js +++ b/js/http_client/v1/test/api/UsersV1Api.spec.js @@ -82,6 +82,26 @@ done(); }); }); + describe('getHistory', function() { + it('should call getHistory successfully', function(done) { + //uncomment below and update the code to test getHistory + //instance.getHistory(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getSuggestions', function() { + it('should call getSuggestions successfully', function(done) { + //uncomment below and update the code to test getSuggestions + //instance.getSuggestions(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); describe('getToken', function() { it('should call getToken successfully', function(done) { //uncomment below and update the code to test getToken diff --git a/protos/v1/polyaxon_sdk.proto b/protos/v1/polyaxon_sdk.proto index 1fd0d2f847..ac7b372227 100644 --- a/protos/v1/polyaxon_sdk.proto +++ b/protos/v1/polyaxon_sdk.proto @@ -1556,6 +1556,20 @@ service UsersV1 { delete: "/api/v1/users/tokens/{uuid}" }; } + + // User suggestions + rpc GetSuggestions(ResourceListRequest) returns (google.protobuf.Struct) { + option (google.api.http) = { + get: "/api/v1/users/suggestions" + }; + } + + // User History + rpc GetHistory(ResourceListRequest) returns (ListActivitiesResponse) { + option (google.api.http) = { + get: "/api/v1/users/history" + }; + } } // Service to get versions @@ -1650,6 +1664,13 @@ service OrganizationsV1 { }; } + // Get a run in an organization + rpc GetOrganizationRun(OwnerEntityResourceRequestByUid) returns (Run) { + option (google.api.http) = { + get: "/api/v1/orgs/{owner}/runs/{uuid}" + }; + } + // Delete cross-project runs selection rpc DeleteOrganizationRuns(OwnerResourceUuidsBodyRequest) returns (google.protobuf.Empty) { option (google.api.http) = { diff --git a/python/http_client/v1/README.md b/python/http_client/v1/README.md index 72d149c9c6..bb0cba43a9 100644 --- a/python/http_client/v1/README.md +++ b/python/http_client/v1/README.md @@ -142,6 +142,7 @@ Class | Method | HTTP request | Description *OrganizationsV1Api* | [**get_organization_activities**](docs/OrganizationsV1Api.md#get_organization_activities) | **GET** /api/v1/orgs/{owner}/activities | Get organization activities *OrganizationsV1Api* | [**get_organization_invitation**](docs/OrganizationsV1Api.md#get_organization_invitation) | **GET** /api/v1/orgs/{owner}/invitations | Get organization invitation details *OrganizationsV1Api* | [**get_organization_member**](docs/OrganizationsV1Api.md#get_organization_member) | **GET** /api/v1/orgs/{owner}/members/{name} | Get organization member details +*OrganizationsV1Api* | [**get_organization_run**](docs/OrganizationsV1Api.md#get_organization_run) | **GET** /api/v1/orgs/{owner}/runs/{uuid} | Get a run in an organization *OrganizationsV1Api* | [**get_organization_runs**](docs/OrganizationsV1Api.md#get_organization_runs) | **GET** /api/v1/orgs/{owner}/runs | Get all runs in an organization *OrganizationsV1Api* | [**get_organization_settings**](docs/OrganizationsV1Api.md#get_organization_settings) | **GET** /api/v1/orgs/{owner}/settings | Get organization settings *OrganizationsV1Api* | [**get_organization_stats**](docs/OrganizationsV1Api.md#get_organization_stats) | **GET** /api/v1/orgs/{owner}/stats | Get organization stats @@ -332,6 +333,8 @@ Class | Method | HTTP request | Description *TeamsV1Api* | [**update_team_member**](docs/TeamsV1Api.md#update_team_member) | **PUT** /api/v1/orgs/{owner}/teams/{team}/members/{member.user} | Update team member *UsersV1Api* | [**create_token**](docs/UsersV1Api.md#create_token) | **POST** /api/v1/users/tokens | Create token *UsersV1Api* | [**delete_token**](docs/UsersV1Api.md#delete_token) | **DELETE** /api/v1/users/tokens/{uuid} | Delete token +*UsersV1Api* | [**get_history**](docs/UsersV1Api.md#get_history) | **GET** /api/v1/users/history | User History +*UsersV1Api* | [**get_suggestions**](docs/UsersV1Api.md#get_suggestions) | **GET** /api/v1/users/suggestions | User suggestions *UsersV1Api* | [**get_token**](docs/UsersV1Api.md#get_token) | **GET** /api/v1/users/tokens/{uuid} | Get token *UsersV1Api* | [**get_user**](docs/UsersV1Api.md#get_user) | **GET** /api/v1/users | Get current user *UsersV1Api* | [**list_tokens**](docs/UsersV1Api.md#list_tokens) | **GET** /api/v1/users/tokens | List tokens diff --git a/python/http_client/v1/docs/OrganizationsV1Api.md b/python/http_client/v1/docs/OrganizationsV1Api.md index 103ef4a83b..18aa399f2d 100644 --- a/python/http_client/v1/docs/OrganizationsV1Api.md +++ b/python/http_client/v1/docs/OrganizationsV1Api.md @@ -18,6 +18,7 @@ Method | HTTP request | Description [**get_organization_activities**](OrganizationsV1Api.md#get_organization_activities) | **GET** /api/v1/orgs/{owner}/activities | Get organization activities [**get_organization_invitation**](OrganizationsV1Api.md#get_organization_invitation) | **GET** /api/v1/orgs/{owner}/invitations | Get organization invitation details [**get_organization_member**](OrganizationsV1Api.md#get_organization_member) | **GET** /api/v1/orgs/{owner}/members/{name} | Get organization member details +[**get_organization_run**](OrganizationsV1Api.md#get_organization_run) | **GET** /api/v1/orgs/{owner}/runs/{uuid} | Get a run in an organization [**get_organization_runs**](OrganizationsV1Api.md#get_organization_runs) | **GET** /api/v1/orgs/{owner}/runs | Get all runs in an organization [**get_organization_settings**](OrganizationsV1Api.md#get_organization_settings) | **GET** /api/v1/orgs/{owner}/settings | Get organization settings [**get_organization_stats**](OrganizationsV1Api.md#get_organization_stats) | **GET** /api/v1/orgs/{owner}/stats | Get organization stats @@ -1072,6 +1073,83 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_organization_run** +> V1Run get_organization_run(owner, uuid) + +Get a run in an organization + +### Example + +* Api Key Authentication (ApiKey): +```python +from __future__ import print_function +import time +import polyaxon_sdk +from polyaxon_sdk.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = polyaxon_sdk.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKey +configuration.api_key['ApiKey'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with polyaxon_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = polyaxon_sdk.OrganizationsV1Api(api_client) + owner = 'owner_example' # str | Owner of the namespace +uuid = 'uuid_example' # str | Uuid identifier of the entity + + try: + # Get a run in an organization + api_response = api_instance.get_organization_run(owner, uuid) + pprint(api_response) + except ApiException as e: + print("Exception when calling OrganizationsV1Api->get_organization_run: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| Owner of the namespace | + **uuid** | **str**| Uuid identifier of the entity | + +### Return type + +[**V1Run**](V1Run.md) + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**204** | No content. | - | +**403** | You don't have permission to access the resource. | - | +**404** | Resource does not exist. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_organization_runs** > V1ListRunsResponse get_organization_runs(owner, offset=offset, limit=limit, sort=sort, query=query, bookmarks=bookmarks, mode=mode, no_page=no_page) diff --git a/python/http_client/v1/docs/UsersV1Api.md b/python/http_client/v1/docs/UsersV1Api.md index 9700068fca..efa4868692 100644 --- a/python/http_client/v1/docs/UsersV1Api.md +++ b/python/http_client/v1/docs/UsersV1Api.md @@ -7,6 +7,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**create_token**](UsersV1Api.md#create_token) | **POST** /api/v1/users/tokens | Create token [**delete_token**](UsersV1Api.md#delete_token) | **DELETE** /api/v1/users/tokens/{uuid} | Delete token +[**get_history**](UsersV1Api.md#get_history) | **GET** /api/v1/users/history | User History +[**get_suggestions**](UsersV1Api.md#get_suggestions) | **GET** /api/v1/users/suggestions | User suggestions [**get_token**](UsersV1Api.md#get_token) | **GET** /api/v1/users/tokens/{uuid} | Get token [**get_user**](UsersV1Api.md#get_user) | **GET** /api/v1/users | Get current user [**list_tokens**](UsersV1Api.md#list_tokens) | **GET** /api/v1/users/tokens | List tokens @@ -165,6 +167,172 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_history** +> V1ListActivitiesResponse get_history(offset=offset, limit=limit, sort=sort, query=query, no_page=no_page) + +User History + +### Example + +* Api Key Authentication (ApiKey): +```python +from __future__ import print_function +import time +import polyaxon_sdk +from polyaxon_sdk.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = polyaxon_sdk.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKey +configuration.api_key['ApiKey'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with polyaxon_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = polyaxon_sdk.UsersV1Api(api_client) + offset = 56 # int | Pagination offset. (optional) +limit = 56 # int | Limit size. (optional) +sort = 'sort_example' # str | Sort to order the search. (optional) +query = 'query_example' # str | Query filter the search. (optional) +no_page = True # bool | No pagination. (optional) + + try: + # User History + api_response = api_instance.get_history(offset=offset, limit=limit, sort=sort, query=query, no_page=no_page) + pprint(api_response) + except ApiException as e: + print("Exception when calling UsersV1Api->get_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **int**| Pagination offset. | [optional] + **limit** | **int**| Limit size. | [optional] + **sort** | **str**| Sort to order the search. | [optional] + **query** | **str**| Query filter the search. | [optional] + **no_page** | **bool**| No pagination. | [optional] + +### Return type + +[**V1ListActivitiesResponse**](V1ListActivitiesResponse.md) + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**204** | No content. | - | +**403** | You don't have permission to access the resource. | - | +**404** | Resource does not exist. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_suggestions** +> object get_suggestions(offset=offset, limit=limit, sort=sort, query=query, no_page=no_page) + +User suggestions + +### Example + +* Api Key Authentication (ApiKey): +```python +from __future__ import print_function +import time +import polyaxon_sdk +from polyaxon_sdk.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = polyaxon_sdk.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKey +configuration.api_key['ApiKey'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with polyaxon_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = polyaxon_sdk.UsersV1Api(api_client) + offset = 56 # int | Pagination offset. (optional) +limit = 56 # int | Limit size. (optional) +sort = 'sort_example' # str | Sort to order the search. (optional) +query = 'query_example' # str | Query filter the search. (optional) +no_page = True # bool | No pagination. (optional) + + try: + # User suggestions + api_response = api_instance.get_suggestions(offset=offset, limit=limit, sort=sort, query=query, no_page=no_page) + pprint(api_response) + except ApiException as e: + print("Exception when calling UsersV1Api->get_suggestions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **int**| Pagination offset. | [optional] + **limit** | **int**| Limit size. | [optional] + **sort** | **str**| Sort to order the search. | [optional] + **query** | **str**| Query filter the search. | [optional] + **no_page** | **bool**| No pagination. | [optional] + +### Return type + +**object** + +### Authorization + +[ApiKey](../README.md#ApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**204** | No content. | - | +**403** | You don't have permission to access the resource. | - | +**404** | Resource does not exist. | - | +**0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_token** > V1Token get_token(uuid) diff --git a/python/http_client/v1/polyaxon_sdk/api/organizations_v1_api.py b/python/http_client/v1/polyaxon_sdk/api/organizations_v1_api.py index 56ada0c2b6..1441db148d 100644 --- a/python/http_client/v1/polyaxon_sdk/api/organizations_v1_api.py +++ b/python/http_client/v1/polyaxon_sdk/api/organizations_v1_api.py @@ -2055,6 +2055,153 @@ def get_organization_member_with_http_info(self, owner, name, **kwargs): # noqa collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) + def get_organization_run(self, owner, uuid, **kwargs): # noqa: E501 + """Get a run in an organization # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_organization_run(owner, uuid, async_req=True) + >>> result = thread.get() + + :param owner: Owner of the namespace (required) + :type owner: str + :param uuid: Uuid identifier of the entity (required) + :type uuid: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Run + """ + kwargs['_return_http_data_only'] = True + return self.get_organization_run_with_http_info(owner, uuid, **kwargs) # noqa: E501 + + def get_organization_run_with_http_info(self, owner, uuid, **kwargs): # noqa: E501 + """Get a run in an organization # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_organization_run_with_http_info(owner, uuid, async_req=True) + >>> result = thread.get() + + :param owner: Owner of the namespace (required) + :type owner: str + :param uuid: Uuid identifier of the entity (required) + :type uuid: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Run, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'owner', + 'uuid' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_organization_run" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in local_var_params or # noqa: E501 + local_var_params['owner'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `owner` when calling `get_organization_run`") # noqa: E501 + # verify the required parameter 'uuid' is set + if self.api_client.client_side_validation and ('uuid' not in local_var_params or # noqa: E501 + local_var_params['uuid'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `uuid` when calling `get_organization_run`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in local_var_params: + path_params['owner'] = local_var_params['owner'] # noqa: E501 + if 'uuid' in local_var_params: + path_params['uuid'] = local_var_params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['ApiKey'] # noqa: E501 + + response_types_map = { + 200: "V1Run", + 204: "object", + 403: "object", + 404: "object", + } + + return self.api_client.call_api( + '/api/v1/orgs/{owner}/runs/{uuid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + def get_organization_runs(self, owner, **kwargs): # noqa: E501 """Get all runs in an organization # noqa: E501 diff --git a/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py b/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py index 1a19c2b56a..7afa262eb1 100644 --- a/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py +++ b/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py @@ -324,6 +324,326 @@ def delete_token_with_http_info(self, uuid, **kwargs): # noqa: E501 collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) + def get_history(self, **kwargs): # noqa: E501 + """User History # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_history(async_req=True) + >>> result = thread.get() + + :param offset: Pagination offset. + :type offset: int + :param limit: Limit size. + :type limit: int + :param sort: Sort to order the search. + :type sort: str + :param query: Query filter the search. + :type query: str + :param no_page: No pagination. + :type no_page: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ListActivitiesResponse + """ + kwargs['_return_http_data_only'] = True + return self.get_history_with_http_info(**kwargs) # noqa: E501 + + def get_history_with_http_info(self, **kwargs): # noqa: E501 + """User History # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param offset: Pagination offset. + :type offset: int + :param limit: Limit size. + :type limit: int + :param sort: Sort to order the search. + :type sort: str + :param query: Query filter the search. + :type query: str + :param no_page: No pagination. + :type no_page: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ListActivitiesResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'offset', + 'limit', + 'sort', + 'query', + 'no_page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_history" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 + query_params.append(('sort', local_var_params['sort'])) # noqa: E501 + if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 + query_params.append(('query', local_var_params['query'])) # noqa: E501 + if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 + query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['ApiKey'] # noqa: E501 + + response_types_map = { + 200: "V1ListActivitiesResponse", + 204: "object", + 403: "object", + 404: "object", + } + + return self.api_client.call_api( + '/api/v1/users/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_suggestions(self, **kwargs): # noqa: E501 + """User suggestions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_suggestions(async_req=True) + >>> result = thread.get() + + :param offset: Pagination offset. + :type offset: int + :param limit: Limit size. + :type limit: int + :param sort: Sort to order the search. + :type sort: str + :param query: Query filter the search. + :type query: str + :param no_page: No pagination. + :type no_page: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_suggestions_with_http_info(**kwargs) # noqa: E501 + + def get_suggestions_with_http_info(self, **kwargs): # noqa: E501 + """User suggestions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_suggestions_with_http_info(async_req=True) + >>> result = thread.get() + + :param offset: Pagination offset. + :type offset: int + :param limit: Limit size. + :type limit: int + :param sort: Sort to order the search. + :type sort: str + :param query: Query filter the search. + :type query: str + :param no_page: No pagination. + :type no_page: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'offset', + 'limit', + 'sort', + 'query', + 'no_page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_suggestions" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 + query_params.append(('sort', local_var_params['sort'])) # noqa: E501 + if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 + query_params.append(('query', local_var_params['query'])) # noqa: E501 + if 'no_page' in local_var_params and local_var_params['no_page'] is not None: # noqa: E501 + query_params.append(('no_page', local_var_params['no_page'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['ApiKey'] # noqa: E501 + + response_types_map = { + 200: "object", + 204: "object", + 403: "object", + 404: "object", + } + + return self.api_client.call_api( + '/api/v1/users/suggestions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + def get_token(self, uuid, **kwargs): # noqa: E501 """Get token # noqa: E501 diff --git a/swagger/v1/polyaxon_sdk.swagger.json b/swagger/v1/polyaxon_sdk.swagger.json index 429a3b9359..4d34eddc7c 100644 --- a/swagger/v1/polyaxon_sdk.swagger.json +++ b/swagger/v1/polyaxon_sdk.swagger.json @@ -5589,6 +5589,57 @@ ] } }, + "/api/v1/orgs/{owner}/runs/{uuid}": { + "get": { + "summary": "Get a run in an organization", + "operationId": "GetOrganizationRun", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1Run" + } + }, + "204": { + "description": "No content.", + "schema": {} + }, + "403": { + "description": "You don't have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Resource does not exist.", + "schema": {} + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "owner", + "description": "Owner of the namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "uuid", + "description": "Uuid identifier of the entity", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "OrganizationsV1" + ] + } + }, "/api/v1/orgs/{owner}/sa": { "get": { "summary": "List service accounts", @@ -8737,6 +8788,154 @@ ] } }, + "/api/v1/users/history": { + "get": { + "summary": "User History", + "operationId": "GetHistory", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListActivitiesResponse" + } + }, + "204": { + "description": "No content.", + "schema": {} + }, + "403": { + "description": "You don't have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Resource does not exist.", + "schema": {} + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "offset", + "description": "Pagination offset.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "limit", + "description": "Limit size.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "sort", + "description": "Sort to order the search.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "query", + "description": "Query filter the search.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "no_page", + "description": "No pagination.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "UsersV1" + ] + } + }, + "/api/v1/users/suggestions": { + "get": { + "summary": "User suggestions", + "operationId": "GetSuggestions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "204": { + "description": "No content.", + "schema": {} + }, + "403": { + "description": "You don't have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Resource does not exist.", + "schema": {} + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/runtimeError" + } + } + }, + "parameters": [ + { + "name": "offset", + "description": "Pagination offset.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "limit", + "description": "Limit size.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "sort", + "description": "Sort to order the search.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "query", + "description": "Query filter the search.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "no_page", + "description": "No pagination.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "UsersV1" + ] + } + }, "/api/v1/users/tokens": { "get": { "summary": "List tokens", diff --git a/ts/http_client/v1/src/apis/OrganizationsV1Api.ts b/ts/http_client/v1/src/apis/OrganizationsV1Api.ts index f06a836c2b..bf00524641 100644 --- a/ts/http_client/v1/src/apis/OrganizationsV1Api.ts +++ b/ts/http_client/v1/src/apis/OrganizationsV1Api.ts @@ -56,6 +56,9 @@ import { V1OrganizationMember, V1OrganizationMemberFromJSON, V1OrganizationMemberToJSON, + V1Run, + V1RunFromJSON, + V1RunToJSON, V1Uuids, V1UuidsFromJSON, V1UuidsToJSON, @@ -144,6 +147,11 @@ export interface GetOrganizationMemberRequest { name: string; } +export interface GetOrganizationRunRequest { + owner: string; + uuid: string; +} + export interface GetOrganizationRunsRequest { owner: string; offset?: number; @@ -870,6 +878,44 @@ export class OrganizationsV1Api extends runtime.BaseAPI { return await response.value(); } + /** + * Get a run in an organization + */ + async getOrganizationRunRaw(requestParameters: GetOrganizationRunRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.owner === null || requestParameters.owner === undefined) { + throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getOrganizationRun.'); + } + + if (requestParameters.uuid === null || requestParameters.uuid === undefined) { + throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getOrganizationRun.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication + } + + const response = await this.request({ + path: `/api/v1/orgs/{owner}/runs/{uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue)); + } + + /** + * Get a run in an organization + */ + async getOrganizationRun(requestParameters: GetOrganizationRunRequest, initOverrides?: RequestInit): Promise { + const response = await this.getOrganizationRunRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Get all runs in an organization */ diff --git a/ts/http_client/v1/src/apis/UsersV1Api.ts b/ts/http_client/v1/src/apis/UsersV1Api.ts index 959029aeaf..e03125551e 100644 --- a/ts/http_client/v1/src/apis/UsersV1Api.ts +++ b/ts/http_client/v1/src/apis/UsersV1Api.ts @@ -32,6 +32,9 @@ import { RuntimeError, RuntimeErrorFromJSON, RuntimeErrorToJSON, + V1ListActivitiesResponse, + V1ListActivitiesResponseFromJSON, + V1ListActivitiesResponseToJSON, V1ListTokenResponse, V1ListTokenResponseFromJSON, V1ListTokenResponseToJSON, @@ -51,6 +54,22 @@ export interface DeleteTokenRequest { uuid: string; } +export interface GetHistoryRequest { + offset?: number; + limit?: number; + sort?: string; + query?: string; + noPage?: boolean; +} + +export interface GetSuggestionsRequest { + offset?: number; + limit?: number; + sort?: string; + query?: string; + noPage?: boolean; +} + export interface GetTokenRequest { uuid: string; } @@ -156,6 +175,106 @@ export class UsersV1Api extends runtime.BaseAPI { await this.deleteTokenRaw(requestParameters, initOverrides); } + /** + * User History + */ + async getHistoryRaw(requestParameters: GetHistoryRequest, initOverrides?: RequestInit): Promise> { + const queryParameters: any = {}; + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.sort !== undefined) { + queryParameters['sort'] = requestParameters.sort; + } + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.noPage !== undefined) { + queryParameters['no_page'] = requestParameters.noPage; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication + } + + const response = await this.request({ + path: `/api/v1/users/history`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => V1ListActivitiesResponseFromJSON(jsonValue)); + } + + /** + * User History + */ + async getHistory(requestParameters: GetHistoryRequest, initOverrides?: RequestInit): Promise { + const response = await this.getHistoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * User suggestions + */ + async getSuggestionsRaw(requestParameters: GetSuggestionsRequest, initOverrides?: RequestInit): Promise> { + const queryParameters: any = {}; + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.sort !== undefined) { + queryParameters['sort'] = requestParameters.sort; + } + + if (requestParameters.query !== undefined) { + queryParameters['query'] = requestParameters.query; + } + + if (requestParameters.noPage !== undefined) { + queryParameters['no_page'] = requestParameters.noPage; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication + } + + const response = await this.request({ + path: `/api/v1/users/suggestions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * User suggestions + */ + async getSuggestions(requestParameters: GetSuggestionsRequest, initOverrides?: RequestInit): Promise { + const response = await this.getSuggestionsRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Get token */