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