github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/projects/move_project_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package projects
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"context"
    10  	"net/http"
    11  	"time"
    12  
    13  	"github.com/go-openapi/errors"
    14  	"github.com/go-openapi/runtime"
    15  	cr "github.com/go-openapi/runtime/client"
    16  	"github.com/go-openapi/strfmt"
    17  )
    18  
    19  // NewMoveProjectParams creates a new MoveProjectParams object,
    20  // with the default timeout for this client.
    21  //
    22  // Default values are not hydrated, since defaults are normally applied by the API server side.
    23  //
    24  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    25  func NewMoveProjectParams() *MoveProjectParams {
    26  	return &MoveProjectParams{
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewMoveProjectParamsWithTimeout creates a new MoveProjectParams object
    32  // with the ability to set a timeout on a request.
    33  func NewMoveProjectParamsWithTimeout(timeout time.Duration) *MoveProjectParams {
    34  	return &MoveProjectParams{
    35  		timeout: timeout,
    36  	}
    37  }
    38  
    39  // NewMoveProjectParamsWithContext creates a new MoveProjectParams object
    40  // with the ability to set a context for a request.
    41  func NewMoveProjectParamsWithContext(ctx context.Context) *MoveProjectParams {
    42  	return &MoveProjectParams{
    43  		Context: ctx,
    44  	}
    45  }
    46  
    47  // NewMoveProjectParamsWithHTTPClient creates a new MoveProjectParams object
    48  // with the ability to set a custom HTTPClient for a request.
    49  func NewMoveProjectParamsWithHTTPClient(client *http.Client) *MoveProjectParams {
    50  	return &MoveProjectParams{
    51  		HTTPClient: client,
    52  	}
    53  }
    54  
    55  /* MoveProjectParams contains all the parameters to send to the API endpoint
    56     for the move project operation.
    57  
    58     Typically these are written to a http.Request.
    59  */
    60  type MoveProjectParams struct {
    61  
    62  	/* Destination.
    63  
    64  	   Information about where to move the project to.
    65  	*/
    66  	Destination MoveProjectBody
    67  
    68  	/* IdentifierType.
    69  
    70  	   what kind of thing the provided organizationIdentifier is
    71  
    72  	   Default: "URLname"
    73  	*/
    74  	IdentifierType *string
    75  
    76  	/* OrganizationIdentifier.
    77  
    78  	   identifier (URLname, by default) of the desired organization
    79  	*/
    80  	OrganizationIdentifier string
    81  
    82  	/* ProjectName.
    83  
    84  	   Name of origin project.
    85  	*/
    86  	ProjectName string
    87  
    88  	timeout    time.Duration
    89  	Context    context.Context
    90  	HTTPClient *http.Client
    91  }
    92  
    93  // WithDefaults hydrates default values in the move project params (not the query body).
    94  //
    95  // All values with no default are reset to their zero value.
    96  func (o *MoveProjectParams) WithDefaults() *MoveProjectParams {
    97  	o.SetDefaults()
    98  	return o
    99  }
   100  
   101  // SetDefaults hydrates default values in the move project params (not the query body).
   102  //
   103  // All values with no default are reset to their zero value.
   104  func (o *MoveProjectParams) SetDefaults() {
   105  	var (
   106  		identifierTypeDefault = string("URLname")
   107  	)
   108  
   109  	val := MoveProjectParams{
   110  		IdentifierType: &identifierTypeDefault,
   111  	}
   112  
   113  	val.timeout = o.timeout
   114  	val.Context = o.Context
   115  	val.HTTPClient = o.HTTPClient
   116  	*o = val
   117  }
   118  
   119  // WithTimeout adds the timeout to the move project params
   120  func (o *MoveProjectParams) WithTimeout(timeout time.Duration) *MoveProjectParams {
   121  	o.SetTimeout(timeout)
   122  	return o
   123  }
   124  
   125  // SetTimeout adds the timeout to the move project params
   126  func (o *MoveProjectParams) SetTimeout(timeout time.Duration) {
   127  	o.timeout = timeout
   128  }
   129  
   130  // WithContext adds the context to the move project params
   131  func (o *MoveProjectParams) WithContext(ctx context.Context) *MoveProjectParams {
   132  	o.SetContext(ctx)
   133  	return o
   134  }
   135  
   136  // SetContext adds the context to the move project params
   137  func (o *MoveProjectParams) SetContext(ctx context.Context) {
   138  	o.Context = ctx
   139  }
   140  
   141  // WithHTTPClient adds the HTTPClient to the move project params
   142  func (o *MoveProjectParams) WithHTTPClient(client *http.Client) *MoveProjectParams {
   143  	o.SetHTTPClient(client)
   144  	return o
   145  }
   146  
   147  // SetHTTPClient adds the HTTPClient to the move project params
   148  func (o *MoveProjectParams) SetHTTPClient(client *http.Client) {
   149  	o.HTTPClient = client
   150  }
   151  
   152  // WithDestination adds the destination to the move project params
   153  func (o *MoveProjectParams) WithDestination(destination MoveProjectBody) *MoveProjectParams {
   154  	o.SetDestination(destination)
   155  	return o
   156  }
   157  
   158  // SetDestination adds the destination to the move project params
   159  func (o *MoveProjectParams) SetDestination(destination MoveProjectBody) {
   160  	o.Destination = destination
   161  }
   162  
   163  // WithIdentifierType adds the identifierType to the move project params
   164  func (o *MoveProjectParams) WithIdentifierType(identifierType *string) *MoveProjectParams {
   165  	o.SetIdentifierType(identifierType)
   166  	return o
   167  }
   168  
   169  // SetIdentifierType adds the identifierType to the move project params
   170  func (o *MoveProjectParams) SetIdentifierType(identifierType *string) {
   171  	o.IdentifierType = identifierType
   172  }
   173  
   174  // WithOrganizationIdentifier adds the organizationIdentifier to the move project params
   175  func (o *MoveProjectParams) WithOrganizationIdentifier(organizationIdentifier string) *MoveProjectParams {
   176  	o.SetOrganizationIdentifier(organizationIdentifier)
   177  	return o
   178  }
   179  
   180  // SetOrganizationIdentifier adds the organizationIdentifier to the move project params
   181  func (o *MoveProjectParams) SetOrganizationIdentifier(organizationIdentifier string) {
   182  	o.OrganizationIdentifier = organizationIdentifier
   183  }
   184  
   185  // WithProjectName adds the projectName to the move project params
   186  func (o *MoveProjectParams) WithProjectName(projectName string) *MoveProjectParams {
   187  	o.SetProjectName(projectName)
   188  	return o
   189  }
   190  
   191  // SetProjectName adds the projectName to the move project params
   192  func (o *MoveProjectParams) SetProjectName(projectName string) {
   193  	o.ProjectName = projectName
   194  }
   195  
   196  // WriteToRequest writes these params to a swagger request
   197  func (o *MoveProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   198  
   199  	if err := r.SetTimeout(o.timeout); err != nil {
   200  		return err
   201  	}
   202  	var res []error
   203  	if err := r.SetBodyParam(o.Destination); err != nil {
   204  		return err
   205  	}
   206  
   207  	if o.IdentifierType != nil {
   208  
   209  		// query param identifierType
   210  		var qrIdentifierType string
   211  
   212  		if o.IdentifierType != nil {
   213  			qrIdentifierType = *o.IdentifierType
   214  		}
   215  		qIdentifierType := qrIdentifierType
   216  		if qIdentifierType != "" {
   217  
   218  			if err := r.SetQueryParam("identifierType", qIdentifierType); err != nil {
   219  				return err
   220  			}
   221  		}
   222  	}
   223  
   224  	// path param organizationIdentifier
   225  	if err := r.SetPathParam("organizationIdentifier", o.OrganizationIdentifier); err != nil {
   226  		return err
   227  	}
   228  
   229  	// path param projectName
   230  	if err := r.SetPathParam("projectName", o.ProjectName); err != nil {
   231  		return err
   232  	}
   233  
   234  	if len(res) > 0 {
   235  		return errors.CompositeValidationError(res...)
   236  	}
   237  	return nil
   238  }