github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/projects/get_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 // NewGetProjectParams creates a new GetProjectParams 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 NewGetProjectParams() *GetProjectParams { 26 return &GetProjectParams{ 27 timeout: cr.DefaultTimeout, 28 } 29 } 30 31 // NewGetProjectParamsWithTimeout creates a new GetProjectParams object 32 // with the ability to set a timeout on a request. 33 func NewGetProjectParamsWithTimeout(timeout time.Duration) *GetProjectParams { 34 return &GetProjectParams{ 35 timeout: timeout, 36 } 37 } 38 39 // NewGetProjectParamsWithContext creates a new GetProjectParams object 40 // with the ability to set a context for a request. 41 func NewGetProjectParamsWithContext(ctx context.Context) *GetProjectParams { 42 return &GetProjectParams{ 43 Context: ctx, 44 } 45 } 46 47 // NewGetProjectParamsWithHTTPClient creates a new GetProjectParams object 48 // with the ability to set a custom HTTPClient for a request. 49 func NewGetProjectParamsWithHTTPClient(client *http.Client) *GetProjectParams { 50 return &GetProjectParams{ 51 HTTPClient: client, 52 } 53 } 54 55 /* GetProjectParams contains all the parameters to send to the API endpoint 56 for the get project operation. 57 58 Typically these are written to a http.Request. 59 */ 60 type GetProjectParams struct { 61 62 /* OrganizationName. 63 64 organization to search 65 */ 66 OrganizationName string 67 68 /* ProjectName. 69 70 project to fetch 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 get project params (not the query body). 80 // 81 // All values with no default are reset to their zero value. 82 func (o *GetProjectParams) WithDefaults() *GetProjectParams { 83 o.SetDefaults() 84 return o 85 } 86 87 // SetDefaults hydrates default values in the get project params (not the query body). 88 // 89 // All values with no default are reset to their zero value. 90 func (o *GetProjectParams) SetDefaults() { 91 // no default values defined for this parameter 92 } 93 94 // WithTimeout adds the timeout to the get project params 95 func (o *GetProjectParams) WithTimeout(timeout time.Duration) *GetProjectParams { 96 o.SetTimeout(timeout) 97 return o 98 } 99 100 // SetTimeout adds the timeout to the get project params 101 func (o *GetProjectParams) SetTimeout(timeout time.Duration) { 102 o.timeout = timeout 103 } 104 105 // WithContext adds the context to the get project params 106 func (o *GetProjectParams) WithContext(ctx context.Context) *GetProjectParams { 107 o.SetContext(ctx) 108 return o 109 } 110 111 // SetContext adds the context to the get project params 112 func (o *GetProjectParams) SetContext(ctx context.Context) { 113 o.Context = ctx 114 } 115 116 // WithHTTPClient adds the HTTPClient to the get project params 117 func (o *GetProjectParams) WithHTTPClient(client *http.Client) *GetProjectParams { 118 o.SetHTTPClient(client) 119 return o 120 } 121 122 // SetHTTPClient adds the HTTPClient to the get project params 123 func (o *GetProjectParams) SetHTTPClient(client *http.Client) { 124 o.HTTPClient = client 125 } 126 127 // WithOrganizationName adds the organizationName to the get project params 128 func (o *GetProjectParams) WithOrganizationName(organizationName string) *GetProjectParams { 129 o.SetOrganizationName(organizationName) 130 return o 131 } 132 133 // SetOrganizationName adds the organizationName to the get project params 134 func (o *GetProjectParams) SetOrganizationName(organizationName string) { 135 o.OrganizationName = organizationName 136 } 137 138 // WithProjectName adds the projectName to the get project params 139 func (o *GetProjectParams) WithProjectName(projectName string) *GetProjectParams { 140 o.SetProjectName(projectName) 141 return o 142 } 143 144 // SetProjectName adds the projectName to the get project params 145 func (o *GetProjectParams) SetProjectName(projectName string) { 146 o.ProjectName = projectName 147 } 148 149 // WriteToRequest writes these params to a swagger request 150 func (o *GetProjectParams) 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 }