forgejo/modules/activitypub2/activitypub/activitypub_person_parameters.go
2024-02-10 15:09:16 +01:00

153 lines
4.3 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package activitypub
// 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"
)
// NewActivitypubPersonParams creates a new ActivitypubPersonParams 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 NewActivitypubPersonParams() *ActivitypubPersonParams {
return &ActivitypubPersonParams{
timeout: cr.DefaultTimeout,
}
}
// NewActivitypubPersonParamsWithTimeout creates a new ActivitypubPersonParams object
// with the ability to set a timeout on a request.
func NewActivitypubPersonParamsWithTimeout(timeout time.Duration) *ActivitypubPersonParams {
return &ActivitypubPersonParams{
timeout: timeout,
}
}
// NewActivitypubPersonParamsWithContext creates a new ActivitypubPersonParams object
// with the ability to set a context for a request.
func NewActivitypubPersonParamsWithContext(ctx context.Context) *ActivitypubPersonParams {
return &ActivitypubPersonParams{
Context: ctx,
}
}
// NewActivitypubPersonParamsWithHTTPClient creates a new ActivitypubPersonParams object
// with the ability to set a custom HTTPClient for a request.
func NewActivitypubPersonParamsWithHTTPClient(client *http.Client) *ActivitypubPersonParams {
return &ActivitypubPersonParams{
HTTPClient: client,
}
}
/*
ActivitypubPersonParams contains all the parameters to send to the API endpoint
for the activitypub person operation.
Typically these are written to a http.Request.
*/
type ActivitypubPersonParams struct {
/* UserID.
user ID of the user
*/
UserID int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the activitypub person params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ActivitypubPersonParams) WithDefaults() *ActivitypubPersonParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the activitypub person params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ActivitypubPersonParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the activitypub person params
func (o *ActivitypubPersonParams) WithTimeout(timeout time.Duration) *ActivitypubPersonParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the activitypub person params
func (o *ActivitypubPersonParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the activitypub person params
func (o *ActivitypubPersonParams) WithContext(ctx context.Context) *ActivitypubPersonParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the activitypub person params
func (o *ActivitypubPersonParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the activitypub person params
func (o *ActivitypubPersonParams) WithHTTPClient(client *http.Client) *ActivitypubPersonParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the activitypub person params
func (o *ActivitypubPersonParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithUserID adds the userID to the activitypub person params
func (o *ActivitypubPersonParams) WithUserID(userID int64) *ActivitypubPersonParams {
o.SetUserID(userID)
return o
}
// SetUserID adds the userId to the activitypub person params
func (o *ActivitypubPersonParams) SetUserID(userID int64) {
o.UserID = userID
}
// WriteToRequest writes these params to a swagger request
func (o *ActivitypubPersonParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param user-id
if err := r.SetPathParam("user-id", swag.FormatInt64(o.UserID)); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}