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 deleted file mode 100644 index 211c695eac..0000000000 --- a/go/http_client/v1/service_client/users_v1/get_history_parameters.go +++ /dev/null @@ -1,316 +0,0 @@ -// 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 deleted file mode 100644 index 7bbe15935f..0000000000 --- a/go/http_client/v1/service_client/users_v1/get_history_responses.go +++ /dev/null @@ -1,237 +0,0 @@ -// 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 deleted file mode 100644 index 0c725e2c20..0000000000 --- a/go/http_client/v1/service_client/users_v1/get_suggestions_parameters.go +++ /dev/null @@ -1,316 +0,0 @@ -// 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 deleted file mode 100644 index a39ba61a7a..0000000000 --- a/go/http_client/v1/service_client/users_v1/get_suggestions_responses.go +++ /dev/null @@ -1,235 +0,0 @@ -// 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 7433e7050f..cdf55e5680 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,10 +46,6 @@ 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) @@ -147,86 +143,6 @@ 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 436221d822..796f815c86 100644 --- a/java/http_client/v1/README.md +++ b/java/http_client/v1/README.md @@ -355,8 +355,6 @@ 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 b863d91693..7fc2465c0f 100644 --- a/java/http_client/v1/api/openapi.yaml +++ b/java/http_client/v1/api/openapi.yaml @@ -8391,138 +8391,6 @@ 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/UsersV1Api.md b/java/http_client/v1/docs/UsersV1Api.md index 955556e3a9..f932da684f 100644 --- a/java/http_client/v1/docs/UsersV1Api.md +++ b/java/http_client/v1/docs/UsersV1Api.md @@ -7,8 +7,6 @@ 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 @@ -159,164 +157,6 @@ 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/UsersV1Api.java b/java/http_client/v1/src/main/java/org/openapitools/client/api/UsersV1Api.java index d1e8123477..9a9b65f4c5 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,7 +42,6 @@ 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; @@ -323,322 +322,6 @@ 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/UsersV1ApiTest.java b/java/http_client/v1/src/test/java/org/openapitools/client/api/UsersV1ApiTest.java index 763dea520e..f2e45f2433 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,7 +29,6 @@ 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; @@ -80,44 +79,6 @@ 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 09a9b65b81..17fe9718f2 100644 --- a/js/http_client/v1/README.md +++ b/js/http_client/v1/README.md @@ -368,8 +368,6 @@ 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/UsersV1Api.md b/js/http_client/v1/docs/UsersV1Api.md index cb11a6472c..d26e6411bd 100644 --- a/js/http_client/v1/docs/UsersV1Api.md +++ b/js/http_client/v1/docs/UsersV1Api.md @@ -8,8 +8,6 @@ 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 @@ -118,124 +116,6 @@ 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/UsersV1Api.js b/js/http_client/v1/src/api/UsersV1Api.js index f0923557f3..d5a5960929 100644 --- a/js/http_client/v1/src/api/UsersV1Api.js +++ b/js/http_client/v1/src/api/UsersV1Api.js @@ -28,7 +28,6 @@ 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'; @@ -135,102 +134,6 @@ 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/UsersV1Api.spec.js b/js/http_client/v1/test/api/UsersV1Api.spec.js index ea36fcd9d2..37dc195a14 100644 --- a/js/http_client/v1/test/api/UsersV1Api.spec.js +++ b/js/http_client/v1/test/api/UsersV1Api.spec.js @@ -82,26 +82,6 @@ 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 ac7b372227..24cdcf2938 100644 --- a/protos/v1/polyaxon_sdk.proto +++ b/protos/v1/polyaxon_sdk.proto @@ -1556,20 +1556,6 @@ 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 diff --git a/python/http_client/v1/README.md b/python/http_client/v1/README.md index bb0cba43a9..e6c5781700 100644 --- a/python/http_client/v1/README.md +++ b/python/http_client/v1/README.md @@ -333,8 +333,6 @@ 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/UsersV1Api.md b/python/http_client/v1/docs/UsersV1Api.md index efa4868692..9700068fca 100644 --- a/python/http_client/v1/docs/UsersV1Api.md +++ b/python/http_client/v1/docs/UsersV1Api.md @@ -7,8 +7,6 @@ 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 @@ -167,172 +165,6 @@ 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/users_v1_api.py b/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py index 7afa262eb1..1a19c2b56a 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,326 +324,6 @@ 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 4d34eddc7c..eb6a7e9c71 100644 --- a/swagger/v1/polyaxon_sdk.swagger.json +++ b/swagger/v1/polyaxon_sdk.swagger.json @@ -8788,154 +8788,6 @@ ] } }, - "/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/UsersV1Api.ts b/ts/http_client/v1/src/apis/UsersV1Api.ts index e03125551e..959029aeaf 100644 --- a/ts/http_client/v1/src/apis/UsersV1Api.ts +++ b/ts/http_client/v1/src/apis/UsersV1Api.ts @@ -32,9 +32,6 @@ import { RuntimeError, RuntimeErrorFromJSON, RuntimeErrorToJSON, - V1ListActivitiesResponse, - V1ListActivitiesResponseFromJSON, - V1ListActivitiesResponseToJSON, V1ListTokenResponse, V1ListTokenResponseFromJSON, V1ListTokenResponseToJSON, @@ -54,22 +51,6 @@ 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; } @@ -175,106 +156,6 @@ 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 */