gtslib/client/admin/admin_report_resolve_parameters.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

185 lines
5.5 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package admin
// 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"
)
// NewAdminReportResolveParams creates a new AdminReportResolveParams 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 NewAdminReportResolveParams() *AdminReportResolveParams {
return &AdminReportResolveParams{
timeout: cr.DefaultTimeout,
}
}
// NewAdminReportResolveParamsWithTimeout creates a new AdminReportResolveParams object
// with the ability to set a timeout on a request.
func NewAdminReportResolveParamsWithTimeout(timeout time.Duration) *AdminReportResolveParams {
return &AdminReportResolveParams{
timeout: timeout,
}
}
// NewAdminReportResolveParamsWithContext creates a new AdminReportResolveParams object
// with the ability to set a context for a request.
func NewAdminReportResolveParamsWithContext(ctx context.Context) *AdminReportResolveParams {
return &AdminReportResolveParams{
Context: ctx,
}
}
// NewAdminReportResolveParamsWithHTTPClient creates a new AdminReportResolveParams object
// with the ability to set a custom HTTPClient for a request.
func NewAdminReportResolveParamsWithHTTPClient(client *http.Client) *AdminReportResolveParams {
return &AdminReportResolveParams{
HTTPClient: client,
}
}
/*
AdminReportResolveParams contains all the parameters to send to the API endpoint
for the admin report resolve operation.
Typically these are written to a http.Request.
*/
type AdminReportResolveParams struct {
/* ActionTakenComment.
Optional admin comment on the action taken in response to this report. Useful for providing an explanation about what action was taken (if any) before the report was marked as resolved. This will be visible to the user that created the report!
Sample: The reported account was suspended.
*/
ActionTakenComment *string
/* ID.
The id of the report.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the admin report resolve params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AdminReportResolveParams) WithDefaults() *AdminReportResolveParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the admin report resolve params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AdminReportResolveParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the admin report resolve params
func (o *AdminReportResolveParams) WithTimeout(timeout time.Duration) *AdminReportResolveParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the admin report resolve params
func (o *AdminReportResolveParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the admin report resolve params
func (o *AdminReportResolveParams) WithContext(ctx context.Context) *AdminReportResolveParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the admin report resolve params
func (o *AdminReportResolveParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the admin report resolve params
func (o *AdminReportResolveParams) WithHTTPClient(client *http.Client) *AdminReportResolveParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the admin report resolve params
func (o *AdminReportResolveParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActionTakenComment adds the actionTakenComment to the admin report resolve params
func (o *AdminReportResolveParams) WithActionTakenComment(actionTakenComment *string) *AdminReportResolveParams {
o.SetActionTakenComment(actionTakenComment)
return o
}
// SetActionTakenComment adds the actionTakenComment to the admin report resolve params
func (o *AdminReportResolveParams) SetActionTakenComment(actionTakenComment *string) {
o.ActionTakenComment = actionTakenComment
}
// WithID adds the id to the admin report resolve params
func (o *AdminReportResolveParams) WithID(id string) *AdminReportResolveParams {
o.SetID(id)
return o
}
// SetID adds the id to the admin report resolve params
func (o *AdminReportResolveParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *AdminReportResolveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.ActionTakenComment != nil {
// form param action_taken_comment
var frActionTakenComment string
if o.ActionTakenComment != nil {
frActionTakenComment = *o.ActionTakenComment
}
fActionTakenComment := frActionTakenComment
if fActionTakenComment != "" {
if err := r.SetFormParam("action_taken_comment", fActionTakenComment); err != nil {
return err
}
}
}
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}