lib/api/research/research_client/topic/get_topics_observable_param...

168 lines
4.7 KiB
Go
Raw Permalink Normal View History

2022-09-07 00:16:25 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package topic
// 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"
)
// NewGetTopicsObservableParams creates a new GetTopicsObservableParams 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 NewGetTopicsObservableParams() *GetTopicsObservableParams {
return &GetTopicsObservableParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTopicsObservableParamsWithTimeout creates a new GetTopicsObservableParams object
// with the ability to set a timeout on a request.
func NewGetTopicsObservableParamsWithTimeout(timeout time.Duration) *GetTopicsObservableParams {
return &GetTopicsObservableParams{
timeout: timeout,
}
}
// NewGetTopicsObservableParamsWithContext creates a new GetTopicsObservableParams object
// with the ability to set a context for a request.
func NewGetTopicsObservableParamsWithContext(ctx context.Context) *GetTopicsObservableParams {
return &GetTopicsObservableParams{
Context: ctx,
}
}
// NewGetTopicsObservableParamsWithHTTPClient creates a new GetTopicsObservableParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTopicsObservableParamsWithHTTPClient(client *http.Client) *GetTopicsObservableParams {
return &GetTopicsObservableParams{
HTTPClient: client,
}
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableParams contains all the parameters to send to the API endpoint
2022-09-07 00:16:25 +00:00
2023-03-22 20:49:01 +00:00
for the get topics observable operation.
Typically these are written to a http.Request.
2022-09-07 00:16:25 +00:00
*/
type GetTopicsObservableParams struct {
/* TopicID.
2023-03-28 17:47:34 +00:00
Topic record ID
2022-09-07 00:16:25 +00:00
*/
TopicID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get topics observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTopicsObservableParams) WithDefaults() *GetTopicsObservableParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get topics observable params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTopicsObservableParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get topics observable params
func (o *GetTopicsObservableParams) WithTimeout(timeout time.Duration) *GetTopicsObservableParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get topics observable params
func (o *GetTopicsObservableParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get topics observable params
func (o *GetTopicsObservableParams) WithContext(ctx context.Context) *GetTopicsObservableParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get topics observable params
func (o *GetTopicsObservableParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get topics observable params
func (o *GetTopicsObservableParams) WithHTTPClient(client *http.Client) *GetTopicsObservableParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get topics observable params
func (o *GetTopicsObservableParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTopicID adds the topicID to the get topics observable params
func (o *GetTopicsObservableParams) WithTopicID(topicID *string) *GetTopicsObservableParams {
o.SetTopicID(topicID)
return o
}
// SetTopicID adds the topicId to the get topics observable params
func (o *GetTopicsObservableParams) SetTopicID(topicID *string) {
o.TopicID = topicID
}
// WriteToRequest writes these params to a swagger request
func (o *GetTopicsObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TopicID != nil {
// query param topicId
var qrTopicID string
if o.TopicID != nil {
qrTopicID = *o.TopicID
}
qTopicID := qrTopicID
if qTopicID != "" {
if err := r.SetQueryParam("topicId", qTopicID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}