github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/projects/delete_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  // NewDeleteProjectParams creates a new DeleteProjectParams 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 NewDeleteProjectParams() *DeleteProjectParams {
    26  	return &DeleteProjectParams{
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewDeleteProjectParamsWithTimeout creates a new DeleteProjectParams object
    32  // with the ability to set a timeout on a request.
    33  func NewDeleteProjectParamsWithTimeout(timeout time.Duration) *DeleteProjectParams {
    34  	return &DeleteProjectParams{
    35  		timeout: timeout,
    36  	}
    37  }
    38  
    39  // NewDeleteProjectParamsWithContext creates a new DeleteProjectParams object
    40  // with the ability to set a context for a request.
    41  func NewDeleteProjectParamsWithContext(ctx context.Context) *DeleteProjectParams {
    42  	return &DeleteProjectParams{
    43  		Context: ctx,
    44  	}
    45  }
    46  
    47  // NewDeleteProjectParamsWithHTTPClient creates a new DeleteProjectParams object
    48  // with the ability to set a custom HTTPClient for a request.
    49  func NewDeleteProjectParamsWithHTTPClient(client *http.Client) *DeleteProjectParams {
    50  	return &DeleteProjectParams{
    51  		HTTPClient: client,
    52  	}
    53  }
    54  
    55  /* DeleteProjectParams contains all the parameters to send to the API endpoint
    56     for the delete project operation.
    57  
    58     Typically these are written to a http.Request.
    59  */
    60  type DeleteProjectParams struct {
    61  
    62  	/* OrganizationName.
    63  
    64  	   Name of desired project's parent organization
    65  	*/
    66  	OrganizationName string
    67  
    68  	/* ProjectName.
    69  
    70  	   Name of the desired project
    71  	*/
    72  	ProjectName string
    73  
    74  	timeout    time.Duration
    75  	Context    context.Context
    76  	HTTPClient *http.Client
    77  }
    78  
    79  // WithDefaults hydrates default values in the delete project params (not the query body).
    80  //
    81  // All values with no default are reset to their zero value.
    82  func (o *DeleteProjectParams) WithDefaults() *DeleteProjectParams {
    83  	o.SetDefaults()
    84  	return o
    85  }
    86  
    87  // SetDefaults hydrates default values in the delete project params (not the query body).
    88  //
    89  // All values with no default are reset to their zero value.
    90  func (o *DeleteProjectParams) SetDefaults() {
    91  	// no default values defined for this parameter
    92  }
    93  
    94  // WithTimeout adds the timeout to the delete project params
    95  func (o *DeleteProjectParams) WithTimeout(timeout time.Duration) *DeleteProjectParams {
    96  	o.SetTimeout(timeout)
    97  	return o
    98  }
    99  
   100  // SetTimeout adds the timeout to the delete project params
   101  func (o *DeleteProjectParams) SetTimeout(timeout time.Duration) {
   102  	o.timeout = timeout
   103  }
   104  
   105  // WithContext adds the context to the delete project params
   106  func (o *DeleteProjectParams) WithContext(ctx context.Context) *DeleteProjectParams {
   107  	o.SetContext(ctx)
   108  	return o
   109  }
   110  
   111  // SetContext adds the context to the delete project params
   112  func (o *DeleteProjectParams) SetContext(ctx context.Context) {
   113  	o.Context = ctx
   114  }
   115  
   116  // WithHTTPClient adds the HTTPClient to the delete project params
   117  func (o *DeleteProjectParams) WithHTTPClient(client *http.Client) *DeleteProjectParams {
   118  	o.SetHTTPClient(client)
   119  	return o
   120  }
   121  
   122  // SetHTTPClient adds the HTTPClient to the delete project params
   123  func (o *DeleteProjectParams) SetHTTPClient(client *http.Client) {
   124  	o.HTTPClient = client
   125  }
   126  
   127  // WithOrganizationName adds the organizationName to the delete project params
   128  func (o *DeleteProjectParams) WithOrganizationName(organizationName string) *DeleteProjectParams {
   129  	o.SetOrganizationName(organizationName)
   130  	return o
   131  }
   132  
   133  // SetOrganizationName adds the organizationName to the delete project params
   134  func (o *DeleteProjectParams) SetOrganizationName(organizationName string) {
   135  	o.OrganizationName = organizationName
   136  }
   137  
   138  // WithProjectName adds the projectName to the delete project params
   139  func (o *DeleteProjectParams) WithProjectName(projectName string) *DeleteProjectParams {
   140  	o.SetProjectName(projectName)
   141  	return o
   142  }
   143  
   144  // SetProjectName adds the projectName to the delete project params
   145  func (o *DeleteProjectParams) SetProjectName(projectName string) {
   146  	o.ProjectName = projectName
   147  }
   148  
   149  // WriteToRequest writes these params to a swagger request
   150  func (o *DeleteProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   151  
   152  	if err := r.SetTimeout(o.timeout); err != nil {
   153  		return err
   154  	}
   155  	var res []error
   156  
   157  	// path param organizationName
   158  	if err := r.SetPathParam("organizationName", o.OrganizationName); err != nil {
   159  		return err
   160  	}
   161  
   162  	// path param projectName
   163  	if err := r.SetPathParam("projectName", o.ProjectName); err != nil {
   164  		return err
   165  	}
   166  
   167  	if len(res) > 0 {
   168  		return errors.CompositeValidationError(res...)
   169  	}
   170  	return nil
   171  }