github.com/Redstoneguy129/cli@v0.0.0-20230211220159-15dca4e91917/pkg/api/client.gen.go (about) 1 // Package api provides primitives to interact with the openapi HTTP API. 2 // 3 // Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT. 4 package api 5 6 import ( 7 "bytes" 8 "context" 9 "encoding/json" 10 "fmt" 11 "io" 12 "net/http" 13 "net/url" 14 "strings" 15 16 "github.com/deepmap/oapi-codegen/pkg/runtime" 17 ) 18 19 // RequestEditorFn is the function signature for the RequestEditor callback function 20 type RequestEditorFn func(ctx context.Context, req *http.Request) error 21 22 // Doer performs HTTP requests. 23 // 24 // The standard http.Client implements this interface. 25 type HttpRequestDoer interface { 26 Do(req *http.Request) (*http.Response, error) 27 } 28 29 // Client which conforms to the OpenAPI3 specification for this service. 30 type Client struct { 31 // The endpoint of the server conforming to this interface, with scheme, 32 // https://api.deepmap.com for example. This can contain a path relative 33 // to the server, such as https://api.deepmap.com/dev-test, and all the 34 // paths in the swagger spec will be appended to the server. 35 Server string 36 37 // Doer for performing requests, typically a *http.Client with any 38 // customized settings, such as certificate chains. 39 Client HttpRequestDoer 40 41 // A list of callbacks for modifying requests which are generated before sending over 42 // the network. 43 RequestEditors []RequestEditorFn 44 } 45 46 // ClientOption allows setting custom parameters during construction 47 type ClientOption func(*Client) error 48 49 // Creates a new Client, with reasonable defaults 50 func NewClient(server string, opts ...ClientOption) (*Client, error) { 51 // create a client with sane default values 52 client := Client{ 53 Server: server, 54 } 55 // mutate client and add all optional params 56 for _, o := range opts { 57 if err := o(&client); err != nil { 58 return nil, err 59 } 60 } 61 // ensure the server URL always has a trailing slash 62 if !strings.HasSuffix(client.Server, "/") { 63 client.Server += "/" 64 } 65 // create httpClient, if not already present 66 if client.Client == nil { 67 client.Client = &http.Client{} 68 } 69 return &client, nil 70 } 71 72 // WithHTTPClient allows overriding the default Doer, which is 73 // automatically created using http.Client. This is useful for tests. 74 func WithHTTPClient(doer HttpRequestDoer) ClientOption { 75 return func(c *Client) error { 76 c.Client = doer 77 return nil 78 } 79 } 80 81 // WithRequestEditorFn allows setting up a callback function, which will be 82 // called right before sending the request. This can be used to mutate the request. 83 func WithRequestEditorFn(fn RequestEditorFn) ClientOption { 84 return func(c *Client) error { 85 c.RequestEditors = append(c.RequestEditors, fn) 86 return nil 87 } 88 } 89 90 // The interface specification for the client above. 91 type ClientInterface interface { 92 // GetOrganizations request 93 GetOrganizations(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) 94 95 // CreateOrganization request with any body 96 CreateOrganizationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 97 98 CreateOrganization(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 99 100 // GetProjects request 101 GetProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) 102 103 // CreateProject request with any body 104 CreateProjectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 105 106 CreateProject(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 107 108 // RemoveCustomHostnameConfig request 109 RemoveCustomHostnameConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 110 111 // GetCustomHostnameConfig request 112 GetCustomHostnameConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 113 114 // Activate request 115 Activate(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 116 117 // CreateCustomHostnameConfig request with any body 118 CreateCustomHostnameConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 119 120 CreateCustomHostnameConfig(ctx context.Context, ref string, body CreateCustomHostnameConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 121 122 // Reverify request 123 Reverify(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 124 125 // GetFunctions request 126 GetFunctions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 127 128 // CreateFunction request with any body 129 CreateFunctionWithBody(ctx context.Context, ref string, params *CreateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 130 131 CreateFunction(ctx context.Context, ref string, params *CreateFunctionParams, body CreateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 132 133 // DeleteFunction request 134 DeleteFunction(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*http.Response, error) 135 136 // GetFunction request 137 GetFunction(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*http.Response, error) 138 139 // UpdateFunction request with any body 140 UpdateFunctionWithBody(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 141 142 UpdateFunction(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, body UpdateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 143 144 // GetFunctionBody request 145 GetFunctionBody(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*http.Response, error) 146 147 // RemoveNetworkBan request with any body 148 RemoveNetworkBanWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 149 150 RemoveNetworkBan(ctx context.Context, ref string, body RemoveNetworkBanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 151 152 // GetNetworkBans request 153 GetNetworkBans(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 154 155 // GetNetworkRestrictions request 156 GetNetworkRestrictions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 157 158 // ApplyNetworkRestrictions request with any body 159 ApplyNetworkRestrictionsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 160 161 ApplyNetworkRestrictions(ctx context.Context, ref string, body ApplyNetworkRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 162 163 // GetConfig request 164 GetConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 165 166 // UpdateConfig request with any body 167 UpdateConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 168 169 UpdateConfig(ctx context.Context, ref string, body UpdateConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 170 171 // GetPostgRESTConfig request 172 GetPostgRESTConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 173 174 // UpdatePostgRESTConfig request with any body 175 UpdatePostgRESTConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 176 177 UpdatePostgRESTConfig(ctx context.Context, ref string, body UpdatePostgRESTConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 178 179 // DeleteSecrets request with any body 180 DeleteSecretsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 181 182 DeleteSecrets(ctx context.Context, ref string, body DeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 183 184 // GetSecrets request 185 GetSecrets(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 186 187 // CreateSecrets request with any body 188 CreateSecretsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 189 190 CreateSecrets(ctx context.Context, ref string, body CreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 191 192 // GetSslEnforcementConfig request 193 GetSslEnforcementConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 194 195 // UpdateSslEnforcementConfig request with any body 196 UpdateSslEnforcementConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 197 198 UpdateSslEnforcementConfig(ctx context.Context, ref string, body UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 199 200 // GetTypescriptTypes request 201 GetTypescriptTypes(ctx context.Context, ref string, params *GetTypescriptTypesParams, reqEditors ...RequestEditorFn) (*http.Response, error) 202 203 // RemoveVanitySubdomainConfig request 204 RemoveVanitySubdomainConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 205 206 // GetVanitySubdomainConfig request 207 GetVanitySubdomainConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) 208 209 // ActivateVanitySubdomainPlease request with any body 210 ActivateVanitySubdomainPleaseWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 211 212 ActivateVanitySubdomainPlease(ctx context.Context, ref string, body ActivateVanitySubdomainPleaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 213 214 // CheckVanitySubdomainAvailability request with any body 215 CheckVanitySubdomainAvailabilityWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 216 217 CheckVanitySubdomainAvailability(ctx context.Context, ref string, body CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 218 } 219 220 func (c *Client) GetOrganizations(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { 221 req, err := NewGetOrganizationsRequest(c.Server) 222 if err != nil { 223 return nil, err 224 } 225 req = req.WithContext(ctx) 226 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 227 return nil, err 228 } 229 return c.Client.Do(req) 230 } 231 232 func (c *Client) CreateOrganizationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 233 req, err := NewCreateOrganizationRequestWithBody(c.Server, contentType, body) 234 if err != nil { 235 return nil, err 236 } 237 req = req.WithContext(ctx) 238 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 239 return nil, err 240 } 241 return c.Client.Do(req) 242 } 243 244 func (c *Client) CreateOrganization(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 245 req, err := NewCreateOrganizationRequest(c.Server, body) 246 if err != nil { 247 return nil, err 248 } 249 req = req.WithContext(ctx) 250 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 251 return nil, err 252 } 253 return c.Client.Do(req) 254 } 255 256 func (c *Client) GetProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { 257 req, err := NewGetProjectsRequest(c.Server) 258 if err != nil { 259 return nil, err 260 } 261 req = req.WithContext(ctx) 262 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 263 return nil, err 264 } 265 return c.Client.Do(req) 266 } 267 268 func (c *Client) CreateProjectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 269 req, err := NewCreateProjectRequestWithBody(c.Server, contentType, body) 270 if err != nil { 271 return nil, err 272 } 273 req = req.WithContext(ctx) 274 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 275 return nil, err 276 } 277 return c.Client.Do(req) 278 } 279 280 func (c *Client) CreateProject(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 281 req, err := NewCreateProjectRequest(c.Server, body) 282 if err != nil { 283 return nil, err 284 } 285 req = req.WithContext(ctx) 286 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 287 return nil, err 288 } 289 return c.Client.Do(req) 290 } 291 292 func (c *Client) RemoveCustomHostnameConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 293 req, err := NewRemoveCustomHostnameConfigRequest(c.Server, ref) 294 if err != nil { 295 return nil, err 296 } 297 req = req.WithContext(ctx) 298 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 299 return nil, err 300 } 301 return c.Client.Do(req) 302 } 303 304 func (c *Client) GetCustomHostnameConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 305 req, err := NewGetCustomHostnameConfigRequest(c.Server, ref) 306 if err != nil { 307 return nil, err 308 } 309 req = req.WithContext(ctx) 310 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 311 return nil, err 312 } 313 return c.Client.Do(req) 314 } 315 316 func (c *Client) Activate(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 317 req, err := NewActivateRequest(c.Server, ref) 318 if err != nil { 319 return nil, err 320 } 321 req = req.WithContext(ctx) 322 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 323 return nil, err 324 } 325 return c.Client.Do(req) 326 } 327 328 func (c *Client) CreateCustomHostnameConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 329 req, err := NewCreateCustomHostnameConfigRequestWithBody(c.Server, ref, contentType, body) 330 if err != nil { 331 return nil, err 332 } 333 req = req.WithContext(ctx) 334 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 335 return nil, err 336 } 337 return c.Client.Do(req) 338 } 339 340 func (c *Client) CreateCustomHostnameConfig(ctx context.Context, ref string, body CreateCustomHostnameConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 341 req, err := NewCreateCustomHostnameConfigRequest(c.Server, ref, body) 342 if err != nil { 343 return nil, err 344 } 345 req = req.WithContext(ctx) 346 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 347 return nil, err 348 } 349 return c.Client.Do(req) 350 } 351 352 func (c *Client) Reverify(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 353 req, err := NewReverifyRequest(c.Server, ref) 354 if err != nil { 355 return nil, err 356 } 357 req = req.WithContext(ctx) 358 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 359 return nil, err 360 } 361 return c.Client.Do(req) 362 } 363 364 func (c *Client) GetFunctions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 365 req, err := NewGetFunctionsRequest(c.Server, ref) 366 if err != nil { 367 return nil, err 368 } 369 req = req.WithContext(ctx) 370 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 371 return nil, err 372 } 373 return c.Client.Do(req) 374 } 375 376 func (c *Client) CreateFunctionWithBody(ctx context.Context, ref string, params *CreateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 377 req, err := NewCreateFunctionRequestWithBody(c.Server, ref, params, contentType, body) 378 if err != nil { 379 return nil, err 380 } 381 req = req.WithContext(ctx) 382 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 383 return nil, err 384 } 385 return c.Client.Do(req) 386 } 387 388 func (c *Client) CreateFunction(ctx context.Context, ref string, params *CreateFunctionParams, body CreateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 389 req, err := NewCreateFunctionRequest(c.Server, ref, params, body) 390 if err != nil { 391 return nil, err 392 } 393 req = req.WithContext(ctx) 394 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 395 return nil, err 396 } 397 return c.Client.Do(req) 398 } 399 400 func (c *Client) DeleteFunction(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*http.Response, error) { 401 req, err := NewDeleteFunctionRequest(c.Server, ref, functionSlug) 402 if err != nil { 403 return nil, err 404 } 405 req = req.WithContext(ctx) 406 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 407 return nil, err 408 } 409 return c.Client.Do(req) 410 } 411 412 func (c *Client) GetFunction(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*http.Response, error) { 413 req, err := NewGetFunctionRequest(c.Server, ref, functionSlug) 414 if err != nil { 415 return nil, err 416 } 417 req = req.WithContext(ctx) 418 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 419 return nil, err 420 } 421 return c.Client.Do(req) 422 } 423 424 func (c *Client) UpdateFunctionWithBody(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 425 req, err := NewUpdateFunctionRequestWithBody(c.Server, ref, functionSlug, params, contentType, body) 426 if err != nil { 427 return nil, err 428 } 429 req = req.WithContext(ctx) 430 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 431 return nil, err 432 } 433 return c.Client.Do(req) 434 } 435 436 func (c *Client) UpdateFunction(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, body UpdateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 437 req, err := NewUpdateFunctionRequest(c.Server, ref, functionSlug, params, body) 438 if err != nil { 439 return nil, err 440 } 441 req = req.WithContext(ctx) 442 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 443 return nil, err 444 } 445 return c.Client.Do(req) 446 } 447 448 func (c *Client) GetFunctionBody(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*http.Response, error) { 449 req, err := NewGetFunctionBodyRequest(c.Server, ref, functionSlug) 450 if err != nil { 451 return nil, err 452 } 453 req = req.WithContext(ctx) 454 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 455 return nil, err 456 } 457 return c.Client.Do(req) 458 } 459 460 func (c *Client) RemoveNetworkBanWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 461 req, err := NewRemoveNetworkBanRequestWithBody(c.Server, ref, contentType, body) 462 if err != nil { 463 return nil, err 464 } 465 req = req.WithContext(ctx) 466 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 467 return nil, err 468 } 469 return c.Client.Do(req) 470 } 471 472 func (c *Client) RemoveNetworkBan(ctx context.Context, ref string, body RemoveNetworkBanJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 473 req, err := NewRemoveNetworkBanRequest(c.Server, ref, body) 474 if err != nil { 475 return nil, err 476 } 477 req = req.WithContext(ctx) 478 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 479 return nil, err 480 } 481 return c.Client.Do(req) 482 } 483 484 func (c *Client) GetNetworkBans(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 485 req, err := NewGetNetworkBansRequest(c.Server, ref) 486 if err != nil { 487 return nil, err 488 } 489 req = req.WithContext(ctx) 490 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 491 return nil, err 492 } 493 return c.Client.Do(req) 494 } 495 496 func (c *Client) GetNetworkRestrictions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 497 req, err := NewGetNetworkRestrictionsRequest(c.Server, ref) 498 if err != nil { 499 return nil, err 500 } 501 req = req.WithContext(ctx) 502 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 503 return nil, err 504 } 505 return c.Client.Do(req) 506 } 507 508 func (c *Client) ApplyNetworkRestrictionsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 509 req, err := NewApplyNetworkRestrictionsRequestWithBody(c.Server, ref, contentType, body) 510 if err != nil { 511 return nil, err 512 } 513 req = req.WithContext(ctx) 514 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 515 return nil, err 516 } 517 return c.Client.Do(req) 518 } 519 520 func (c *Client) ApplyNetworkRestrictions(ctx context.Context, ref string, body ApplyNetworkRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 521 req, err := NewApplyNetworkRestrictionsRequest(c.Server, ref, body) 522 if err != nil { 523 return nil, err 524 } 525 req = req.WithContext(ctx) 526 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 527 return nil, err 528 } 529 return c.Client.Do(req) 530 } 531 532 func (c *Client) GetConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 533 req, err := NewGetConfigRequest(c.Server, ref) 534 if err != nil { 535 return nil, err 536 } 537 req = req.WithContext(ctx) 538 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 539 return nil, err 540 } 541 return c.Client.Do(req) 542 } 543 544 func (c *Client) UpdateConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 545 req, err := NewUpdateConfigRequestWithBody(c.Server, ref, contentType, body) 546 if err != nil { 547 return nil, err 548 } 549 req = req.WithContext(ctx) 550 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 551 return nil, err 552 } 553 return c.Client.Do(req) 554 } 555 556 func (c *Client) UpdateConfig(ctx context.Context, ref string, body UpdateConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 557 req, err := NewUpdateConfigRequest(c.Server, ref, body) 558 if err != nil { 559 return nil, err 560 } 561 req = req.WithContext(ctx) 562 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 563 return nil, err 564 } 565 return c.Client.Do(req) 566 } 567 568 func (c *Client) GetPostgRESTConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 569 req, err := NewGetPostgRESTConfigRequest(c.Server, ref) 570 if err != nil { 571 return nil, err 572 } 573 req = req.WithContext(ctx) 574 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 575 return nil, err 576 } 577 return c.Client.Do(req) 578 } 579 580 func (c *Client) UpdatePostgRESTConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 581 req, err := NewUpdatePostgRESTConfigRequestWithBody(c.Server, ref, contentType, body) 582 if err != nil { 583 return nil, err 584 } 585 req = req.WithContext(ctx) 586 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 587 return nil, err 588 } 589 return c.Client.Do(req) 590 } 591 592 func (c *Client) UpdatePostgRESTConfig(ctx context.Context, ref string, body UpdatePostgRESTConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 593 req, err := NewUpdatePostgRESTConfigRequest(c.Server, ref, body) 594 if err != nil { 595 return nil, err 596 } 597 req = req.WithContext(ctx) 598 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 599 return nil, err 600 } 601 return c.Client.Do(req) 602 } 603 604 func (c *Client) DeleteSecretsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 605 req, err := NewDeleteSecretsRequestWithBody(c.Server, ref, contentType, body) 606 if err != nil { 607 return nil, err 608 } 609 req = req.WithContext(ctx) 610 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 611 return nil, err 612 } 613 return c.Client.Do(req) 614 } 615 616 func (c *Client) DeleteSecrets(ctx context.Context, ref string, body DeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 617 req, err := NewDeleteSecretsRequest(c.Server, ref, body) 618 if err != nil { 619 return nil, err 620 } 621 req = req.WithContext(ctx) 622 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 623 return nil, err 624 } 625 return c.Client.Do(req) 626 } 627 628 func (c *Client) GetSecrets(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 629 req, err := NewGetSecretsRequest(c.Server, ref) 630 if err != nil { 631 return nil, err 632 } 633 req = req.WithContext(ctx) 634 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 635 return nil, err 636 } 637 return c.Client.Do(req) 638 } 639 640 func (c *Client) CreateSecretsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 641 req, err := NewCreateSecretsRequestWithBody(c.Server, ref, contentType, body) 642 if err != nil { 643 return nil, err 644 } 645 req = req.WithContext(ctx) 646 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 647 return nil, err 648 } 649 return c.Client.Do(req) 650 } 651 652 func (c *Client) CreateSecrets(ctx context.Context, ref string, body CreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 653 req, err := NewCreateSecretsRequest(c.Server, ref, body) 654 if err != nil { 655 return nil, err 656 } 657 req = req.WithContext(ctx) 658 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 659 return nil, err 660 } 661 return c.Client.Do(req) 662 } 663 664 func (c *Client) GetSslEnforcementConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 665 req, err := NewGetSslEnforcementConfigRequest(c.Server, ref) 666 if err != nil { 667 return nil, err 668 } 669 req = req.WithContext(ctx) 670 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 671 return nil, err 672 } 673 return c.Client.Do(req) 674 } 675 676 func (c *Client) UpdateSslEnforcementConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 677 req, err := NewUpdateSslEnforcementConfigRequestWithBody(c.Server, ref, contentType, body) 678 if err != nil { 679 return nil, err 680 } 681 req = req.WithContext(ctx) 682 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 683 return nil, err 684 } 685 return c.Client.Do(req) 686 } 687 688 func (c *Client) UpdateSslEnforcementConfig(ctx context.Context, ref string, body UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 689 req, err := NewUpdateSslEnforcementConfigRequest(c.Server, ref, body) 690 if err != nil { 691 return nil, err 692 } 693 req = req.WithContext(ctx) 694 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 695 return nil, err 696 } 697 return c.Client.Do(req) 698 } 699 700 func (c *Client) GetTypescriptTypes(ctx context.Context, ref string, params *GetTypescriptTypesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 701 req, err := NewGetTypescriptTypesRequest(c.Server, ref, params) 702 if err != nil { 703 return nil, err 704 } 705 req = req.WithContext(ctx) 706 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 707 return nil, err 708 } 709 return c.Client.Do(req) 710 } 711 712 func (c *Client) RemoveVanitySubdomainConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 713 req, err := NewRemoveVanitySubdomainConfigRequest(c.Server, ref) 714 if err != nil { 715 return nil, err 716 } 717 req = req.WithContext(ctx) 718 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 719 return nil, err 720 } 721 return c.Client.Do(req) 722 } 723 724 func (c *Client) GetVanitySubdomainConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { 725 req, err := NewGetVanitySubdomainConfigRequest(c.Server, ref) 726 if err != nil { 727 return nil, err 728 } 729 req = req.WithContext(ctx) 730 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 731 return nil, err 732 } 733 return c.Client.Do(req) 734 } 735 736 func (c *Client) ActivateVanitySubdomainPleaseWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 737 req, err := NewActivateVanitySubdomainPleaseRequestWithBody(c.Server, ref, contentType, body) 738 if err != nil { 739 return nil, err 740 } 741 req = req.WithContext(ctx) 742 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 743 return nil, err 744 } 745 return c.Client.Do(req) 746 } 747 748 func (c *Client) ActivateVanitySubdomainPlease(ctx context.Context, ref string, body ActivateVanitySubdomainPleaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 749 req, err := NewActivateVanitySubdomainPleaseRequest(c.Server, ref, body) 750 if err != nil { 751 return nil, err 752 } 753 req = req.WithContext(ctx) 754 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 755 return nil, err 756 } 757 return c.Client.Do(req) 758 } 759 760 func (c *Client) CheckVanitySubdomainAvailabilityWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 761 req, err := NewCheckVanitySubdomainAvailabilityRequestWithBody(c.Server, ref, contentType, body) 762 if err != nil { 763 return nil, err 764 } 765 req = req.WithContext(ctx) 766 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 767 return nil, err 768 } 769 return c.Client.Do(req) 770 } 771 772 func (c *Client) CheckVanitySubdomainAvailability(ctx context.Context, ref string, body CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 773 req, err := NewCheckVanitySubdomainAvailabilityRequest(c.Server, ref, body) 774 if err != nil { 775 return nil, err 776 } 777 req = req.WithContext(ctx) 778 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 779 return nil, err 780 } 781 return c.Client.Do(req) 782 } 783 784 // NewGetOrganizationsRequest generates requests for GetOrganizations 785 func NewGetOrganizationsRequest(server string) (*http.Request, error) { 786 var err error 787 788 serverURL, err := url.Parse(server) 789 if err != nil { 790 return nil, err 791 } 792 793 operationPath := fmt.Sprintf("/v1/organizations") 794 if operationPath[0] == '/' { 795 operationPath = "." + operationPath 796 } 797 798 queryURL, err := serverURL.Parse(operationPath) 799 if err != nil { 800 return nil, err 801 } 802 803 req, err := http.NewRequest("GET", queryURL.String(), nil) 804 if err != nil { 805 return nil, err 806 } 807 808 return req, nil 809 } 810 811 // NewCreateOrganizationRequest calls the generic CreateOrganization builder with application/json body 812 func NewCreateOrganizationRequest(server string, body CreateOrganizationJSONRequestBody) (*http.Request, error) { 813 var bodyReader io.Reader 814 buf, err := json.Marshal(body) 815 if err != nil { 816 return nil, err 817 } 818 bodyReader = bytes.NewReader(buf) 819 return NewCreateOrganizationRequestWithBody(server, "application/json", bodyReader) 820 } 821 822 // NewCreateOrganizationRequestWithBody generates requests for CreateOrganization with any type of body 823 func NewCreateOrganizationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 824 var err error 825 826 serverURL, err := url.Parse(server) 827 if err != nil { 828 return nil, err 829 } 830 831 operationPath := fmt.Sprintf("/v1/organizations") 832 if operationPath[0] == '/' { 833 operationPath = "." + operationPath 834 } 835 836 queryURL, err := serverURL.Parse(operationPath) 837 if err != nil { 838 return nil, err 839 } 840 841 req, err := http.NewRequest("POST", queryURL.String(), body) 842 if err != nil { 843 return nil, err 844 } 845 846 req.Header.Add("Content-Type", contentType) 847 848 return req, nil 849 } 850 851 // NewGetProjectsRequest generates requests for GetProjects 852 func NewGetProjectsRequest(server string) (*http.Request, error) { 853 var err error 854 855 serverURL, err := url.Parse(server) 856 if err != nil { 857 return nil, err 858 } 859 860 operationPath := fmt.Sprintf("/v1/projects") 861 if operationPath[0] == '/' { 862 operationPath = "." + operationPath 863 } 864 865 queryURL, err := serverURL.Parse(operationPath) 866 if err != nil { 867 return nil, err 868 } 869 870 req, err := http.NewRequest("GET", queryURL.String(), nil) 871 if err != nil { 872 return nil, err 873 } 874 875 return req, nil 876 } 877 878 // NewCreateProjectRequest calls the generic CreateProject builder with application/json body 879 func NewCreateProjectRequest(server string, body CreateProjectJSONRequestBody) (*http.Request, error) { 880 var bodyReader io.Reader 881 buf, err := json.Marshal(body) 882 if err != nil { 883 return nil, err 884 } 885 bodyReader = bytes.NewReader(buf) 886 return NewCreateProjectRequestWithBody(server, "application/json", bodyReader) 887 } 888 889 // NewCreateProjectRequestWithBody generates requests for CreateProject with any type of body 890 func NewCreateProjectRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 891 var err error 892 893 serverURL, err := url.Parse(server) 894 if err != nil { 895 return nil, err 896 } 897 898 operationPath := fmt.Sprintf("/v1/projects") 899 if operationPath[0] == '/' { 900 operationPath = "." + operationPath 901 } 902 903 queryURL, err := serverURL.Parse(operationPath) 904 if err != nil { 905 return nil, err 906 } 907 908 req, err := http.NewRequest("POST", queryURL.String(), body) 909 if err != nil { 910 return nil, err 911 } 912 913 req.Header.Add("Content-Type", contentType) 914 915 return req, nil 916 } 917 918 // NewRemoveCustomHostnameConfigRequest generates requests for RemoveCustomHostnameConfig 919 func NewRemoveCustomHostnameConfigRequest(server string, ref string) (*http.Request, error) { 920 var err error 921 922 var pathParam0 string 923 924 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 925 if err != nil { 926 return nil, err 927 } 928 929 serverURL, err := url.Parse(server) 930 if err != nil { 931 return nil, err 932 } 933 934 operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) 935 if operationPath[0] == '/' { 936 operationPath = "." + operationPath 937 } 938 939 queryURL, err := serverURL.Parse(operationPath) 940 if err != nil { 941 return nil, err 942 } 943 944 req, err := http.NewRequest("DELETE", queryURL.String(), nil) 945 if err != nil { 946 return nil, err 947 } 948 949 return req, nil 950 } 951 952 // NewGetCustomHostnameConfigRequest generates requests for GetCustomHostnameConfig 953 func NewGetCustomHostnameConfigRequest(server string, ref string) (*http.Request, error) { 954 var err error 955 956 var pathParam0 string 957 958 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 959 if err != nil { 960 return nil, err 961 } 962 963 serverURL, err := url.Parse(server) 964 if err != nil { 965 return nil, err 966 } 967 968 operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) 969 if operationPath[0] == '/' { 970 operationPath = "." + operationPath 971 } 972 973 queryURL, err := serverURL.Parse(operationPath) 974 if err != nil { 975 return nil, err 976 } 977 978 req, err := http.NewRequest("GET", queryURL.String(), nil) 979 if err != nil { 980 return nil, err 981 } 982 983 return req, nil 984 } 985 986 // NewActivateRequest generates requests for Activate 987 func NewActivateRequest(server string, ref string) (*http.Request, error) { 988 var err error 989 990 var pathParam0 string 991 992 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 993 if err != nil { 994 return nil, err 995 } 996 997 serverURL, err := url.Parse(server) 998 if err != nil { 999 return nil, err 1000 } 1001 1002 operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/activate", pathParam0) 1003 if operationPath[0] == '/' { 1004 operationPath = "." + operationPath 1005 } 1006 1007 queryURL, err := serverURL.Parse(operationPath) 1008 if err != nil { 1009 return nil, err 1010 } 1011 1012 req, err := http.NewRequest("POST", queryURL.String(), nil) 1013 if err != nil { 1014 return nil, err 1015 } 1016 1017 return req, nil 1018 } 1019 1020 // NewCreateCustomHostnameConfigRequest calls the generic CreateCustomHostnameConfig builder with application/json body 1021 func NewCreateCustomHostnameConfigRequest(server string, ref string, body CreateCustomHostnameConfigJSONRequestBody) (*http.Request, error) { 1022 var bodyReader io.Reader 1023 buf, err := json.Marshal(body) 1024 if err != nil { 1025 return nil, err 1026 } 1027 bodyReader = bytes.NewReader(buf) 1028 return NewCreateCustomHostnameConfigRequestWithBody(server, ref, "application/json", bodyReader) 1029 } 1030 1031 // NewCreateCustomHostnameConfigRequestWithBody generates requests for CreateCustomHostnameConfig with any type of body 1032 func NewCreateCustomHostnameConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1033 var err error 1034 1035 var pathParam0 string 1036 1037 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1038 if err != nil { 1039 return nil, err 1040 } 1041 1042 serverURL, err := url.Parse(server) 1043 if err != nil { 1044 return nil, err 1045 } 1046 1047 operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/initialize", pathParam0) 1048 if operationPath[0] == '/' { 1049 operationPath = "." + operationPath 1050 } 1051 1052 queryURL, err := serverURL.Parse(operationPath) 1053 if err != nil { 1054 return nil, err 1055 } 1056 1057 req, err := http.NewRequest("POST", queryURL.String(), body) 1058 if err != nil { 1059 return nil, err 1060 } 1061 1062 req.Header.Add("Content-Type", contentType) 1063 1064 return req, nil 1065 } 1066 1067 // NewReverifyRequest generates requests for Reverify 1068 func NewReverifyRequest(server string, ref string) (*http.Request, error) { 1069 var err error 1070 1071 var pathParam0 string 1072 1073 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1074 if err != nil { 1075 return nil, err 1076 } 1077 1078 serverURL, err := url.Parse(server) 1079 if err != nil { 1080 return nil, err 1081 } 1082 1083 operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/reverify", pathParam0) 1084 if operationPath[0] == '/' { 1085 operationPath = "." + operationPath 1086 } 1087 1088 queryURL, err := serverURL.Parse(operationPath) 1089 if err != nil { 1090 return nil, err 1091 } 1092 1093 req, err := http.NewRequest("POST", queryURL.String(), nil) 1094 if err != nil { 1095 return nil, err 1096 } 1097 1098 return req, nil 1099 } 1100 1101 // NewGetFunctionsRequest generates requests for GetFunctions 1102 func NewGetFunctionsRequest(server string, ref string) (*http.Request, error) { 1103 var err error 1104 1105 var pathParam0 string 1106 1107 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1108 if err != nil { 1109 return nil, err 1110 } 1111 1112 serverURL, err := url.Parse(server) 1113 if err != nil { 1114 return nil, err 1115 } 1116 1117 operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) 1118 if operationPath[0] == '/' { 1119 operationPath = "." + operationPath 1120 } 1121 1122 queryURL, err := serverURL.Parse(operationPath) 1123 if err != nil { 1124 return nil, err 1125 } 1126 1127 req, err := http.NewRequest("GET", queryURL.String(), nil) 1128 if err != nil { 1129 return nil, err 1130 } 1131 1132 return req, nil 1133 } 1134 1135 // NewCreateFunctionRequest calls the generic CreateFunction builder with application/json body 1136 func NewCreateFunctionRequest(server string, ref string, params *CreateFunctionParams, body CreateFunctionJSONRequestBody) (*http.Request, error) { 1137 var bodyReader io.Reader 1138 buf, err := json.Marshal(body) 1139 if err != nil { 1140 return nil, err 1141 } 1142 bodyReader = bytes.NewReader(buf) 1143 return NewCreateFunctionRequestWithBody(server, ref, params, "application/json", bodyReader) 1144 } 1145 1146 // NewCreateFunctionRequestWithBody generates requests for CreateFunction with any type of body 1147 func NewCreateFunctionRequestWithBody(server string, ref string, params *CreateFunctionParams, contentType string, body io.Reader) (*http.Request, error) { 1148 var err error 1149 1150 var pathParam0 string 1151 1152 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1153 if err != nil { 1154 return nil, err 1155 } 1156 1157 serverURL, err := url.Parse(server) 1158 if err != nil { 1159 return nil, err 1160 } 1161 1162 operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) 1163 if operationPath[0] == '/' { 1164 operationPath = "." + operationPath 1165 } 1166 1167 queryURL, err := serverURL.Parse(operationPath) 1168 if err != nil { 1169 return nil, err 1170 } 1171 1172 queryValues := queryURL.Query() 1173 1174 if params.Slug != nil { 1175 1176 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { 1177 return nil, err 1178 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1179 return nil, err 1180 } else { 1181 for k, v := range parsed { 1182 for _, v2 := range v { 1183 queryValues.Add(k, v2) 1184 } 1185 } 1186 } 1187 1188 } 1189 1190 if params.Name != nil { 1191 1192 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { 1193 return nil, err 1194 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1195 return nil, err 1196 } else { 1197 for k, v := range parsed { 1198 for _, v2 := range v { 1199 queryValues.Add(k, v2) 1200 } 1201 } 1202 } 1203 1204 } 1205 1206 if params.VerifyJwt != nil { 1207 1208 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verify_jwt", runtime.ParamLocationQuery, *params.VerifyJwt); err != nil { 1209 return nil, err 1210 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1211 return nil, err 1212 } else { 1213 for k, v := range parsed { 1214 for _, v2 := range v { 1215 queryValues.Add(k, v2) 1216 } 1217 } 1218 } 1219 1220 } 1221 1222 if params.ImportMap != nil { 1223 1224 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map", runtime.ParamLocationQuery, *params.ImportMap); err != nil { 1225 return nil, err 1226 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1227 return nil, err 1228 } else { 1229 for k, v := range parsed { 1230 for _, v2 := range v { 1231 queryValues.Add(k, v2) 1232 } 1233 } 1234 } 1235 1236 } 1237 1238 queryURL.RawQuery = queryValues.Encode() 1239 1240 req, err := http.NewRequest("POST", queryURL.String(), body) 1241 if err != nil { 1242 return nil, err 1243 } 1244 1245 req.Header.Add("Content-Type", contentType) 1246 1247 return req, nil 1248 } 1249 1250 // NewDeleteFunctionRequest generates requests for DeleteFunction 1251 func NewDeleteFunctionRequest(server string, ref string, functionSlug string) (*http.Request, error) { 1252 var err error 1253 1254 var pathParam0 string 1255 1256 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1257 if err != nil { 1258 return nil, err 1259 } 1260 1261 var pathParam1 string 1262 1263 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) 1264 if err != nil { 1265 return nil, err 1266 } 1267 1268 serverURL, err := url.Parse(server) 1269 if err != nil { 1270 return nil, err 1271 } 1272 1273 operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) 1274 if operationPath[0] == '/' { 1275 operationPath = "." + operationPath 1276 } 1277 1278 queryURL, err := serverURL.Parse(operationPath) 1279 if err != nil { 1280 return nil, err 1281 } 1282 1283 req, err := http.NewRequest("DELETE", queryURL.String(), nil) 1284 if err != nil { 1285 return nil, err 1286 } 1287 1288 return req, nil 1289 } 1290 1291 // NewGetFunctionRequest generates requests for GetFunction 1292 func NewGetFunctionRequest(server string, ref string, functionSlug string) (*http.Request, error) { 1293 var err error 1294 1295 var pathParam0 string 1296 1297 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1298 if err != nil { 1299 return nil, err 1300 } 1301 1302 var pathParam1 string 1303 1304 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) 1305 if err != nil { 1306 return nil, err 1307 } 1308 1309 serverURL, err := url.Parse(server) 1310 if err != nil { 1311 return nil, err 1312 } 1313 1314 operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) 1315 if operationPath[0] == '/' { 1316 operationPath = "." + operationPath 1317 } 1318 1319 queryURL, err := serverURL.Parse(operationPath) 1320 if err != nil { 1321 return nil, err 1322 } 1323 1324 req, err := http.NewRequest("GET", queryURL.String(), nil) 1325 if err != nil { 1326 return nil, err 1327 } 1328 1329 return req, nil 1330 } 1331 1332 // NewUpdateFunctionRequest calls the generic UpdateFunction builder with application/json body 1333 func NewUpdateFunctionRequest(server string, ref string, functionSlug string, params *UpdateFunctionParams, body UpdateFunctionJSONRequestBody) (*http.Request, error) { 1334 var bodyReader io.Reader 1335 buf, err := json.Marshal(body) 1336 if err != nil { 1337 return nil, err 1338 } 1339 bodyReader = bytes.NewReader(buf) 1340 return NewUpdateFunctionRequestWithBody(server, ref, functionSlug, params, "application/json", bodyReader) 1341 } 1342 1343 // NewUpdateFunctionRequestWithBody generates requests for UpdateFunction with any type of body 1344 func NewUpdateFunctionRequestWithBody(server string, ref string, functionSlug string, params *UpdateFunctionParams, contentType string, body io.Reader) (*http.Request, error) { 1345 var err error 1346 1347 var pathParam0 string 1348 1349 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1350 if err != nil { 1351 return nil, err 1352 } 1353 1354 var pathParam1 string 1355 1356 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) 1357 if err != nil { 1358 return nil, err 1359 } 1360 1361 serverURL, err := url.Parse(server) 1362 if err != nil { 1363 return nil, err 1364 } 1365 1366 operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) 1367 if operationPath[0] == '/' { 1368 operationPath = "." + operationPath 1369 } 1370 1371 queryURL, err := serverURL.Parse(operationPath) 1372 if err != nil { 1373 return nil, err 1374 } 1375 1376 queryValues := queryURL.Query() 1377 1378 if params.Slug != nil { 1379 1380 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { 1381 return nil, err 1382 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1383 return nil, err 1384 } else { 1385 for k, v := range parsed { 1386 for _, v2 := range v { 1387 queryValues.Add(k, v2) 1388 } 1389 } 1390 } 1391 1392 } 1393 1394 if params.Name != nil { 1395 1396 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { 1397 return nil, err 1398 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1399 return nil, err 1400 } else { 1401 for k, v := range parsed { 1402 for _, v2 := range v { 1403 queryValues.Add(k, v2) 1404 } 1405 } 1406 } 1407 1408 } 1409 1410 if params.VerifyJwt != nil { 1411 1412 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verify_jwt", runtime.ParamLocationQuery, *params.VerifyJwt); err != nil { 1413 return nil, err 1414 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1415 return nil, err 1416 } else { 1417 for k, v := range parsed { 1418 for _, v2 := range v { 1419 queryValues.Add(k, v2) 1420 } 1421 } 1422 } 1423 1424 } 1425 1426 if params.ImportMap != nil { 1427 1428 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map", runtime.ParamLocationQuery, *params.ImportMap); err != nil { 1429 return nil, err 1430 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 1431 return nil, err 1432 } else { 1433 for k, v := range parsed { 1434 for _, v2 := range v { 1435 queryValues.Add(k, v2) 1436 } 1437 } 1438 } 1439 1440 } 1441 1442 queryURL.RawQuery = queryValues.Encode() 1443 1444 req, err := http.NewRequest("PATCH", queryURL.String(), body) 1445 if err != nil { 1446 return nil, err 1447 } 1448 1449 req.Header.Add("Content-Type", contentType) 1450 1451 return req, nil 1452 } 1453 1454 // NewGetFunctionBodyRequest generates requests for GetFunctionBody 1455 func NewGetFunctionBodyRequest(server string, ref string, functionSlug string) (*http.Request, error) { 1456 var err error 1457 1458 var pathParam0 string 1459 1460 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1461 if err != nil { 1462 return nil, err 1463 } 1464 1465 var pathParam1 string 1466 1467 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) 1468 if err != nil { 1469 return nil, err 1470 } 1471 1472 serverURL, err := url.Parse(server) 1473 if err != nil { 1474 return nil, err 1475 } 1476 1477 operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s/body", pathParam0, pathParam1) 1478 if operationPath[0] == '/' { 1479 operationPath = "." + operationPath 1480 } 1481 1482 queryURL, err := serverURL.Parse(operationPath) 1483 if err != nil { 1484 return nil, err 1485 } 1486 1487 req, err := http.NewRequest("GET", queryURL.String(), nil) 1488 if err != nil { 1489 return nil, err 1490 } 1491 1492 return req, nil 1493 } 1494 1495 // NewRemoveNetworkBanRequest calls the generic RemoveNetworkBan builder with application/json body 1496 func NewRemoveNetworkBanRequest(server string, ref string, body RemoveNetworkBanJSONRequestBody) (*http.Request, error) { 1497 var bodyReader io.Reader 1498 buf, err := json.Marshal(body) 1499 if err != nil { 1500 return nil, err 1501 } 1502 bodyReader = bytes.NewReader(buf) 1503 return NewRemoveNetworkBanRequestWithBody(server, ref, "application/json", bodyReader) 1504 } 1505 1506 // NewRemoveNetworkBanRequestWithBody generates requests for RemoveNetworkBan with any type of body 1507 func NewRemoveNetworkBanRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1508 var err error 1509 1510 var pathParam0 string 1511 1512 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1513 if err != nil { 1514 return nil, err 1515 } 1516 1517 serverURL, err := url.Parse(server) 1518 if err != nil { 1519 return nil, err 1520 } 1521 1522 operationPath := fmt.Sprintf("/v1/projects/%s/network-bans", pathParam0) 1523 if operationPath[0] == '/' { 1524 operationPath = "." + operationPath 1525 } 1526 1527 queryURL, err := serverURL.Parse(operationPath) 1528 if err != nil { 1529 return nil, err 1530 } 1531 1532 req, err := http.NewRequest("DELETE", queryURL.String(), body) 1533 if err != nil { 1534 return nil, err 1535 } 1536 1537 req.Header.Add("Content-Type", contentType) 1538 1539 return req, nil 1540 } 1541 1542 // NewGetNetworkBansRequest generates requests for GetNetworkBans 1543 func NewGetNetworkBansRequest(server string, ref string) (*http.Request, error) { 1544 var err error 1545 1546 var pathParam0 string 1547 1548 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1549 if err != nil { 1550 return nil, err 1551 } 1552 1553 serverURL, err := url.Parse(server) 1554 if err != nil { 1555 return nil, err 1556 } 1557 1558 operationPath := fmt.Sprintf("/v1/projects/%s/network-bans/retrieve", pathParam0) 1559 if operationPath[0] == '/' { 1560 operationPath = "." + operationPath 1561 } 1562 1563 queryURL, err := serverURL.Parse(operationPath) 1564 if err != nil { 1565 return nil, err 1566 } 1567 1568 req, err := http.NewRequest("POST", queryURL.String(), nil) 1569 if err != nil { 1570 return nil, err 1571 } 1572 1573 return req, nil 1574 } 1575 1576 // NewGetNetworkRestrictionsRequest generates requests for GetNetworkRestrictions 1577 func NewGetNetworkRestrictionsRequest(server string, ref string) (*http.Request, error) { 1578 var err error 1579 1580 var pathParam0 string 1581 1582 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1583 if err != nil { 1584 return nil, err 1585 } 1586 1587 serverURL, err := url.Parse(server) 1588 if err != nil { 1589 return nil, err 1590 } 1591 1592 operationPath := fmt.Sprintf("/v1/projects/%s/network-restrictions", pathParam0) 1593 if operationPath[0] == '/' { 1594 operationPath = "." + operationPath 1595 } 1596 1597 queryURL, err := serverURL.Parse(operationPath) 1598 if err != nil { 1599 return nil, err 1600 } 1601 1602 req, err := http.NewRequest("GET", queryURL.String(), nil) 1603 if err != nil { 1604 return nil, err 1605 } 1606 1607 return req, nil 1608 } 1609 1610 // NewApplyNetworkRestrictionsRequest calls the generic ApplyNetworkRestrictions builder with application/json body 1611 func NewApplyNetworkRestrictionsRequest(server string, ref string, body ApplyNetworkRestrictionsJSONRequestBody) (*http.Request, error) { 1612 var bodyReader io.Reader 1613 buf, err := json.Marshal(body) 1614 if err != nil { 1615 return nil, err 1616 } 1617 bodyReader = bytes.NewReader(buf) 1618 return NewApplyNetworkRestrictionsRequestWithBody(server, ref, "application/json", bodyReader) 1619 } 1620 1621 // NewApplyNetworkRestrictionsRequestWithBody generates requests for ApplyNetworkRestrictions with any type of body 1622 func NewApplyNetworkRestrictionsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1623 var err error 1624 1625 var pathParam0 string 1626 1627 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1628 if err != nil { 1629 return nil, err 1630 } 1631 1632 serverURL, err := url.Parse(server) 1633 if err != nil { 1634 return nil, err 1635 } 1636 1637 operationPath := fmt.Sprintf("/v1/projects/%s/network-restrictions/apply", pathParam0) 1638 if operationPath[0] == '/' { 1639 operationPath = "." + operationPath 1640 } 1641 1642 queryURL, err := serverURL.Parse(operationPath) 1643 if err != nil { 1644 return nil, err 1645 } 1646 1647 req, err := http.NewRequest("POST", queryURL.String(), body) 1648 if err != nil { 1649 return nil, err 1650 } 1651 1652 req.Header.Add("Content-Type", contentType) 1653 1654 return req, nil 1655 } 1656 1657 // NewGetConfigRequest generates requests for GetConfig 1658 func NewGetConfigRequest(server string, ref string) (*http.Request, error) { 1659 var err error 1660 1661 var pathParam0 string 1662 1663 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1664 if err != nil { 1665 return nil, err 1666 } 1667 1668 serverURL, err := url.Parse(server) 1669 if err != nil { 1670 return nil, err 1671 } 1672 1673 operationPath := fmt.Sprintf("/v1/projects/%s/pgsodium", pathParam0) 1674 if operationPath[0] == '/' { 1675 operationPath = "." + operationPath 1676 } 1677 1678 queryURL, err := serverURL.Parse(operationPath) 1679 if err != nil { 1680 return nil, err 1681 } 1682 1683 req, err := http.NewRequest("GET", queryURL.String(), nil) 1684 if err != nil { 1685 return nil, err 1686 } 1687 1688 return req, nil 1689 } 1690 1691 // NewUpdateConfigRequest calls the generic UpdateConfig builder with application/json body 1692 func NewUpdateConfigRequest(server string, ref string, body UpdateConfigJSONRequestBody) (*http.Request, error) { 1693 var bodyReader io.Reader 1694 buf, err := json.Marshal(body) 1695 if err != nil { 1696 return nil, err 1697 } 1698 bodyReader = bytes.NewReader(buf) 1699 return NewUpdateConfigRequestWithBody(server, ref, "application/json", bodyReader) 1700 } 1701 1702 // NewUpdateConfigRequestWithBody generates requests for UpdateConfig with any type of body 1703 func NewUpdateConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1704 var err error 1705 1706 var pathParam0 string 1707 1708 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1709 if err != nil { 1710 return nil, err 1711 } 1712 1713 serverURL, err := url.Parse(server) 1714 if err != nil { 1715 return nil, err 1716 } 1717 1718 operationPath := fmt.Sprintf("/v1/projects/%s/pgsodium", pathParam0) 1719 if operationPath[0] == '/' { 1720 operationPath = "." + operationPath 1721 } 1722 1723 queryURL, err := serverURL.Parse(operationPath) 1724 if err != nil { 1725 return nil, err 1726 } 1727 1728 req, err := http.NewRequest("PUT", queryURL.String(), body) 1729 if err != nil { 1730 return nil, err 1731 } 1732 1733 req.Header.Add("Content-Type", contentType) 1734 1735 return req, nil 1736 } 1737 1738 // NewGetPostgRESTConfigRequest generates requests for GetPostgRESTConfig 1739 func NewGetPostgRESTConfigRequest(server string, ref string) (*http.Request, error) { 1740 var err error 1741 1742 var pathParam0 string 1743 1744 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1745 if err != nil { 1746 return nil, err 1747 } 1748 1749 serverURL, err := url.Parse(server) 1750 if err != nil { 1751 return nil, err 1752 } 1753 1754 operationPath := fmt.Sprintf("/v1/projects/%s/postgrest", pathParam0) 1755 if operationPath[0] == '/' { 1756 operationPath = "." + operationPath 1757 } 1758 1759 queryURL, err := serverURL.Parse(operationPath) 1760 if err != nil { 1761 return nil, err 1762 } 1763 1764 req, err := http.NewRequest("GET", queryURL.String(), nil) 1765 if err != nil { 1766 return nil, err 1767 } 1768 1769 return req, nil 1770 } 1771 1772 // NewUpdatePostgRESTConfigRequest calls the generic UpdatePostgRESTConfig builder with application/json body 1773 func NewUpdatePostgRESTConfigRequest(server string, ref string, body UpdatePostgRESTConfigJSONRequestBody) (*http.Request, error) { 1774 var bodyReader io.Reader 1775 buf, err := json.Marshal(body) 1776 if err != nil { 1777 return nil, err 1778 } 1779 bodyReader = bytes.NewReader(buf) 1780 return NewUpdatePostgRESTConfigRequestWithBody(server, ref, "application/json", bodyReader) 1781 } 1782 1783 // NewUpdatePostgRESTConfigRequestWithBody generates requests for UpdatePostgRESTConfig with any type of body 1784 func NewUpdatePostgRESTConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1785 var err error 1786 1787 var pathParam0 string 1788 1789 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1790 if err != nil { 1791 return nil, err 1792 } 1793 1794 serverURL, err := url.Parse(server) 1795 if err != nil { 1796 return nil, err 1797 } 1798 1799 operationPath := fmt.Sprintf("/v1/projects/%s/postgrest", pathParam0) 1800 if operationPath[0] == '/' { 1801 operationPath = "." + operationPath 1802 } 1803 1804 queryURL, err := serverURL.Parse(operationPath) 1805 if err != nil { 1806 return nil, err 1807 } 1808 1809 req, err := http.NewRequest("PATCH", queryURL.String(), body) 1810 if err != nil { 1811 return nil, err 1812 } 1813 1814 req.Header.Add("Content-Type", contentType) 1815 1816 return req, nil 1817 } 1818 1819 // NewDeleteSecretsRequest calls the generic DeleteSecrets builder with application/json body 1820 func NewDeleteSecretsRequest(server string, ref string, body DeleteSecretsJSONRequestBody) (*http.Request, error) { 1821 var bodyReader io.Reader 1822 buf, err := json.Marshal(body) 1823 if err != nil { 1824 return nil, err 1825 } 1826 bodyReader = bytes.NewReader(buf) 1827 return NewDeleteSecretsRequestWithBody(server, ref, "application/json", bodyReader) 1828 } 1829 1830 // NewDeleteSecretsRequestWithBody generates requests for DeleteSecrets with any type of body 1831 func NewDeleteSecretsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1832 var err error 1833 1834 var pathParam0 string 1835 1836 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1837 if err != nil { 1838 return nil, err 1839 } 1840 1841 serverURL, err := url.Parse(server) 1842 if err != nil { 1843 return nil, err 1844 } 1845 1846 operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) 1847 if operationPath[0] == '/' { 1848 operationPath = "." + operationPath 1849 } 1850 1851 queryURL, err := serverURL.Parse(operationPath) 1852 if err != nil { 1853 return nil, err 1854 } 1855 1856 req, err := http.NewRequest("DELETE", queryURL.String(), body) 1857 if err != nil { 1858 return nil, err 1859 } 1860 1861 req.Header.Add("Content-Type", contentType) 1862 1863 return req, nil 1864 } 1865 1866 // NewGetSecretsRequest generates requests for GetSecrets 1867 func NewGetSecretsRequest(server string, ref string) (*http.Request, error) { 1868 var err error 1869 1870 var pathParam0 string 1871 1872 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1873 if err != nil { 1874 return nil, err 1875 } 1876 1877 serverURL, err := url.Parse(server) 1878 if err != nil { 1879 return nil, err 1880 } 1881 1882 operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) 1883 if operationPath[0] == '/' { 1884 operationPath = "." + operationPath 1885 } 1886 1887 queryURL, err := serverURL.Parse(operationPath) 1888 if err != nil { 1889 return nil, err 1890 } 1891 1892 req, err := http.NewRequest("GET", queryURL.String(), nil) 1893 if err != nil { 1894 return nil, err 1895 } 1896 1897 return req, nil 1898 } 1899 1900 // NewCreateSecretsRequest calls the generic CreateSecrets builder with application/json body 1901 func NewCreateSecretsRequest(server string, ref string, body CreateSecretsJSONRequestBody) (*http.Request, error) { 1902 var bodyReader io.Reader 1903 buf, err := json.Marshal(body) 1904 if err != nil { 1905 return nil, err 1906 } 1907 bodyReader = bytes.NewReader(buf) 1908 return NewCreateSecretsRequestWithBody(server, ref, "application/json", bodyReader) 1909 } 1910 1911 // NewCreateSecretsRequestWithBody generates requests for CreateSecrets with any type of body 1912 func NewCreateSecretsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1913 var err error 1914 1915 var pathParam0 string 1916 1917 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1918 if err != nil { 1919 return nil, err 1920 } 1921 1922 serverURL, err := url.Parse(server) 1923 if err != nil { 1924 return nil, err 1925 } 1926 1927 operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) 1928 if operationPath[0] == '/' { 1929 operationPath = "." + operationPath 1930 } 1931 1932 queryURL, err := serverURL.Parse(operationPath) 1933 if err != nil { 1934 return nil, err 1935 } 1936 1937 req, err := http.NewRequest("POST", queryURL.String(), body) 1938 if err != nil { 1939 return nil, err 1940 } 1941 1942 req.Header.Add("Content-Type", contentType) 1943 1944 return req, nil 1945 } 1946 1947 // NewGetSslEnforcementConfigRequest generates requests for GetSslEnforcementConfig 1948 func NewGetSslEnforcementConfigRequest(server string, ref string) (*http.Request, error) { 1949 var err error 1950 1951 var pathParam0 string 1952 1953 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1954 if err != nil { 1955 return nil, err 1956 } 1957 1958 serverURL, err := url.Parse(server) 1959 if err != nil { 1960 return nil, err 1961 } 1962 1963 operationPath := fmt.Sprintf("/v1/projects/%s/ssl-enforcement", pathParam0) 1964 if operationPath[0] == '/' { 1965 operationPath = "." + operationPath 1966 } 1967 1968 queryURL, err := serverURL.Parse(operationPath) 1969 if err != nil { 1970 return nil, err 1971 } 1972 1973 req, err := http.NewRequest("GET", queryURL.String(), nil) 1974 if err != nil { 1975 return nil, err 1976 } 1977 1978 return req, nil 1979 } 1980 1981 // NewUpdateSslEnforcementConfigRequest calls the generic UpdateSslEnforcementConfig builder with application/json body 1982 func NewUpdateSslEnforcementConfigRequest(server string, ref string, body UpdateSslEnforcementConfigJSONRequestBody) (*http.Request, error) { 1983 var bodyReader io.Reader 1984 buf, err := json.Marshal(body) 1985 if err != nil { 1986 return nil, err 1987 } 1988 bodyReader = bytes.NewReader(buf) 1989 return NewUpdateSslEnforcementConfigRequestWithBody(server, ref, "application/json", bodyReader) 1990 } 1991 1992 // NewUpdateSslEnforcementConfigRequestWithBody generates requests for UpdateSslEnforcementConfig with any type of body 1993 func NewUpdateSslEnforcementConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 1994 var err error 1995 1996 var pathParam0 string 1997 1998 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 1999 if err != nil { 2000 return nil, err 2001 } 2002 2003 serverURL, err := url.Parse(server) 2004 if err != nil { 2005 return nil, err 2006 } 2007 2008 operationPath := fmt.Sprintf("/v1/projects/%s/ssl-enforcement", pathParam0) 2009 if operationPath[0] == '/' { 2010 operationPath = "." + operationPath 2011 } 2012 2013 queryURL, err := serverURL.Parse(operationPath) 2014 if err != nil { 2015 return nil, err 2016 } 2017 2018 req, err := http.NewRequest("PUT", queryURL.String(), body) 2019 if err != nil { 2020 return nil, err 2021 } 2022 2023 req.Header.Add("Content-Type", contentType) 2024 2025 return req, nil 2026 } 2027 2028 // NewGetTypescriptTypesRequest generates requests for GetTypescriptTypes 2029 func NewGetTypescriptTypesRequest(server string, ref string, params *GetTypescriptTypesParams) (*http.Request, error) { 2030 var err error 2031 2032 var pathParam0 string 2033 2034 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 2035 if err != nil { 2036 return nil, err 2037 } 2038 2039 serverURL, err := url.Parse(server) 2040 if err != nil { 2041 return nil, err 2042 } 2043 2044 operationPath := fmt.Sprintf("/v1/projects/%s/types/typescript", pathParam0) 2045 if operationPath[0] == '/' { 2046 operationPath = "." + operationPath 2047 } 2048 2049 queryURL, err := serverURL.Parse(operationPath) 2050 if err != nil { 2051 return nil, err 2052 } 2053 2054 queryValues := queryURL.Query() 2055 2056 if params.IncludedSchemas != nil { 2057 2058 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "included_schemas", runtime.ParamLocationQuery, *params.IncludedSchemas); err != nil { 2059 return nil, err 2060 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 2061 return nil, err 2062 } else { 2063 for k, v := range parsed { 2064 for _, v2 := range v { 2065 queryValues.Add(k, v2) 2066 } 2067 } 2068 } 2069 2070 } 2071 2072 queryURL.RawQuery = queryValues.Encode() 2073 2074 req, err := http.NewRequest("GET", queryURL.String(), nil) 2075 if err != nil { 2076 return nil, err 2077 } 2078 2079 return req, nil 2080 } 2081 2082 // NewRemoveVanitySubdomainConfigRequest generates requests for RemoveVanitySubdomainConfig 2083 func NewRemoveVanitySubdomainConfigRequest(server string, ref string) (*http.Request, error) { 2084 var err error 2085 2086 var pathParam0 string 2087 2088 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 2089 if err != nil { 2090 return nil, err 2091 } 2092 2093 serverURL, err := url.Parse(server) 2094 if err != nil { 2095 return nil, err 2096 } 2097 2098 operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain", pathParam0) 2099 if operationPath[0] == '/' { 2100 operationPath = "." + operationPath 2101 } 2102 2103 queryURL, err := serverURL.Parse(operationPath) 2104 if err != nil { 2105 return nil, err 2106 } 2107 2108 req, err := http.NewRequest("DELETE", queryURL.String(), nil) 2109 if err != nil { 2110 return nil, err 2111 } 2112 2113 return req, nil 2114 } 2115 2116 // NewGetVanitySubdomainConfigRequest generates requests for GetVanitySubdomainConfig 2117 func NewGetVanitySubdomainConfigRequest(server string, ref string) (*http.Request, error) { 2118 var err error 2119 2120 var pathParam0 string 2121 2122 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 2123 if err != nil { 2124 return nil, err 2125 } 2126 2127 serverURL, err := url.Parse(server) 2128 if err != nil { 2129 return nil, err 2130 } 2131 2132 operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain", pathParam0) 2133 if operationPath[0] == '/' { 2134 operationPath = "." + operationPath 2135 } 2136 2137 queryURL, err := serverURL.Parse(operationPath) 2138 if err != nil { 2139 return nil, err 2140 } 2141 2142 req, err := http.NewRequest("GET", queryURL.String(), nil) 2143 if err != nil { 2144 return nil, err 2145 } 2146 2147 return req, nil 2148 } 2149 2150 // NewActivateVanitySubdomainPleaseRequest calls the generic ActivateVanitySubdomainPlease builder with application/json body 2151 func NewActivateVanitySubdomainPleaseRequest(server string, ref string, body ActivateVanitySubdomainPleaseJSONRequestBody) (*http.Request, error) { 2152 var bodyReader io.Reader 2153 buf, err := json.Marshal(body) 2154 if err != nil { 2155 return nil, err 2156 } 2157 bodyReader = bytes.NewReader(buf) 2158 return NewActivateVanitySubdomainPleaseRequestWithBody(server, ref, "application/json", bodyReader) 2159 } 2160 2161 // NewActivateVanitySubdomainPleaseRequestWithBody generates requests for ActivateVanitySubdomainPlease with any type of body 2162 func NewActivateVanitySubdomainPleaseRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 2163 var err error 2164 2165 var pathParam0 string 2166 2167 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 2168 if err != nil { 2169 return nil, err 2170 } 2171 2172 serverURL, err := url.Parse(server) 2173 if err != nil { 2174 return nil, err 2175 } 2176 2177 operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain/activate", pathParam0) 2178 if operationPath[0] == '/' { 2179 operationPath = "." + operationPath 2180 } 2181 2182 queryURL, err := serverURL.Parse(operationPath) 2183 if err != nil { 2184 return nil, err 2185 } 2186 2187 req, err := http.NewRequest("POST", queryURL.String(), body) 2188 if err != nil { 2189 return nil, err 2190 } 2191 2192 req.Header.Add("Content-Type", contentType) 2193 2194 return req, nil 2195 } 2196 2197 // NewCheckVanitySubdomainAvailabilityRequest calls the generic CheckVanitySubdomainAvailability builder with application/json body 2198 func NewCheckVanitySubdomainAvailabilityRequest(server string, ref string, body CheckVanitySubdomainAvailabilityJSONRequestBody) (*http.Request, error) { 2199 var bodyReader io.Reader 2200 buf, err := json.Marshal(body) 2201 if err != nil { 2202 return nil, err 2203 } 2204 bodyReader = bytes.NewReader(buf) 2205 return NewCheckVanitySubdomainAvailabilityRequestWithBody(server, ref, "application/json", bodyReader) 2206 } 2207 2208 // NewCheckVanitySubdomainAvailabilityRequestWithBody generates requests for CheckVanitySubdomainAvailability with any type of body 2209 func NewCheckVanitySubdomainAvailabilityRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { 2210 var err error 2211 2212 var pathParam0 string 2213 2214 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) 2215 if err != nil { 2216 return nil, err 2217 } 2218 2219 serverURL, err := url.Parse(server) 2220 if err != nil { 2221 return nil, err 2222 } 2223 2224 operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain/check-availability", pathParam0) 2225 if operationPath[0] == '/' { 2226 operationPath = "." + operationPath 2227 } 2228 2229 queryURL, err := serverURL.Parse(operationPath) 2230 if err != nil { 2231 return nil, err 2232 } 2233 2234 req, err := http.NewRequest("POST", queryURL.String(), body) 2235 if err != nil { 2236 return nil, err 2237 } 2238 2239 req.Header.Add("Content-Type", contentType) 2240 2241 return req, nil 2242 } 2243 2244 func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { 2245 for _, r := range c.RequestEditors { 2246 if err := r(ctx, req); err != nil { 2247 return err 2248 } 2249 } 2250 for _, r := range additionalEditors { 2251 if err := r(ctx, req); err != nil { 2252 return err 2253 } 2254 } 2255 return nil 2256 } 2257 2258 // ClientWithResponses builds on ClientInterface to offer response payloads 2259 type ClientWithResponses struct { 2260 ClientInterface 2261 } 2262 2263 // NewClientWithResponses creates a new ClientWithResponses, which wraps 2264 // Client with return type handling 2265 func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { 2266 client, err := NewClient(server, opts...) 2267 if err != nil { 2268 return nil, err 2269 } 2270 return &ClientWithResponses{client}, nil 2271 } 2272 2273 // WithBaseURL overrides the baseURL. 2274 func WithBaseURL(baseURL string) ClientOption { 2275 return func(c *Client) error { 2276 newBaseURL, err := url.Parse(baseURL) 2277 if err != nil { 2278 return err 2279 } 2280 c.Server = newBaseURL.String() 2281 return nil 2282 } 2283 } 2284 2285 // ClientWithResponsesInterface is the interface specification for the client with responses above. 2286 type ClientWithResponsesInterface interface { 2287 // GetOrganizations request 2288 GetOrganizationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOrganizationsResponse, error) 2289 2290 // CreateOrganization request with any body 2291 CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) 2292 2293 CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) 2294 2295 // GetProjects request 2296 GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) 2297 2298 // CreateProject request with any body 2299 CreateProjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) 2300 2301 CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) 2302 2303 // RemoveCustomHostnameConfig request 2304 RemoveCustomHostnameConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveCustomHostnameConfigResponse, error) 2305 2306 // GetCustomHostnameConfig request 2307 GetCustomHostnameConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetCustomHostnameConfigResponse, error) 2308 2309 // Activate request 2310 ActivateWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ActivateResponse, error) 2311 2312 // CreateCustomHostnameConfig request with any body 2313 CreateCustomHostnameConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCustomHostnameConfigResponse, error) 2314 2315 CreateCustomHostnameConfigWithResponse(ctx context.Context, ref string, body CreateCustomHostnameConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCustomHostnameConfigResponse, error) 2316 2317 // Reverify request 2318 ReverifyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ReverifyResponse, error) 2319 2320 // GetFunctions request 2321 GetFunctionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetFunctionsResponse, error) 2322 2323 // CreateFunction request with any body 2324 CreateFunctionWithBodyWithResponse(ctx context.Context, ref string, params *CreateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFunctionResponse, error) 2325 2326 CreateFunctionWithResponse(ctx context.Context, ref string, params *CreateFunctionParams, body CreateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFunctionResponse, error) 2327 2328 // DeleteFunction request 2329 DeleteFunctionWithResponse(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*DeleteFunctionResponse, error) 2330 2331 // GetFunction request 2332 GetFunctionWithResponse(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*GetFunctionResponse, error) 2333 2334 // UpdateFunction request with any body 2335 UpdateFunctionWithBodyWithResponse(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFunctionResponse, error) 2336 2337 UpdateFunctionWithResponse(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, body UpdateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFunctionResponse, error) 2338 2339 // GetFunctionBody request 2340 GetFunctionBodyWithResponse(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*GetFunctionBodyResponse, error) 2341 2342 // RemoveNetworkBan request with any body 2343 RemoveNetworkBanWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RemoveNetworkBanResponse, error) 2344 2345 RemoveNetworkBanWithResponse(ctx context.Context, ref string, body RemoveNetworkBanJSONRequestBody, reqEditors ...RequestEditorFn) (*RemoveNetworkBanResponse, error) 2346 2347 // GetNetworkBans request 2348 GetNetworkBansWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetNetworkBansResponse, error) 2349 2350 // GetNetworkRestrictions request 2351 GetNetworkRestrictionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetNetworkRestrictionsResponse, error) 2352 2353 // ApplyNetworkRestrictions request with any body 2354 ApplyNetworkRestrictionsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyNetworkRestrictionsResponse, error) 2355 2356 ApplyNetworkRestrictionsWithResponse(ctx context.Context, ref string, body ApplyNetworkRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyNetworkRestrictionsResponse, error) 2357 2358 // GetConfig request 2359 GetConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) 2360 2361 // UpdateConfig request with any body 2362 UpdateConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateConfigResponse, error) 2363 2364 UpdateConfigWithResponse(ctx context.Context, ref string, body UpdateConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateConfigResponse, error) 2365 2366 // GetPostgRESTConfig request 2367 GetPostgRESTConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPostgRESTConfigResponse, error) 2368 2369 // UpdatePostgRESTConfig request with any body 2370 UpdatePostgRESTConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePostgRESTConfigResponse, error) 2371 2372 UpdatePostgRESTConfigWithResponse(ctx context.Context, ref string, body UpdatePostgRESTConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePostgRESTConfigResponse, error) 2373 2374 // DeleteSecrets request with any body 2375 DeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecretsResponse, error) 2376 2377 DeleteSecretsWithResponse(ctx context.Context, ref string, body DeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteSecretsResponse, error) 2378 2379 // GetSecrets request 2380 GetSecretsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSecretsResponse, error) 2381 2382 // CreateSecrets request with any body 2383 CreateSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretsResponse, error) 2384 2385 CreateSecretsWithResponse(ctx context.Context, ref string, body CreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretsResponse, error) 2386 2387 // GetSslEnforcementConfig request 2388 GetSslEnforcementConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSslEnforcementConfigResponse, error) 2389 2390 // UpdateSslEnforcementConfig request with any body 2391 UpdateSslEnforcementConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSslEnforcementConfigResponse, error) 2392 2393 UpdateSslEnforcementConfigWithResponse(ctx context.Context, ref string, body UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSslEnforcementConfigResponse, error) 2394 2395 // GetTypescriptTypes request 2396 GetTypescriptTypesWithResponse(ctx context.Context, ref string, params *GetTypescriptTypesParams, reqEditors ...RequestEditorFn) (*GetTypescriptTypesResponse, error) 2397 2398 // RemoveVanitySubdomainConfig request 2399 RemoveVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveVanitySubdomainConfigResponse, error) 2400 2401 // GetVanitySubdomainConfig request 2402 GetVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetVanitySubdomainConfigResponse, error) 2403 2404 // ActivateVanitySubdomainPlease request with any body 2405 ActivateVanitySubdomainPleaseWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivateVanitySubdomainPleaseResponse, error) 2406 2407 ActivateVanitySubdomainPleaseWithResponse(ctx context.Context, ref string, body ActivateVanitySubdomainPleaseJSONRequestBody, reqEditors ...RequestEditorFn) (*ActivateVanitySubdomainPleaseResponse, error) 2408 2409 // CheckVanitySubdomainAvailability request with any body 2410 CheckVanitySubdomainAvailabilityWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CheckVanitySubdomainAvailabilityResponse, error) 2411 2412 CheckVanitySubdomainAvailabilityWithResponse(ctx context.Context, ref string, body CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*CheckVanitySubdomainAvailabilityResponse, error) 2413 } 2414 2415 type GetOrganizationsResponse struct { 2416 Body []byte 2417 HTTPResponse *http.Response 2418 JSON200 *[]OrganizationResponse 2419 } 2420 2421 // Status returns HTTPResponse.Status 2422 func (r GetOrganizationsResponse) Status() string { 2423 if r.HTTPResponse != nil { 2424 return r.HTTPResponse.Status 2425 } 2426 return http.StatusText(0) 2427 } 2428 2429 // StatusCode returns HTTPResponse.StatusCode 2430 func (r GetOrganizationsResponse) StatusCode() int { 2431 if r.HTTPResponse != nil { 2432 return r.HTTPResponse.StatusCode 2433 } 2434 return 0 2435 } 2436 2437 type CreateOrganizationResponse struct { 2438 Body []byte 2439 HTTPResponse *http.Response 2440 JSON201 *OrganizationResponse 2441 } 2442 2443 // Status returns HTTPResponse.Status 2444 func (r CreateOrganizationResponse) Status() string { 2445 if r.HTTPResponse != nil { 2446 return r.HTTPResponse.Status 2447 } 2448 return http.StatusText(0) 2449 } 2450 2451 // StatusCode returns HTTPResponse.StatusCode 2452 func (r CreateOrganizationResponse) StatusCode() int { 2453 if r.HTTPResponse != nil { 2454 return r.HTTPResponse.StatusCode 2455 } 2456 return 0 2457 } 2458 2459 type GetProjectsResponse struct { 2460 Body []byte 2461 HTTPResponse *http.Response 2462 JSON200 *[]ProjectResponse 2463 } 2464 2465 // Status returns HTTPResponse.Status 2466 func (r GetProjectsResponse) Status() string { 2467 if r.HTTPResponse != nil { 2468 return r.HTTPResponse.Status 2469 } 2470 return http.StatusText(0) 2471 } 2472 2473 // StatusCode returns HTTPResponse.StatusCode 2474 func (r GetProjectsResponse) StatusCode() int { 2475 if r.HTTPResponse != nil { 2476 return r.HTTPResponse.StatusCode 2477 } 2478 return 0 2479 } 2480 2481 type CreateProjectResponse struct { 2482 Body []byte 2483 HTTPResponse *http.Response 2484 JSON201 *ProjectResponse 2485 } 2486 2487 // Status returns HTTPResponse.Status 2488 func (r CreateProjectResponse) Status() string { 2489 if r.HTTPResponse != nil { 2490 return r.HTTPResponse.Status 2491 } 2492 return http.StatusText(0) 2493 } 2494 2495 // StatusCode returns HTTPResponse.StatusCode 2496 func (r CreateProjectResponse) StatusCode() int { 2497 if r.HTTPResponse != nil { 2498 return r.HTTPResponse.StatusCode 2499 } 2500 return 0 2501 } 2502 2503 type RemoveCustomHostnameConfigResponse struct { 2504 Body []byte 2505 HTTPResponse *http.Response 2506 } 2507 2508 // Status returns HTTPResponse.Status 2509 func (r RemoveCustomHostnameConfigResponse) Status() string { 2510 if r.HTTPResponse != nil { 2511 return r.HTTPResponse.Status 2512 } 2513 return http.StatusText(0) 2514 } 2515 2516 // StatusCode returns HTTPResponse.StatusCode 2517 func (r RemoveCustomHostnameConfigResponse) StatusCode() int { 2518 if r.HTTPResponse != nil { 2519 return r.HTTPResponse.StatusCode 2520 } 2521 return 0 2522 } 2523 2524 type GetCustomHostnameConfigResponse struct { 2525 Body []byte 2526 HTTPResponse *http.Response 2527 JSON200 *UpdateCustomHostnameResponse 2528 } 2529 2530 // Status returns HTTPResponse.Status 2531 func (r GetCustomHostnameConfigResponse) Status() string { 2532 if r.HTTPResponse != nil { 2533 return r.HTTPResponse.Status 2534 } 2535 return http.StatusText(0) 2536 } 2537 2538 // StatusCode returns HTTPResponse.StatusCode 2539 func (r GetCustomHostnameConfigResponse) StatusCode() int { 2540 if r.HTTPResponse != nil { 2541 return r.HTTPResponse.StatusCode 2542 } 2543 return 0 2544 } 2545 2546 type ActivateResponse struct { 2547 Body []byte 2548 HTTPResponse *http.Response 2549 JSON201 *UpdateCustomHostnameResponse 2550 } 2551 2552 // Status returns HTTPResponse.Status 2553 func (r ActivateResponse) Status() string { 2554 if r.HTTPResponse != nil { 2555 return r.HTTPResponse.Status 2556 } 2557 return http.StatusText(0) 2558 } 2559 2560 // StatusCode returns HTTPResponse.StatusCode 2561 func (r ActivateResponse) StatusCode() int { 2562 if r.HTTPResponse != nil { 2563 return r.HTTPResponse.StatusCode 2564 } 2565 return 0 2566 } 2567 2568 type CreateCustomHostnameConfigResponse struct { 2569 Body []byte 2570 HTTPResponse *http.Response 2571 JSON201 *UpdateCustomHostnameResponse 2572 } 2573 2574 // Status returns HTTPResponse.Status 2575 func (r CreateCustomHostnameConfigResponse) Status() string { 2576 if r.HTTPResponse != nil { 2577 return r.HTTPResponse.Status 2578 } 2579 return http.StatusText(0) 2580 } 2581 2582 // StatusCode returns HTTPResponse.StatusCode 2583 func (r CreateCustomHostnameConfigResponse) StatusCode() int { 2584 if r.HTTPResponse != nil { 2585 return r.HTTPResponse.StatusCode 2586 } 2587 return 0 2588 } 2589 2590 type ReverifyResponse struct { 2591 Body []byte 2592 HTTPResponse *http.Response 2593 JSON201 *UpdateCustomHostnameResponse 2594 } 2595 2596 // Status returns HTTPResponse.Status 2597 func (r ReverifyResponse) Status() string { 2598 if r.HTTPResponse != nil { 2599 return r.HTTPResponse.Status 2600 } 2601 return http.StatusText(0) 2602 } 2603 2604 // StatusCode returns HTTPResponse.StatusCode 2605 func (r ReverifyResponse) StatusCode() int { 2606 if r.HTTPResponse != nil { 2607 return r.HTTPResponse.StatusCode 2608 } 2609 return 0 2610 } 2611 2612 type GetFunctionsResponse struct { 2613 Body []byte 2614 HTTPResponse *http.Response 2615 JSON200 *[]FunctionResponse 2616 } 2617 2618 // Status returns HTTPResponse.Status 2619 func (r GetFunctionsResponse) Status() string { 2620 if r.HTTPResponse != nil { 2621 return r.HTTPResponse.Status 2622 } 2623 return http.StatusText(0) 2624 } 2625 2626 // StatusCode returns HTTPResponse.StatusCode 2627 func (r GetFunctionsResponse) StatusCode() int { 2628 if r.HTTPResponse != nil { 2629 return r.HTTPResponse.StatusCode 2630 } 2631 return 0 2632 } 2633 2634 type CreateFunctionResponse struct { 2635 Body []byte 2636 HTTPResponse *http.Response 2637 JSON201 *FunctionResponse 2638 } 2639 2640 // Status returns HTTPResponse.Status 2641 func (r CreateFunctionResponse) Status() string { 2642 if r.HTTPResponse != nil { 2643 return r.HTTPResponse.Status 2644 } 2645 return http.StatusText(0) 2646 } 2647 2648 // StatusCode returns HTTPResponse.StatusCode 2649 func (r CreateFunctionResponse) StatusCode() int { 2650 if r.HTTPResponse != nil { 2651 return r.HTTPResponse.StatusCode 2652 } 2653 return 0 2654 } 2655 2656 type DeleteFunctionResponse struct { 2657 Body []byte 2658 HTTPResponse *http.Response 2659 } 2660 2661 // Status returns HTTPResponse.Status 2662 func (r DeleteFunctionResponse) Status() string { 2663 if r.HTTPResponse != nil { 2664 return r.HTTPResponse.Status 2665 } 2666 return http.StatusText(0) 2667 } 2668 2669 // StatusCode returns HTTPResponse.StatusCode 2670 func (r DeleteFunctionResponse) StatusCode() int { 2671 if r.HTTPResponse != nil { 2672 return r.HTTPResponse.StatusCode 2673 } 2674 return 0 2675 } 2676 2677 type GetFunctionResponse struct { 2678 Body []byte 2679 HTTPResponse *http.Response 2680 JSON200 *FunctionSlugResponse 2681 } 2682 2683 // Status returns HTTPResponse.Status 2684 func (r GetFunctionResponse) Status() string { 2685 if r.HTTPResponse != nil { 2686 return r.HTTPResponse.Status 2687 } 2688 return http.StatusText(0) 2689 } 2690 2691 // StatusCode returns HTTPResponse.StatusCode 2692 func (r GetFunctionResponse) StatusCode() int { 2693 if r.HTTPResponse != nil { 2694 return r.HTTPResponse.StatusCode 2695 } 2696 return 0 2697 } 2698 2699 type UpdateFunctionResponse struct { 2700 Body []byte 2701 HTTPResponse *http.Response 2702 JSON200 *FunctionResponse 2703 } 2704 2705 // Status returns HTTPResponse.Status 2706 func (r UpdateFunctionResponse) Status() string { 2707 if r.HTTPResponse != nil { 2708 return r.HTTPResponse.Status 2709 } 2710 return http.StatusText(0) 2711 } 2712 2713 // StatusCode returns HTTPResponse.StatusCode 2714 func (r UpdateFunctionResponse) StatusCode() int { 2715 if r.HTTPResponse != nil { 2716 return r.HTTPResponse.StatusCode 2717 } 2718 return 0 2719 } 2720 2721 type GetFunctionBodyResponse struct { 2722 Body []byte 2723 HTTPResponse *http.Response 2724 } 2725 2726 // Status returns HTTPResponse.Status 2727 func (r GetFunctionBodyResponse) Status() string { 2728 if r.HTTPResponse != nil { 2729 return r.HTTPResponse.Status 2730 } 2731 return http.StatusText(0) 2732 } 2733 2734 // StatusCode returns HTTPResponse.StatusCode 2735 func (r GetFunctionBodyResponse) StatusCode() int { 2736 if r.HTTPResponse != nil { 2737 return r.HTTPResponse.StatusCode 2738 } 2739 return 0 2740 } 2741 2742 type RemoveNetworkBanResponse struct { 2743 Body []byte 2744 HTTPResponse *http.Response 2745 } 2746 2747 // Status returns HTTPResponse.Status 2748 func (r RemoveNetworkBanResponse) Status() string { 2749 if r.HTTPResponse != nil { 2750 return r.HTTPResponse.Status 2751 } 2752 return http.StatusText(0) 2753 } 2754 2755 // StatusCode returns HTTPResponse.StatusCode 2756 func (r RemoveNetworkBanResponse) StatusCode() int { 2757 if r.HTTPResponse != nil { 2758 return r.HTTPResponse.StatusCode 2759 } 2760 return 0 2761 } 2762 2763 type GetNetworkBansResponse struct { 2764 Body []byte 2765 HTTPResponse *http.Response 2766 JSON201 *NetworkBanResponse 2767 } 2768 2769 // Status returns HTTPResponse.Status 2770 func (r GetNetworkBansResponse) Status() string { 2771 if r.HTTPResponse != nil { 2772 return r.HTTPResponse.Status 2773 } 2774 return http.StatusText(0) 2775 } 2776 2777 // StatusCode returns HTTPResponse.StatusCode 2778 func (r GetNetworkBansResponse) StatusCode() int { 2779 if r.HTTPResponse != nil { 2780 return r.HTTPResponse.StatusCode 2781 } 2782 return 0 2783 } 2784 2785 type GetNetworkRestrictionsResponse struct { 2786 Body []byte 2787 HTTPResponse *http.Response 2788 JSON200 *NetworkRestrictionsResponse 2789 } 2790 2791 // Status returns HTTPResponse.Status 2792 func (r GetNetworkRestrictionsResponse) Status() string { 2793 if r.HTTPResponse != nil { 2794 return r.HTTPResponse.Status 2795 } 2796 return http.StatusText(0) 2797 } 2798 2799 // StatusCode returns HTTPResponse.StatusCode 2800 func (r GetNetworkRestrictionsResponse) StatusCode() int { 2801 if r.HTTPResponse != nil { 2802 return r.HTTPResponse.StatusCode 2803 } 2804 return 0 2805 } 2806 2807 type ApplyNetworkRestrictionsResponse struct { 2808 Body []byte 2809 HTTPResponse *http.Response 2810 JSON201 *NetworkRestrictionsResponse 2811 } 2812 2813 // Status returns HTTPResponse.Status 2814 func (r ApplyNetworkRestrictionsResponse) Status() string { 2815 if r.HTTPResponse != nil { 2816 return r.HTTPResponse.Status 2817 } 2818 return http.StatusText(0) 2819 } 2820 2821 // StatusCode returns HTTPResponse.StatusCode 2822 func (r ApplyNetworkRestrictionsResponse) StatusCode() int { 2823 if r.HTTPResponse != nil { 2824 return r.HTTPResponse.StatusCode 2825 } 2826 return 0 2827 } 2828 2829 type GetConfigResponse struct { 2830 Body []byte 2831 HTTPResponse *http.Response 2832 JSON200 *PgsodiumConfigResponse 2833 } 2834 2835 // Status returns HTTPResponse.Status 2836 func (r GetConfigResponse) Status() string { 2837 if r.HTTPResponse != nil { 2838 return r.HTTPResponse.Status 2839 } 2840 return http.StatusText(0) 2841 } 2842 2843 // StatusCode returns HTTPResponse.StatusCode 2844 func (r GetConfigResponse) StatusCode() int { 2845 if r.HTTPResponse != nil { 2846 return r.HTTPResponse.StatusCode 2847 } 2848 return 0 2849 } 2850 2851 type UpdateConfigResponse struct { 2852 Body []byte 2853 HTTPResponse *http.Response 2854 JSON200 *PgsodiumConfigResponse 2855 } 2856 2857 // Status returns HTTPResponse.Status 2858 func (r UpdateConfigResponse) Status() string { 2859 if r.HTTPResponse != nil { 2860 return r.HTTPResponse.Status 2861 } 2862 return http.StatusText(0) 2863 } 2864 2865 // StatusCode returns HTTPResponse.StatusCode 2866 func (r UpdateConfigResponse) StatusCode() int { 2867 if r.HTTPResponse != nil { 2868 return r.HTTPResponse.StatusCode 2869 } 2870 return 0 2871 } 2872 2873 type GetPostgRESTConfigResponse struct { 2874 Body []byte 2875 HTTPResponse *http.Response 2876 JSON200 *PostgrestConfigResponse 2877 } 2878 2879 // Status returns HTTPResponse.Status 2880 func (r GetPostgRESTConfigResponse) Status() string { 2881 if r.HTTPResponse != nil { 2882 return r.HTTPResponse.Status 2883 } 2884 return http.StatusText(0) 2885 } 2886 2887 // StatusCode returns HTTPResponse.StatusCode 2888 func (r GetPostgRESTConfigResponse) StatusCode() int { 2889 if r.HTTPResponse != nil { 2890 return r.HTTPResponse.StatusCode 2891 } 2892 return 0 2893 } 2894 2895 type UpdatePostgRESTConfigResponse struct { 2896 Body []byte 2897 HTTPResponse *http.Response 2898 JSON200 *PostgrestConfigResponse 2899 } 2900 2901 // Status returns HTTPResponse.Status 2902 func (r UpdatePostgRESTConfigResponse) Status() string { 2903 if r.HTTPResponse != nil { 2904 return r.HTTPResponse.Status 2905 } 2906 return http.StatusText(0) 2907 } 2908 2909 // StatusCode returns HTTPResponse.StatusCode 2910 func (r UpdatePostgRESTConfigResponse) StatusCode() int { 2911 if r.HTTPResponse != nil { 2912 return r.HTTPResponse.StatusCode 2913 } 2914 return 0 2915 } 2916 2917 type DeleteSecretsResponse struct { 2918 Body []byte 2919 HTTPResponse *http.Response 2920 JSON200 *map[string]interface{} 2921 } 2922 2923 // Status returns HTTPResponse.Status 2924 func (r DeleteSecretsResponse) Status() string { 2925 if r.HTTPResponse != nil { 2926 return r.HTTPResponse.Status 2927 } 2928 return http.StatusText(0) 2929 } 2930 2931 // StatusCode returns HTTPResponse.StatusCode 2932 func (r DeleteSecretsResponse) StatusCode() int { 2933 if r.HTTPResponse != nil { 2934 return r.HTTPResponse.StatusCode 2935 } 2936 return 0 2937 } 2938 2939 type GetSecretsResponse struct { 2940 Body []byte 2941 HTTPResponse *http.Response 2942 JSON200 *[]SecretResponse 2943 } 2944 2945 // Status returns HTTPResponse.Status 2946 func (r GetSecretsResponse) Status() string { 2947 if r.HTTPResponse != nil { 2948 return r.HTTPResponse.Status 2949 } 2950 return http.StatusText(0) 2951 } 2952 2953 // StatusCode returns HTTPResponse.StatusCode 2954 func (r GetSecretsResponse) StatusCode() int { 2955 if r.HTTPResponse != nil { 2956 return r.HTTPResponse.StatusCode 2957 } 2958 return 0 2959 } 2960 2961 type CreateSecretsResponse struct { 2962 Body []byte 2963 HTTPResponse *http.Response 2964 } 2965 2966 // Status returns HTTPResponse.Status 2967 func (r CreateSecretsResponse) Status() string { 2968 if r.HTTPResponse != nil { 2969 return r.HTTPResponse.Status 2970 } 2971 return http.StatusText(0) 2972 } 2973 2974 // StatusCode returns HTTPResponse.StatusCode 2975 func (r CreateSecretsResponse) StatusCode() int { 2976 if r.HTTPResponse != nil { 2977 return r.HTTPResponse.StatusCode 2978 } 2979 return 0 2980 } 2981 2982 type GetSslEnforcementConfigResponse struct { 2983 Body []byte 2984 HTTPResponse *http.Response 2985 JSON200 *SslEnforcementResponse 2986 } 2987 2988 // Status returns HTTPResponse.Status 2989 func (r GetSslEnforcementConfigResponse) Status() string { 2990 if r.HTTPResponse != nil { 2991 return r.HTTPResponse.Status 2992 } 2993 return http.StatusText(0) 2994 } 2995 2996 // StatusCode returns HTTPResponse.StatusCode 2997 func (r GetSslEnforcementConfigResponse) StatusCode() int { 2998 if r.HTTPResponse != nil { 2999 return r.HTTPResponse.StatusCode 3000 } 3001 return 0 3002 } 3003 3004 type UpdateSslEnforcementConfigResponse struct { 3005 Body []byte 3006 HTTPResponse *http.Response 3007 JSON200 *SslEnforcementResponse 3008 } 3009 3010 // Status returns HTTPResponse.Status 3011 func (r UpdateSslEnforcementConfigResponse) Status() string { 3012 if r.HTTPResponse != nil { 3013 return r.HTTPResponse.Status 3014 } 3015 return http.StatusText(0) 3016 } 3017 3018 // StatusCode returns HTTPResponse.StatusCode 3019 func (r UpdateSslEnforcementConfigResponse) StatusCode() int { 3020 if r.HTTPResponse != nil { 3021 return r.HTTPResponse.StatusCode 3022 } 3023 return 0 3024 } 3025 3026 type GetTypescriptTypesResponse struct { 3027 Body []byte 3028 HTTPResponse *http.Response 3029 JSON200 *TypescriptResponse 3030 } 3031 3032 // Status returns HTTPResponse.Status 3033 func (r GetTypescriptTypesResponse) Status() string { 3034 if r.HTTPResponse != nil { 3035 return r.HTTPResponse.Status 3036 } 3037 return http.StatusText(0) 3038 } 3039 3040 // StatusCode returns HTTPResponse.StatusCode 3041 func (r GetTypescriptTypesResponse) StatusCode() int { 3042 if r.HTTPResponse != nil { 3043 return r.HTTPResponse.StatusCode 3044 } 3045 return 0 3046 } 3047 3048 type RemoveVanitySubdomainConfigResponse struct { 3049 Body []byte 3050 HTTPResponse *http.Response 3051 } 3052 3053 // Status returns HTTPResponse.Status 3054 func (r RemoveVanitySubdomainConfigResponse) Status() string { 3055 if r.HTTPResponse != nil { 3056 return r.HTTPResponse.Status 3057 } 3058 return http.StatusText(0) 3059 } 3060 3061 // StatusCode returns HTTPResponse.StatusCode 3062 func (r RemoveVanitySubdomainConfigResponse) StatusCode() int { 3063 if r.HTTPResponse != nil { 3064 return r.HTTPResponse.StatusCode 3065 } 3066 return 0 3067 } 3068 3069 type GetVanitySubdomainConfigResponse struct { 3070 Body []byte 3071 HTTPResponse *http.Response 3072 JSON200 *VanitySubdomainConfigResponse 3073 } 3074 3075 // Status returns HTTPResponse.Status 3076 func (r GetVanitySubdomainConfigResponse) Status() string { 3077 if r.HTTPResponse != nil { 3078 return r.HTTPResponse.Status 3079 } 3080 return http.StatusText(0) 3081 } 3082 3083 // StatusCode returns HTTPResponse.StatusCode 3084 func (r GetVanitySubdomainConfigResponse) StatusCode() int { 3085 if r.HTTPResponse != nil { 3086 return r.HTTPResponse.StatusCode 3087 } 3088 return 0 3089 } 3090 3091 type ActivateVanitySubdomainPleaseResponse struct { 3092 Body []byte 3093 HTTPResponse *http.Response 3094 JSON201 *ActivateVanitySubdomainResponse 3095 } 3096 3097 // Status returns HTTPResponse.Status 3098 func (r ActivateVanitySubdomainPleaseResponse) Status() string { 3099 if r.HTTPResponse != nil { 3100 return r.HTTPResponse.Status 3101 } 3102 return http.StatusText(0) 3103 } 3104 3105 // StatusCode returns HTTPResponse.StatusCode 3106 func (r ActivateVanitySubdomainPleaseResponse) StatusCode() int { 3107 if r.HTTPResponse != nil { 3108 return r.HTTPResponse.StatusCode 3109 } 3110 return 0 3111 } 3112 3113 type CheckVanitySubdomainAvailabilityResponse struct { 3114 Body []byte 3115 HTTPResponse *http.Response 3116 JSON201 *SubdomainAvailabilityResponse 3117 } 3118 3119 // Status returns HTTPResponse.Status 3120 func (r CheckVanitySubdomainAvailabilityResponse) Status() string { 3121 if r.HTTPResponse != nil { 3122 return r.HTTPResponse.Status 3123 } 3124 return http.StatusText(0) 3125 } 3126 3127 // StatusCode returns HTTPResponse.StatusCode 3128 func (r CheckVanitySubdomainAvailabilityResponse) StatusCode() int { 3129 if r.HTTPResponse != nil { 3130 return r.HTTPResponse.StatusCode 3131 } 3132 return 0 3133 } 3134 3135 // GetOrganizationsWithResponse request returning *GetOrganizationsResponse 3136 func (c *ClientWithResponses) GetOrganizationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOrganizationsResponse, error) { 3137 rsp, err := c.GetOrganizations(ctx, reqEditors...) 3138 if err != nil { 3139 return nil, err 3140 } 3141 return ParseGetOrganizationsResponse(rsp) 3142 } 3143 3144 // CreateOrganizationWithBodyWithResponse request with arbitrary body returning *CreateOrganizationResponse 3145 func (c *ClientWithResponses) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { 3146 rsp, err := c.CreateOrganizationWithBody(ctx, contentType, body, reqEditors...) 3147 if err != nil { 3148 return nil, err 3149 } 3150 return ParseCreateOrganizationResponse(rsp) 3151 } 3152 3153 func (c *ClientWithResponses) CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { 3154 rsp, err := c.CreateOrganization(ctx, body, reqEditors...) 3155 if err != nil { 3156 return nil, err 3157 } 3158 return ParseCreateOrganizationResponse(rsp) 3159 } 3160 3161 // GetProjectsWithResponse request returning *GetProjectsResponse 3162 func (c *ClientWithResponses) GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) { 3163 rsp, err := c.GetProjects(ctx, reqEditors...) 3164 if err != nil { 3165 return nil, err 3166 } 3167 return ParseGetProjectsResponse(rsp) 3168 } 3169 3170 // CreateProjectWithBodyWithResponse request with arbitrary body returning *CreateProjectResponse 3171 func (c *ClientWithResponses) CreateProjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { 3172 rsp, err := c.CreateProjectWithBody(ctx, contentType, body, reqEditors...) 3173 if err != nil { 3174 return nil, err 3175 } 3176 return ParseCreateProjectResponse(rsp) 3177 } 3178 3179 func (c *ClientWithResponses) CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { 3180 rsp, err := c.CreateProject(ctx, body, reqEditors...) 3181 if err != nil { 3182 return nil, err 3183 } 3184 return ParseCreateProjectResponse(rsp) 3185 } 3186 3187 // RemoveCustomHostnameConfigWithResponse request returning *RemoveCustomHostnameConfigResponse 3188 func (c *ClientWithResponses) RemoveCustomHostnameConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveCustomHostnameConfigResponse, error) { 3189 rsp, err := c.RemoveCustomHostnameConfig(ctx, ref, reqEditors...) 3190 if err != nil { 3191 return nil, err 3192 } 3193 return ParseRemoveCustomHostnameConfigResponse(rsp) 3194 } 3195 3196 // GetCustomHostnameConfigWithResponse request returning *GetCustomHostnameConfigResponse 3197 func (c *ClientWithResponses) GetCustomHostnameConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetCustomHostnameConfigResponse, error) { 3198 rsp, err := c.GetCustomHostnameConfig(ctx, ref, reqEditors...) 3199 if err != nil { 3200 return nil, err 3201 } 3202 return ParseGetCustomHostnameConfigResponse(rsp) 3203 } 3204 3205 // ActivateWithResponse request returning *ActivateResponse 3206 func (c *ClientWithResponses) ActivateWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ActivateResponse, error) { 3207 rsp, err := c.Activate(ctx, ref, reqEditors...) 3208 if err != nil { 3209 return nil, err 3210 } 3211 return ParseActivateResponse(rsp) 3212 } 3213 3214 // CreateCustomHostnameConfigWithBodyWithResponse request with arbitrary body returning *CreateCustomHostnameConfigResponse 3215 func (c *ClientWithResponses) CreateCustomHostnameConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCustomHostnameConfigResponse, error) { 3216 rsp, err := c.CreateCustomHostnameConfigWithBody(ctx, ref, contentType, body, reqEditors...) 3217 if err != nil { 3218 return nil, err 3219 } 3220 return ParseCreateCustomHostnameConfigResponse(rsp) 3221 } 3222 3223 func (c *ClientWithResponses) CreateCustomHostnameConfigWithResponse(ctx context.Context, ref string, body CreateCustomHostnameConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCustomHostnameConfigResponse, error) { 3224 rsp, err := c.CreateCustomHostnameConfig(ctx, ref, body, reqEditors...) 3225 if err != nil { 3226 return nil, err 3227 } 3228 return ParseCreateCustomHostnameConfigResponse(rsp) 3229 } 3230 3231 // ReverifyWithResponse request returning *ReverifyResponse 3232 func (c *ClientWithResponses) ReverifyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ReverifyResponse, error) { 3233 rsp, err := c.Reverify(ctx, ref, reqEditors...) 3234 if err != nil { 3235 return nil, err 3236 } 3237 return ParseReverifyResponse(rsp) 3238 } 3239 3240 // GetFunctionsWithResponse request returning *GetFunctionsResponse 3241 func (c *ClientWithResponses) GetFunctionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetFunctionsResponse, error) { 3242 rsp, err := c.GetFunctions(ctx, ref, reqEditors...) 3243 if err != nil { 3244 return nil, err 3245 } 3246 return ParseGetFunctionsResponse(rsp) 3247 } 3248 3249 // CreateFunctionWithBodyWithResponse request with arbitrary body returning *CreateFunctionResponse 3250 func (c *ClientWithResponses) CreateFunctionWithBodyWithResponse(ctx context.Context, ref string, params *CreateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFunctionResponse, error) { 3251 rsp, err := c.CreateFunctionWithBody(ctx, ref, params, contentType, body, reqEditors...) 3252 if err != nil { 3253 return nil, err 3254 } 3255 return ParseCreateFunctionResponse(rsp) 3256 } 3257 3258 func (c *ClientWithResponses) CreateFunctionWithResponse(ctx context.Context, ref string, params *CreateFunctionParams, body CreateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFunctionResponse, error) { 3259 rsp, err := c.CreateFunction(ctx, ref, params, body, reqEditors...) 3260 if err != nil { 3261 return nil, err 3262 } 3263 return ParseCreateFunctionResponse(rsp) 3264 } 3265 3266 // DeleteFunctionWithResponse request returning *DeleteFunctionResponse 3267 func (c *ClientWithResponses) DeleteFunctionWithResponse(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*DeleteFunctionResponse, error) { 3268 rsp, err := c.DeleteFunction(ctx, ref, functionSlug, reqEditors...) 3269 if err != nil { 3270 return nil, err 3271 } 3272 return ParseDeleteFunctionResponse(rsp) 3273 } 3274 3275 // GetFunctionWithResponse request returning *GetFunctionResponse 3276 func (c *ClientWithResponses) GetFunctionWithResponse(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*GetFunctionResponse, error) { 3277 rsp, err := c.GetFunction(ctx, ref, functionSlug, reqEditors...) 3278 if err != nil { 3279 return nil, err 3280 } 3281 return ParseGetFunctionResponse(rsp) 3282 } 3283 3284 // UpdateFunctionWithBodyWithResponse request with arbitrary body returning *UpdateFunctionResponse 3285 func (c *ClientWithResponses) UpdateFunctionWithBodyWithResponse(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFunctionResponse, error) { 3286 rsp, err := c.UpdateFunctionWithBody(ctx, ref, functionSlug, params, contentType, body, reqEditors...) 3287 if err != nil { 3288 return nil, err 3289 } 3290 return ParseUpdateFunctionResponse(rsp) 3291 } 3292 3293 func (c *ClientWithResponses) UpdateFunctionWithResponse(ctx context.Context, ref string, functionSlug string, params *UpdateFunctionParams, body UpdateFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFunctionResponse, error) { 3294 rsp, err := c.UpdateFunction(ctx, ref, functionSlug, params, body, reqEditors...) 3295 if err != nil { 3296 return nil, err 3297 } 3298 return ParseUpdateFunctionResponse(rsp) 3299 } 3300 3301 // GetFunctionBodyWithResponse request returning *GetFunctionBodyResponse 3302 func (c *ClientWithResponses) GetFunctionBodyWithResponse(ctx context.Context, ref string, functionSlug string, reqEditors ...RequestEditorFn) (*GetFunctionBodyResponse, error) { 3303 rsp, err := c.GetFunctionBody(ctx, ref, functionSlug, reqEditors...) 3304 if err != nil { 3305 return nil, err 3306 } 3307 return ParseGetFunctionBodyResponse(rsp) 3308 } 3309 3310 // RemoveNetworkBanWithBodyWithResponse request with arbitrary body returning *RemoveNetworkBanResponse 3311 func (c *ClientWithResponses) RemoveNetworkBanWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RemoveNetworkBanResponse, error) { 3312 rsp, err := c.RemoveNetworkBanWithBody(ctx, ref, contentType, body, reqEditors...) 3313 if err != nil { 3314 return nil, err 3315 } 3316 return ParseRemoveNetworkBanResponse(rsp) 3317 } 3318 3319 func (c *ClientWithResponses) RemoveNetworkBanWithResponse(ctx context.Context, ref string, body RemoveNetworkBanJSONRequestBody, reqEditors ...RequestEditorFn) (*RemoveNetworkBanResponse, error) { 3320 rsp, err := c.RemoveNetworkBan(ctx, ref, body, reqEditors...) 3321 if err != nil { 3322 return nil, err 3323 } 3324 return ParseRemoveNetworkBanResponse(rsp) 3325 } 3326 3327 // GetNetworkBansWithResponse request returning *GetNetworkBansResponse 3328 func (c *ClientWithResponses) GetNetworkBansWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetNetworkBansResponse, error) { 3329 rsp, err := c.GetNetworkBans(ctx, ref, reqEditors...) 3330 if err != nil { 3331 return nil, err 3332 } 3333 return ParseGetNetworkBansResponse(rsp) 3334 } 3335 3336 // GetNetworkRestrictionsWithResponse request returning *GetNetworkRestrictionsResponse 3337 func (c *ClientWithResponses) GetNetworkRestrictionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetNetworkRestrictionsResponse, error) { 3338 rsp, err := c.GetNetworkRestrictions(ctx, ref, reqEditors...) 3339 if err != nil { 3340 return nil, err 3341 } 3342 return ParseGetNetworkRestrictionsResponse(rsp) 3343 } 3344 3345 // ApplyNetworkRestrictionsWithBodyWithResponse request with arbitrary body returning *ApplyNetworkRestrictionsResponse 3346 func (c *ClientWithResponses) ApplyNetworkRestrictionsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyNetworkRestrictionsResponse, error) { 3347 rsp, err := c.ApplyNetworkRestrictionsWithBody(ctx, ref, contentType, body, reqEditors...) 3348 if err != nil { 3349 return nil, err 3350 } 3351 return ParseApplyNetworkRestrictionsResponse(rsp) 3352 } 3353 3354 func (c *ClientWithResponses) ApplyNetworkRestrictionsWithResponse(ctx context.Context, ref string, body ApplyNetworkRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyNetworkRestrictionsResponse, error) { 3355 rsp, err := c.ApplyNetworkRestrictions(ctx, ref, body, reqEditors...) 3356 if err != nil { 3357 return nil, err 3358 } 3359 return ParseApplyNetworkRestrictionsResponse(rsp) 3360 } 3361 3362 // GetConfigWithResponse request returning *GetConfigResponse 3363 func (c *ClientWithResponses) GetConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) { 3364 rsp, err := c.GetConfig(ctx, ref, reqEditors...) 3365 if err != nil { 3366 return nil, err 3367 } 3368 return ParseGetConfigResponse(rsp) 3369 } 3370 3371 // UpdateConfigWithBodyWithResponse request with arbitrary body returning *UpdateConfigResponse 3372 func (c *ClientWithResponses) UpdateConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateConfigResponse, error) { 3373 rsp, err := c.UpdateConfigWithBody(ctx, ref, contentType, body, reqEditors...) 3374 if err != nil { 3375 return nil, err 3376 } 3377 return ParseUpdateConfigResponse(rsp) 3378 } 3379 3380 func (c *ClientWithResponses) UpdateConfigWithResponse(ctx context.Context, ref string, body UpdateConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateConfigResponse, error) { 3381 rsp, err := c.UpdateConfig(ctx, ref, body, reqEditors...) 3382 if err != nil { 3383 return nil, err 3384 } 3385 return ParseUpdateConfigResponse(rsp) 3386 } 3387 3388 // GetPostgRESTConfigWithResponse request returning *GetPostgRESTConfigResponse 3389 func (c *ClientWithResponses) GetPostgRESTConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPostgRESTConfigResponse, error) { 3390 rsp, err := c.GetPostgRESTConfig(ctx, ref, reqEditors...) 3391 if err != nil { 3392 return nil, err 3393 } 3394 return ParseGetPostgRESTConfigResponse(rsp) 3395 } 3396 3397 // UpdatePostgRESTConfigWithBodyWithResponse request with arbitrary body returning *UpdatePostgRESTConfigResponse 3398 func (c *ClientWithResponses) UpdatePostgRESTConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePostgRESTConfigResponse, error) { 3399 rsp, err := c.UpdatePostgRESTConfigWithBody(ctx, ref, contentType, body, reqEditors...) 3400 if err != nil { 3401 return nil, err 3402 } 3403 return ParseUpdatePostgRESTConfigResponse(rsp) 3404 } 3405 3406 func (c *ClientWithResponses) UpdatePostgRESTConfigWithResponse(ctx context.Context, ref string, body UpdatePostgRESTConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePostgRESTConfigResponse, error) { 3407 rsp, err := c.UpdatePostgRESTConfig(ctx, ref, body, reqEditors...) 3408 if err != nil { 3409 return nil, err 3410 } 3411 return ParseUpdatePostgRESTConfigResponse(rsp) 3412 } 3413 3414 // DeleteSecretsWithBodyWithResponse request with arbitrary body returning *DeleteSecretsResponse 3415 func (c *ClientWithResponses) DeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecretsResponse, error) { 3416 rsp, err := c.DeleteSecretsWithBody(ctx, ref, contentType, body, reqEditors...) 3417 if err != nil { 3418 return nil, err 3419 } 3420 return ParseDeleteSecretsResponse(rsp) 3421 } 3422 3423 func (c *ClientWithResponses) DeleteSecretsWithResponse(ctx context.Context, ref string, body DeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteSecretsResponse, error) { 3424 rsp, err := c.DeleteSecrets(ctx, ref, body, reqEditors...) 3425 if err != nil { 3426 return nil, err 3427 } 3428 return ParseDeleteSecretsResponse(rsp) 3429 } 3430 3431 // GetSecretsWithResponse request returning *GetSecretsResponse 3432 func (c *ClientWithResponses) GetSecretsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSecretsResponse, error) { 3433 rsp, err := c.GetSecrets(ctx, ref, reqEditors...) 3434 if err != nil { 3435 return nil, err 3436 } 3437 return ParseGetSecretsResponse(rsp) 3438 } 3439 3440 // CreateSecretsWithBodyWithResponse request with arbitrary body returning *CreateSecretsResponse 3441 func (c *ClientWithResponses) CreateSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretsResponse, error) { 3442 rsp, err := c.CreateSecretsWithBody(ctx, ref, contentType, body, reqEditors...) 3443 if err != nil { 3444 return nil, err 3445 } 3446 return ParseCreateSecretsResponse(rsp) 3447 } 3448 3449 func (c *ClientWithResponses) CreateSecretsWithResponse(ctx context.Context, ref string, body CreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretsResponse, error) { 3450 rsp, err := c.CreateSecrets(ctx, ref, body, reqEditors...) 3451 if err != nil { 3452 return nil, err 3453 } 3454 return ParseCreateSecretsResponse(rsp) 3455 } 3456 3457 // GetSslEnforcementConfigWithResponse request returning *GetSslEnforcementConfigResponse 3458 func (c *ClientWithResponses) GetSslEnforcementConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSslEnforcementConfigResponse, error) { 3459 rsp, err := c.GetSslEnforcementConfig(ctx, ref, reqEditors...) 3460 if err != nil { 3461 return nil, err 3462 } 3463 return ParseGetSslEnforcementConfigResponse(rsp) 3464 } 3465 3466 // UpdateSslEnforcementConfigWithBodyWithResponse request with arbitrary body returning *UpdateSslEnforcementConfigResponse 3467 func (c *ClientWithResponses) UpdateSslEnforcementConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSslEnforcementConfigResponse, error) { 3468 rsp, err := c.UpdateSslEnforcementConfigWithBody(ctx, ref, contentType, body, reqEditors...) 3469 if err != nil { 3470 return nil, err 3471 } 3472 return ParseUpdateSslEnforcementConfigResponse(rsp) 3473 } 3474 3475 func (c *ClientWithResponses) UpdateSslEnforcementConfigWithResponse(ctx context.Context, ref string, body UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSslEnforcementConfigResponse, error) { 3476 rsp, err := c.UpdateSslEnforcementConfig(ctx, ref, body, reqEditors...) 3477 if err != nil { 3478 return nil, err 3479 } 3480 return ParseUpdateSslEnforcementConfigResponse(rsp) 3481 } 3482 3483 // GetTypescriptTypesWithResponse request returning *GetTypescriptTypesResponse 3484 func (c *ClientWithResponses) GetTypescriptTypesWithResponse(ctx context.Context, ref string, params *GetTypescriptTypesParams, reqEditors ...RequestEditorFn) (*GetTypescriptTypesResponse, error) { 3485 rsp, err := c.GetTypescriptTypes(ctx, ref, params, reqEditors...) 3486 if err != nil { 3487 return nil, err 3488 } 3489 return ParseGetTypescriptTypesResponse(rsp) 3490 } 3491 3492 // RemoveVanitySubdomainConfigWithResponse request returning *RemoveVanitySubdomainConfigResponse 3493 func (c *ClientWithResponses) RemoveVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveVanitySubdomainConfigResponse, error) { 3494 rsp, err := c.RemoveVanitySubdomainConfig(ctx, ref, reqEditors...) 3495 if err != nil { 3496 return nil, err 3497 } 3498 return ParseRemoveVanitySubdomainConfigResponse(rsp) 3499 } 3500 3501 // GetVanitySubdomainConfigWithResponse request returning *GetVanitySubdomainConfigResponse 3502 func (c *ClientWithResponses) GetVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetVanitySubdomainConfigResponse, error) { 3503 rsp, err := c.GetVanitySubdomainConfig(ctx, ref, reqEditors...) 3504 if err != nil { 3505 return nil, err 3506 } 3507 return ParseGetVanitySubdomainConfigResponse(rsp) 3508 } 3509 3510 // ActivateVanitySubdomainPleaseWithBodyWithResponse request with arbitrary body returning *ActivateVanitySubdomainPleaseResponse 3511 func (c *ClientWithResponses) ActivateVanitySubdomainPleaseWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivateVanitySubdomainPleaseResponse, error) { 3512 rsp, err := c.ActivateVanitySubdomainPleaseWithBody(ctx, ref, contentType, body, reqEditors...) 3513 if err != nil { 3514 return nil, err 3515 } 3516 return ParseActivateVanitySubdomainPleaseResponse(rsp) 3517 } 3518 3519 func (c *ClientWithResponses) ActivateVanitySubdomainPleaseWithResponse(ctx context.Context, ref string, body ActivateVanitySubdomainPleaseJSONRequestBody, reqEditors ...RequestEditorFn) (*ActivateVanitySubdomainPleaseResponse, error) { 3520 rsp, err := c.ActivateVanitySubdomainPlease(ctx, ref, body, reqEditors...) 3521 if err != nil { 3522 return nil, err 3523 } 3524 return ParseActivateVanitySubdomainPleaseResponse(rsp) 3525 } 3526 3527 // CheckVanitySubdomainAvailabilityWithBodyWithResponse request with arbitrary body returning *CheckVanitySubdomainAvailabilityResponse 3528 func (c *ClientWithResponses) CheckVanitySubdomainAvailabilityWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CheckVanitySubdomainAvailabilityResponse, error) { 3529 rsp, err := c.CheckVanitySubdomainAvailabilityWithBody(ctx, ref, contentType, body, reqEditors...) 3530 if err != nil { 3531 return nil, err 3532 } 3533 return ParseCheckVanitySubdomainAvailabilityResponse(rsp) 3534 } 3535 3536 func (c *ClientWithResponses) CheckVanitySubdomainAvailabilityWithResponse(ctx context.Context, ref string, body CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*CheckVanitySubdomainAvailabilityResponse, error) { 3537 rsp, err := c.CheckVanitySubdomainAvailability(ctx, ref, body, reqEditors...) 3538 if err != nil { 3539 return nil, err 3540 } 3541 return ParseCheckVanitySubdomainAvailabilityResponse(rsp) 3542 } 3543 3544 // ParseGetOrganizationsResponse parses an HTTP response from a GetOrganizationsWithResponse call 3545 func ParseGetOrganizationsResponse(rsp *http.Response) (*GetOrganizationsResponse, error) { 3546 bodyBytes, err := io.ReadAll(rsp.Body) 3547 defer func() { _ = rsp.Body.Close() }() 3548 if err != nil { 3549 return nil, err 3550 } 3551 3552 response := &GetOrganizationsResponse{ 3553 Body: bodyBytes, 3554 HTTPResponse: rsp, 3555 } 3556 3557 switch { 3558 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3559 var dest []OrganizationResponse 3560 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3561 return nil, err 3562 } 3563 response.JSON200 = &dest 3564 3565 } 3566 3567 return response, nil 3568 } 3569 3570 // ParseCreateOrganizationResponse parses an HTTP response from a CreateOrganizationWithResponse call 3571 func ParseCreateOrganizationResponse(rsp *http.Response) (*CreateOrganizationResponse, error) { 3572 bodyBytes, err := io.ReadAll(rsp.Body) 3573 defer func() { _ = rsp.Body.Close() }() 3574 if err != nil { 3575 return nil, err 3576 } 3577 3578 response := &CreateOrganizationResponse{ 3579 Body: bodyBytes, 3580 HTTPResponse: rsp, 3581 } 3582 3583 switch { 3584 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3585 var dest OrganizationResponse 3586 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3587 return nil, err 3588 } 3589 response.JSON201 = &dest 3590 3591 } 3592 3593 return response, nil 3594 } 3595 3596 // ParseGetProjectsResponse parses an HTTP response from a GetProjectsWithResponse call 3597 func ParseGetProjectsResponse(rsp *http.Response) (*GetProjectsResponse, error) { 3598 bodyBytes, err := io.ReadAll(rsp.Body) 3599 defer func() { _ = rsp.Body.Close() }() 3600 if err != nil { 3601 return nil, err 3602 } 3603 3604 response := &GetProjectsResponse{ 3605 Body: bodyBytes, 3606 HTTPResponse: rsp, 3607 } 3608 3609 switch { 3610 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3611 var dest []ProjectResponse 3612 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3613 return nil, err 3614 } 3615 response.JSON200 = &dest 3616 3617 } 3618 3619 return response, nil 3620 } 3621 3622 // ParseCreateProjectResponse parses an HTTP response from a CreateProjectWithResponse call 3623 func ParseCreateProjectResponse(rsp *http.Response) (*CreateProjectResponse, error) { 3624 bodyBytes, err := io.ReadAll(rsp.Body) 3625 defer func() { _ = rsp.Body.Close() }() 3626 if err != nil { 3627 return nil, err 3628 } 3629 3630 response := &CreateProjectResponse{ 3631 Body: bodyBytes, 3632 HTTPResponse: rsp, 3633 } 3634 3635 switch { 3636 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3637 var dest ProjectResponse 3638 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3639 return nil, err 3640 } 3641 response.JSON201 = &dest 3642 3643 } 3644 3645 return response, nil 3646 } 3647 3648 // ParseRemoveCustomHostnameConfigResponse parses an HTTP response from a RemoveCustomHostnameConfigWithResponse call 3649 func ParseRemoveCustomHostnameConfigResponse(rsp *http.Response) (*RemoveCustomHostnameConfigResponse, error) { 3650 bodyBytes, err := io.ReadAll(rsp.Body) 3651 defer func() { _ = rsp.Body.Close() }() 3652 if err != nil { 3653 return nil, err 3654 } 3655 3656 response := &RemoveCustomHostnameConfigResponse{ 3657 Body: bodyBytes, 3658 HTTPResponse: rsp, 3659 } 3660 3661 return response, nil 3662 } 3663 3664 // ParseGetCustomHostnameConfigResponse parses an HTTP response from a GetCustomHostnameConfigWithResponse call 3665 func ParseGetCustomHostnameConfigResponse(rsp *http.Response) (*GetCustomHostnameConfigResponse, error) { 3666 bodyBytes, err := io.ReadAll(rsp.Body) 3667 defer func() { _ = rsp.Body.Close() }() 3668 if err != nil { 3669 return nil, err 3670 } 3671 3672 response := &GetCustomHostnameConfigResponse{ 3673 Body: bodyBytes, 3674 HTTPResponse: rsp, 3675 } 3676 3677 switch { 3678 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3679 var dest UpdateCustomHostnameResponse 3680 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3681 return nil, err 3682 } 3683 response.JSON200 = &dest 3684 3685 } 3686 3687 return response, nil 3688 } 3689 3690 // ParseActivateResponse parses an HTTP response from a ActivateWithResponse call 3691 func ParseActivateResponse(rsp *http.Response) (*ActivateResponse, error) { 3692 bodyBytes, err := io.ReadAll(rsp.Body) 3693 defer func() { _ = rsp.Body.Close() }() 3694 if err != nil { 3695 return nil, err 3696 } 3697 3698 response := &ActivateResponse{ 3699 Body: bodyBytes, 3700 HTTPResponse: rsp, 3701 } 3702 3703 switch { 3704 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3705 var dest UpdateCustomHostnameResponse 3706 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3707 return nil, err 3708 } 3709 response.JSON201 = &dest 3710 3711 } 3712 3713 return response, nil 3714 } 3715 3716 // ParseCreateCustomHostnameConfigResponse parses an HTTP response from a CreateCustomHostnameConfigWithResponse call 3717 func ParseCreateCustomHostnameConfigResponse(rsp *http.Response) (*CreateCustomHostnameConfigResponse, error) { 3718 bodyBytes, err := io.ReadAll(rsp.Body) 3719 defer func() { _ = rsp.Body.Close() }() 3720 if err != nil { 3721 return nil, err 3722 } 3723 3724 response := &CreateCustomHostnameConfigResponse{ 3725 Body: bodyBytes, 3726 HTTPResponse: rsp, 3727 } 3728 3729 switch { 3730 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3731 var dest UpdateCustomHostnameResponse 3732 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3733 return nil, err 3734 } 3735 response.JSON201 = &dest 3736 3737 } 3738 3739 return response, nil 3740 } 3741 3742 // ParseReverifyResponse parses an HTTP response from a ReverifyWithResponse call 3743 func ParseReverifyResponse(rsp *http.Response) (*ReverifyResponse, error) { 3744 bodyBytes, err := io.ReadAll(rsp.Body) 3745 defer func() { _ = rsp.Body.Close() }() 3746 if err != nil { 3747 return nil, err 3748 } 3749 3750 response := &ReverifyResponse{ 3751 Body: bodyBytes, 3752 HTTPResponse: rsp, 3753 } 3754 3755 switch { 3756 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3757 var dest UpdateCustomHostnameResponse 3758 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3759 return nil, err 3760 } 3761 response.JSON201 = &dest 3762 3763 } 3764 3765 return response, nil 3766 } 3767 3768 // ParseGetFunctionsResponse parses an HTTP response from a GetFunctionsWithResponse call 3769 func ParseGetFunctionsResponse(rsp *http.Response) (*GetFunctionsResponse, error) { 3770 bodyBytes, err := io.ReadAll(rsp.Body) 3771 defer func() { _ = rsp.Body.Close() }() 3772 if err != nil { 3773 return nil, err 3774 } 3775 3776 response := &GetFunctionsResponse{ 3777 Body: bodyBytes, 3778 HTTPResponse: rsp, 3779 } 3780 3781 switch { 3782 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3783 var dest []FunctionResponse 3784 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3785 return nil, err 3786 } 3787 response.JSON200 = &dest 3788 3789 } 3790 3791 return response, nil 3792 } 3793 3794 // ParseCreateFunctionResponse parses an HTTP response from a CreateFunctionWithResponse call 3795 func ParseCreateFunctionResponse(rsp *http.Response) (*CreateFunctionResponse, error) { 3796 bodyBytes, err := io.ReadAll(rsp.Body) 3797 defer func() { _ = rsp.Body.Close() }() 3798 if err != nil { 3799 return nil, err 3800 } 3801 3802 response := &CreateFunctionResponse{ 3803 Body: bodyBytes, 3804 HTTPResponse: rsp, 3805 } 3806 3807 switch { 3808 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3809 var dest FunctionResponse 3810 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3811 return nil, err 3812 } 3813 response.JSON201 = &dest 3814 3815 } 3816 3817 return response, nil 3818 } 3819 3820 // ParseDeleteFunctionResponse parses an HTTP response from a DeleteFunctionWithResponse call 3821 func ParseDeleteFunctionResponse(rsp *http.Response) (*DeleteFunctionResponse, error) { 3822 bodyBytes, err := io.ReadAll(rsp.Body) 3823 defer func() { _ = rsp.Body.Close() }() 3824 if err != nil { 3825 return nil, err 3826 } 3827 3828 response := &DeleteFunctionResponse{ 3829 Body: bodyBytes, 3830 HTTPResponse: rsp, 3831 } 3832 3833 return response, nil 3834 } 3835 3836 // ParseGetFunctionResponse parses an HTTP response from a GetFunctionWithResponse call 3837 func ParseGetFunctionResponse(rsp *http.Response) (*GetFunctionResponse, error) { 3838 bodyBytes, err := io.ReadAll(rsp.Body) 3839 defer func() { _ = rsp.Body.Close() }() 3840 if err != nil { 3841 return nil, err 3842 } 3843 3844 response := &GetFunctionResponse{ 3845 Body: bodyBytes, 3846 HTTPResponse: rsp, 3847 } 3848 3849 switch { 3850 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3851 var dest FunctionSlugResponse 3852 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3853 return nil, err 3854 } 3855 response.JSON200 = &dest 3856 3857 } 3858 3859 return response, nil 3860 } 3861 3862 // ParseUpdateFunctionResponse parses an HTTP response from a UpdateFunctionWithResponse call 3863 func ParseUpdateFunctionResponse(rsp *http.Response) (*UpdateFunctionResponse, error) { 3864 bodyBytes, err := io.ReadAll(rsp.Body) 3865 defer func() { _ = rsp.Body.Close() }() 3866 if err != nil { 3867 return nil, err 3868 } 3869 3870 response := &UpdateFunctionResponse{ 3871 Body: bodyBytes, 3872 HTTPResponse: rsp, 3873 } 3874 3875 switch { 3876 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3877 var dest FunctionResponse 3878 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3879 return nil, err 3880 } 3881 response.JSON200 = &dest 3882 3883 } 3884 3885 return response, nil 3886 } 3887 3888 // ParseGetFunctionBodyResponse parses an HTTP response from a GetFunctionBodyWithResponse call 3889 func ParseGetFunctionBodyResponse(rsp *http.Response) (*GetFunctionBodyResponse, error) { 3890 bodyBytes, err := io.ReadAll(rsp.Body) 3891 defer func() { _ = rsp.Body.Close() }() 3892 if err != nil { 3893 return nil, err 3894 } 3895 3896 response := &GetFunctionBodyResponse{ 3897 Body: bodyBytes, 3898 HTTPResponse: rsp, 3899 } 3900 3901 return response, nil 3902 } 3903 3904 // ParseRemoveNetworkBanResponse parses an HTTP response from a RemoveNetworkBanWithResponse call 3905 func ParseRemoveNetworkBanResponse(rsp *http.Response) (*RemoveNetworkBanResponse, error) { 3906 bodyBytes, err := io.ReadAll(rsp.Body) 3907 defer func() { _ = rsp.Body.Close() }() 3908 if err != nil { 3909 return nil, err 3910 } 3911 3912 response := &RemoveNetworkBanResponse{ 3913 Body: bodyBytes, 3914 HTTPResponse: rsp, 3915 } 3916 3917 return response, nil 3918 } 3919 3920 // ParseGetNetworkBansResponse parses an HTTP response from a GetNetworkBansWithResponse call 3921 func ParseGetNetworkBansResponse(rsp *http.Response) (*GetNetworkBansResponse, error) { 3922 bodyBytes, err := io.ReadAll(rsp.Body) 3923 defer func() { _ = rsp.Body.Close() }() 3924 if err != nil { 3925 return nil, err 3926 } 3927 3928 response := &GetNetworkBansResponse{ 3929 Body: bodyBytes, 3930 HTTPResponse: rsp, 3931 } 3932 3933 switch { 3934 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3935 var dest NetworkBanResponse 3936 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3937 return nil, err 3938 } 3939 response.JSON201 = &dest 3940 3941 } 3942 3943 return response, nil 3944 } 3945 3946 // ParseGetNetworkRestrictionsResponse parses an HTTP response from a GetNetworkRestrictionsWithResponse call 3947 func ParseGetNetworkRestrictionsResponse(rsp *http.Response) (*GetNetworkRestrictionsResponse, error) { 3948 bodyBytes, err := io.ReadAll(rsp.Body) 3949 defer func() { _ = rsp.Body.Close() }() 3950 if err != nil { 3951 return nil, err 3952 } 3953 3954 response := &GetNetworkRestrictionsResponse{ 3955 Body: bodyBytes, 3956 HTTPResponse: rsp, 3957 } 3958 3959 switch { 3960 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 3961 var dest NetworkRestrictionsResponse 3962 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3963 return nil, err 3964 } 3965 response.JSON200 = &dest 3966 3967 } 3968 3969 return response, nil 3970 } 3971 3972 // ParseApplyNetworkRestrictionsResponse parses an HTTP response from a ApplyNetworkRestrictionsWithResponse call 3973 func ParseApplyNetworkRestrictionsResponse(rsp *http.Response) (*ApplyNetworkRestrictionsResponse, error) { 3974 bodyBytes, err := io.ReadAll(rsp.Body) 3975 defer func() { _ = rsp.Body.Close() }() 3976 if err != nil { 3977 return nil, err 3978 } 3979 3980 response := &ApplyNetworkRestrictionsResponse{ 3981 Body: bodyBytes, 3982 HTTPResponse: rsp, 3983 } 3984 3985 switch { 3986 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 3987 var dest NetworkRestrictionsResponse 3988 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 3989 return nil, err 3990 } 3991 response.JSON201 = &dest 3992 3993 } 3994 3995 return response, nil 3996 } 3997 3998 // ParseGetConfigResponse parses an HTTP response from a GetConfigWithResponse call 3999 func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { 4000 bodyBytes, err := io.ReadAll(rsp.Body) 4001 defer func() { _ = rsp.Body.Close() }() 4002 if err != nil { 4003 return nil, err 4004 } 4005 4006 response := &GetConfigResponse{ 4007 Body: bodyBytes, 4008 HTTPResponse: rsp, 4009 } 4010 4011 switch { 4012 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4013 var dest PgsodiumConfigResponse 4014 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4015 return nil, err 4016 } 4017 response.JSON200 = &dest 4018 4019 } 4020 4021 return response, nil 4022 } 4023 4024 // ParseUpdateConfigResponse parses an HTTP response from a UpdateConfigWithResponse call 4025 func ParseUpdateConfigResponse(rsp *http.Response) (*UpdateConfigResponse, error) { 4026 bodyBytes, err := io.ReadAll(rsp.Body) 4027 defer func() { _ = rsp.Body.Close() }() 4028 if err != nil { 4029 return nil, err 4030 } 4031 4032 response := &UpdateConfigResponse{ 4033 Body: bodyBytes, 4034 HTTPResponse: rsp, 4035 } 4036 4037 switch { 4038 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4039 var dest PgsodiumConfigResponse 4040 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4041 return nil, err 4042 } 4043 response.JSON200 = &dest 4044 4045 } 4046 4047 return response, nil 4048 } 4049 4050 // ParseGetPostgRESTConfigResponse parses an HTTP response from a GetPostgRESTConfigWithResponse call 4051 func ParseGetPostgRESTConfigResponse(rsp *http.Response) (*GetPostgRESTConfigResponse, error) { 4052 bodyBytes, err := io.ReadAll(rsp.Body) 4053 defer func() { _ = rsp.Body.Close() }() 4054 if err != nil { 4055 return nil, err 4056 } 4057 4058 response := &GetPostgRESTConfigResponse{ 4059 Body: bodyBytes, 4060 HTTPResponse: rsp, 4061 } 4062 4063 switch { 4064 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4065 var dest PostgrestConfigResponse 4066 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4067 return nil, err 4068 } 4069 response.JSON200 = &dest 4070 4071 } 4072 4073 return response, nil 4074 } 4075 4076 // ParseUpdatePostgRESTConfigResponse parses an HTTP response from a UpdatePostgRESTConfigWithResponse call 4077 func ParseUpdatePostgRESTConfigResponse(rsp *http.Response) (*UpdatePostgRESTConfigResponse, error) { 4078 bodyBytes, err := io.ReadAll(rsp.Body) 4079 defer func() { _ = rsp.Body.Close() }() 4080 if err != nil { 4081 return nil, err 4082 } 4083 4084 response := &UpdatePostgRESTConfigResponse{ 4085 Body: bodyBytes, 4086 HTTPResponse: rsp, 4087 } 4088 4089 switch { 4090 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4091 var dest PostgrestConfigResponse 4092 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4093 return nil, err 4094 } 4095 response.JSON200 = &dest 4096 4097 } 4098 4099 return response, nil 4100 } 4101 4102 // ParseDeleteSecretsResponse parses an HTTP response from a DeleteSecretsWithResponse call 4103 func ParseDeleteSecretsResponse(rsp *http.Response) (*DeleteSecretsResponse, error) { 4104 bodyBytes, err := io.ReadAll(rsp.Body) 4105 defer func() { _ = rsp.Body.Close() }() 4106 if err != nil { 4107 return nil, err 4108 } 4109 4110 response := &DeleteSecretsResponse{ 4111 Body: bodyBytes, 4112 HTTPResponse: rsp, 4113 } 4114 4115 switch { 4116 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4117 var dest map[string]interface{} 4118 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4119 return nil, err 4120 } 4121 response.JSON200 = &dest 4122 4123 } 4124 4125 return response, nil 4126 } 4127 4128 // ParseGetSecretsResponse parses an HTTP response from a GetSecretsWithResponse call 4129 func ParseGetSecretsResponse(rsp *http.Response) (*GetSecretsResponse, error) { 4130 bodyBytes, err := io.ReadAll(rsp.Body) 4131 defer func() { _ = rsp.Body.Close() }() 4132 if err != nil { 4133 return nil, err 4134 } 4135 4136 response := &GetSecretsResponse{ 4137 Body: bodyBytes, 4138 HTTPResponse: rsp, 4139 } 4140 4141 switch { 4142 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4143 var dest []SecretResponse 4144 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4145 return nil, err 4146 } 4147 response.JSON200 = &dest 4148 4149 } 4150 4151 return response, nil 4152 } 4153 4154 // ParseCreateSecretsResponse parses an HTTP response from a CreateSecretsWithResponse call 4155 func ParseCreateSecretsResponse(rsp *http.Response) (*CreateSecretsResponse, error) { 4156 bodyBytes, err := io.ReadAll(rsp.Body) 4157 defer func() { _ = rsp.Body.Close() }() 4158 if err != nil { 4159 return nil, err 4160 } 4161 4162 response := &CreateSecretsResponse{ 4163 Body: bodyBytes, 4164 HTTPResponse: rsp, 4165 } 4166 4167 return response, nil 4168 } 4169 4170 // ParseGetSslEnforcementConfigResponse parses an HTTP response from a GetSslEnforcementConfigWithResponse call 4171 func ParseGetSslEnforcementConfigResponse(rsp *http.Response) (*GetSslEnforcementConfigResponse, error) { 4172 bodyBytes, err := io.ReadAll(rsp.Body) 4173 defer func() { _ = rsp.Body.Close() }() 4174 if err != nil { 4175 return nil, err 4176 } 4177 4178 response := &GetSslEnforcementConfigResponse{ 4179 Body: bodyBytes, 4180 HTTPResponse: rsp, 4181 } 4182 4183 switch { 4184 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4185 var dest SslEnforcementResponse 4186 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4187 return nil, err 4188 } 4189 response.JSON200 = &dest 4190 4191 } 4192 4193 return response, nil 4194 } 4195 4196 // ParseUpdateSslEnforcementConfigResponse parses an HTTP response from a UpdateSslEnforcementConfigWithResponse call 4197 func ParseUpdateSslEnforcementConfigResponse(rsp *http.Response) (*UpdateSslEnforcementConfigResponse, error) { 4198 bodyBytes, err := io.ReadAll(rsp.Body) 4199 defer func() { _ = rsp.Body.Close() }() 4200 if err != nil { 4201 return nil, err 4202 } 4203 4204 response := &UpdateSslEnforcementConfigResponse{ 4205 Body: bodyBytes, 4206 HTTPResponse: rsp, 4207 } 4208 4209 switch { 4210 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4211 var dest SslEnforcementResponse 4212 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4213 return nil, err 4214 } 4215 response.JSON200 = &dest 4216 4217 } 4218 4219 return response, nil 4220 } 4221 4222 // ParseGetTypescriptTypesResponse parses an HTTP response from a GetTypescriptTypesWithResponse call 4223 func ParseGetTypescriptTypesResponse(rsp *http.Response) (*GetTypescriptTypesResponse, error) { 4224 bodyBytes, err := io.ReadAll(rsp.Body) 4225 defer func() { _ = rsp.Body.Close() }() 4226 if err != nil { 4227 return nil, err 4228 } 4229 4230 response := &GetTypescriptTypesResponse{ 4231 Body: bodyBytes, 4232 HTTPResponse: rsp, 4233 } 4234 4235 switch { 4236 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4237 var dest TypescriptResponse 4238 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4239 return nil, err 4240 } 4241 response.JSON200 = &dest 4242 4243 } 4244 4245 return response, nil 4246 } 4247 4248 // ParseRemoveVanitySubdomainConfigResponse parses an HTTP response from a RemoveVanitySubdomainConfigWithResponse call 4249 func ParseRemoveVanitySubdomainConfigResponse(rsp *http.Response) (*RemoveVanitySubdomainConfigResponse, error) { 4250 bodyBytes, err := io.ReadAll(rsp.Body) 4251 defer func() { _ = rsp.Body.Close() }() 4252 if err != nil { 4253 return nil, err 4254 } 4255 4256 response := &RemoveVanitySubdomainConfigResponse{ 4257 Body: bodyBytes, 4258 HTTPResponse: rsp, 4259 } 4260 4261 return response, nil 4262 } 4263 4264 // ParseGetVanitySubdomainConfigResponse parses an HTTP response from a GetVanitySubdomainConfigWithResponse call 4265 func ParseGetVanitySubdomainConfigResponse(rsp *http.Response) (*GetVanitySubdomainConfigResponse, error) { 4266 bodyBytes, err := io.ReadAll(rsp.Body) 4267 defer func() { _ = rsp.Body.Close() }() 4268 if err != nil { 4269 return nil, err 4270 } 4271 4272 response := &GetVanitySubdomainConfigResponse{ 4273 Body: bodyBytes, 4274 HTTPResponse: rsp, 4275 } 4276 4277 switch { 4278 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 4279 var dest VanitySubdomainConfigResponse 4280 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4281 return nil, err 4282 } 4283 response.JSON200 = &dest 4284 4285 } 4286 4287 return response, nil 4288 } 4289 4290 // ParseActivateVanitySubdomainPleaseResponse parses an HTTP response from a ActivateVanitySubdomainPleaseWithResponse call 4291 func ParseActivateVanitySubdomainPleaseResponse(rsp *http.Response) (*ActivateVanitySubdomainPleaseResponse, error) { 4292 bodyBytes, err := io.ReadAll(rsp.Body) 4293 defer func() { _ = rsp.Body.Close() }() 4294 if err != nil { 4295 return nil, err 4296 } 4297 4298 response := &ActivateVanitySubdomainPleaseResponse{ 4299 Body: bodyBytes, 4300 HTTPResponse: rsp, 4301 } 4302 4303 switch { 4304 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 4305 var dest ActivateVanitySubdomainResponse 4306 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4307 return nil, err 4308 } 4309 response.JSON201 = &dest 4310 4311 } 4312 4313 return response, nil 4314 } 4315 4316 // ParseCheckVanitySubdomainAvailabilityResponse parses an HTTP response from a CheckVanitySubdomainAvailabilityWithResponse call 4317 func ParseCheckVanitySubdomainAvailabilityResponse(rsp *http.Response) (*CheckVanitySubdomainAvailabilityResponse, error) { 4318 bodyBytes, err := io.ReadAll(rsp.Body) 4319 defer func() { _ = rsp.Body.Close() }() 4320 if err != nil { 4321 return nil, err 4322 } 4323 4324 response := &CheckVanitySubdomainAvailabilityResponse{ 4325 Body: bodyBytes, 4326 HTTPResponse: rsp, 4327 } 4328 4329 switch { 4330 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 4331 var dest SubdomainAvailabilityResponse 4332 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 4333 return nil, err 4334 } 4335 response.JSON201 = &dest 4336 4337 } 4338 4339 return response, nil 4340 }