github.com/qiniu/go-sdk/v7@v7.27.0/sandbox/internal/apis/sandbox.gen.go (about) 1 // Package apis provides primitives to interact with the openapi HTTP API. 2 // 3 // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. 4 package apis 5 6 import ( 7 "bytes" 8 "context" 9 "encoding/json" 10 "errors" 11 "fmt" 12 "io" 13 "net/http" 14 "net/url" 15 "strings" 16 "time" 17 18 "github.com/oapi-codegen/runtime" 19 openapi_types "github.com/oapi-codegen/runtime/types" 20 ) 21 22 const ( 23 AccessTokenAuthScopes = "AccessTokenAuth.Scopes" 24 ApiKeyAuthScopes = "ApiKeyAuth.Scopes" 25 QiniuAccessKeyAuthScopes = "QiniuAccessKeyAuth.Scopes" 26 ) 27 28 // Defines values for AWSRegistryType. 29 const ( 30 Aws AWSRegistryType = "aws" 31 ) 32 33 // Defines values for AnthropicInjectionType. 34 const ( 35 Anthropic AnthropicInjectionType = "anthropic" 36 ) 37 38 // Defines values for GCPRegistryType. 39 const ( 40 Gcp GCPRegistryType = "gcp" 41 ) 42 43 // Defines values for GeminiInjectionType. 44 const ( 45 Gemini GeminiInjectionType = "gemini" 46 ) 47 48 // Defines values for GeneralRegistryType. 49 const ( 50 Registry GeneralRegistryType = "registry" 51 ) 52 53 // Defines values for GitRepositoryResourceType. 54 const ( 55 GithubRepository GitRepositoryResourceType = "github_repository" 56 ) 57 58 // Defines values for GithubInjectionType. 59 const ( 60 Github GithubInjectionType = "github" 61 ) 62 63 // Defines values for HTTPInjectionType. 64 const ( 65 HTTP HTTPInjectionType = "http" 66 ) 67 68 // Defines values for InjectionByIDType. 69 const ( 70 ID InjectionByIDType = "id" 71 ) 72 73 // Defines values for KodoResourceType. 74 const ( 75 Kodo KodoResourceType = "kodo" 76 ) 77 78 // Defines values for LogLevel. 79 const ( 80 LogLevelDebug LogLevel = "debug" 81 LogLevelError LogLevel = "error" 82 LogLevelInfo LogLevel = "info" 83 LogLevelWarn LogLevel = "warn" 84 ) 85 86 // Defines values for LogsDirection. 87 const ( 88 LogsDirectionBackward LogsDirection = "backward" 89 LogsDirectionForward LogsDirection = "forward" 90 ) 91 92 // Defines values for LogsSource. 93 const ( 94 LogsSourcePersistent LogsSource = "persistent" 95 LogsSourceTemporary LogsSource = "temporary" 96 ) 97 98 // Defines values for OpenaiInjectionType. 99 const ( 100 Openai OpenaiInjectionType = "openai" 101 ) 102 103 // Defines values for QiniuInjectionType. 104 const ( 105 Qiniu QiniuInjectionType = "qiniu" 106 ) 107 108 // Defines values for SandboxState. 109 const ( 110 Paused SandboxState = "paused" 111 Running SandboxState = "running" 112 ) 113 114 // Defines values for TemplateBuildStatus. 115 const ( 116 TemplateBuildStatusBuilding TemplateBuildStatus = "building" 117 TemplateBuildStatusError TemplateBuildStatus = "error" 118 TemplateBuildStatusReady TemplateBuildStatus = "ready" 119 TemplateBuildStatusWaiting TemplateBuildStatus = "waiting" 120 ) 121 122 // AWSRegistry defines model for AWSRegistry. 123 type AWSRegistry struct { 124 // AwsAccessKeyID AWS Access Key ID for ECR authentication 125 AwsAccessKeyID string `json:"awsAccessKeyId"` 126 127 // AwsRegion AWS Region where the ECR registry is located 128 AwsRegion string `json:"awsRegion"` 129 130 // AwsSecretAccessKey AWS Secret Access Key for ECR authentication 131 AwsSecretAccessKey string `json:"awsSecretAccessKey"` 132 133 // Type Type of registry authentication 134 Type AWSRegistryType `json:"type"` 135 } 136 137 // AWSRegistryType Type of registry authentication 138 type AWSRegistryType string 139 140 // AnthropicInjection Anthropic API injection. Automatically configures x-api-key header. 141 // Default host: api.anthropic.com 142 type AnthropicInjection struct { 143 // APIKey API key for Anthropic API 144 APIKey *string `json:"api_key,omitempty"` 145 146 // BaseURL Optional base URL. If not specified, uses api.anthropic.com. The host is matched exactly. When a path is present, it matches the normalized request path exactly; a trailing `*` enables normalized string-prefix matching. 147 BaseURL *string `json:"base_url,omitempty"` 148 149 // IfHeaders Optional HTTP request headers that must already be present with exact values before this injection matches. Header names are matched case-insensitively; repeated headers compare only their first value. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set request headers. 150 IfHeaders *map[string]string `json:"if_headers,omitempty"` 151 152 // IfQueries Optional query parameters that must already be present with exact values before this injection matches. Query parameter names are case-sensitive. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set query parameters. 153 IfQueries *map[string]string `json:"if_queries,omitempty"` 154 155 // Type Injection type identifier 156 Type AnthropicInjectionType `json:"type"` 157 } 158 159 // AnthropicInjectionType Injection type identifier 160 type AnthropicInjectionType string 161 162 // AssignTemplateTagsRequest defines model for AssignTemplateTagsRequest. 163 type AssignTemplateTagsRequest struct { 164 // Tags Tags to assign to the template 165 Tags []string `json:"tags"` 166 167 // Target Target template in "name:tag" format 168 Target string `json:"target"` 169 } 170 171 // AssignedTemplateTags defines model for AssignedTemplateTags. 172 type AssignedTemplateTags struct { 173 // BuildID Identifier of the build associated with these tags 174 BuildID openapi_types.UUID `json:"buildID"` 175 176 // Tags Assigned tags of the template 177 Tags []string `json:"tags"` 178 } 179 180 // BuildLogEntry defines model for BuildLogEntry. 181 type BuildLogEntry struct { 182 // Level State of the sandbox 183 Level LogLevel `json:"level"` 184 185 // Message Log message content 186 Message string `json:"message"` 187 188 // Step Step in the build process related to the log entry 189 Step *string `json:"step,omitempty"` 190 191 // Timestamp Timestamp of the log entry 192 Timestamp time.Time `json:"timestamp"` 193 } 194 195 // BuildStatusReason defines model for BuildStatusReason. 196 type BuildStatusReason struct { 197 // LogEntries Log entries related to the status reason 198 LogEntries *[]BuildLogEntry `json:"logEntries,omitempty"` 199 200 // Message Message with the status reason, currently reporting only for error status 201 Message string `json:"message"` 202 203 // Step Step that failed 204 Step *string `json:"step,omitempty"` 205 } 206 207 // CPUCount CPU cores for the sandbox 208 type CPUCount = int32 209 210 // ConnectSandbox defines model for ConnectSandbox. 211 type ConnectSandbox struct { 212 // Timeout Timeout in seconds from the current time after which the sandbox should expire 213 Timeout int32 `json:"timeout"` 214 } 215 216 // DeleteTemplateTagsRequest defines model for DeleteTemplateTagsRequest. 217 type DeleteTemplateTagsRequest struct { 218 // Name Name of the template 219 Name string `json:"name"` 220 221 // Tags Tags to delete 222 Tags []string `json:"tags"` 223 } 224 225 // DiskSizeMB Disk size for the sandbox in MiB 226 type DiskSizeMB = int32 227 228 // EnvVars defines model for EnvVars. 229 type EnvVars map[string]string 230 231 // EnvdVersion Version of the envd running in the sandbox 232 type EnvdVersion = string 233 234 // Error defines model for Error. 235 type Error struct { 236 // Code Error code 237 Code int32 `json:"code"` 238 239 // Message Error 240 Message string `json:"message"` 241 } 242 243 // FromImageRegistry defines model for FromImageRegistry. 244 type FromImageRegistry struct { 245 union json.RawMessage 246 } 247 248 // GCPRegistry defines model for GCPRegistry. 249 type GCPRegistry struct { 250 // ServiceAccountJSON Service Account JSON for GCP authentication 251 ServiceAccountJSON string `json:"serviceAccountJson"` 252 253 // Type Type of registry authentication 254 Type GCPRegistryType `json:"type"` 255 } 256 257 // GCPRegistryType Type of registry authentication 258 type GCPRegistryType string 259 260 // GeminiInjection Google Gemini API injection. Automatically configures x-goog-api-key header. 261 // Default host: generativelanguage.googleapis.com 262 type GeminiInjection struct { 263 // APIKey API key for Google Gemini API 264 APIKey *string `json:"api_key,omitempty"` 265 266 // BaseURL Optional base URL. If not specified, uses generativelanguage.googleapis.com. The host is matched exactly. When a path is present, it matches the normalized request path exactly; a trailing `*` enables normalized string-prefix matching. 267 BaseURL *string `json:"base_url,omitempty"` 268 269 // IfHeaders Optional HTTP request headers that must already be present with exact values before this injection matches. Header names are matched case-insensitively; repeated headers compare only their first value. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set request headers. 270 IfHeaders *map[string]string `json:"if_headers,omitempty"` 271 272 // IfQueries Optional query parameters that must already be present with exact values before this injection matches. Query parameter names are case-sensitive. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set query parameters. 273 IfQueries *map[string]string `json:"if_queries,omitempty"` 274 275 // Type Injection type identifier 276 Type GeminiInjectionType `json:"type"` 277 } 278 279 // GeminiInjectionType Injection type identifier 280 type GeminiInjectionType string 281 282 // GeneralRegistry defines model for GeneralRegistry. 283 type GeneralRegistry struct { 284 // Password Password to use for the registry 285 Password string `json:"password"` 286 287 // Type Type of registry authentication 288 Type GeneralRegistryType `json:"type"` 289 290 // Username Username to use for the registry 291 Username string `json:"username"` 292 } 293 294 // GeneralRegistryType Type of registry authentication 295 type GeneralRegistryType string 296 297 // GitRepositoryResource GitHub repository resource mounted into the sandbox. 298 // The platform materializes a cached snapshot of the repository for mounting. 299 // The first snapshot is cloned from the repository default branch HEAD. Subsequent sandboxes reuse the cached snapshot, and the platform refreshes it to the latest default-branch HEAD on a best-effort schedule: a soft TTL triggers a background refresh (the triggering request keeps using the stale snapshot, but later requests that arrive while the refresh is in flight wait for it to complete), and a hard TTL forces the next request to block on a synchronous refresh. 300 type GitRepositoryResource struct { 301 // AuthorizationToken GitHub token used to access this repository. All GitHub repository resources in a single sandbox must currently use the same token. 302 AuthorizationToken *string `json:"authorization_token,omitempty"` 303 304 // MountPath Absolute path where the repository contents should appear inside the sandbox 305 MountPath string `json:"mount_path"` 306 307 // Type Resource type identifier 308 Type GitRepositoryResourceType `json:"type"` 309 310 // URL GitHub repository URL in HTTPS form, or GitHub SSH-style form git@github.com:owner/repo.git. The platform normalizes the value to HTTPS. 311 URL string `json:"url"` 312 } 313 314 // GitRepositoryResourceType Resource type identifier 315 type GitRepositoryResourceType string 316 317 // GithubInjection GitHub credential used by the platform to validate and clone repositories before sandbox startup, and to authenticate matching HTTPS requests to github.com and api.github.com while the sandbox is running. 318 // The token is not exposed inside the sandbox as plaintext. 319 type GithubInjection struct { 320 // BaseURL Optional base URL. If not specified, the platform applies the token to github.com and api.github.com. When specified, the host must be github.com or api.github.com. When a path is present, it matches the normalized request path exactly; a trailing `*` enables normalized string-prefix matching. 321 BaseURL *string `json:"base_url,omitempty"` 322 323 // IfHeaders Optional HTTP request headers that must already be present with exact values before this injection matches. Header names are matched case-insensitively; repeated headers compare only their first value. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set request headers. 324 IfHeaders *map[string]string `json:"if_headers,omitempty"` 325 326 // IfQueries Optional query parameters that must already be present with exact values before this injection matches. Query parameter names are case-sensitive. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set query parameters. 327 IfQueries *map[string]string `json:"if_queries,omitempty"` 328 329 // Token GitHub token with access to all requested repositories 330 Token *string `json:"token,omitempty"` 331 332 // Type Injection type identifier 333 Type GithubInjectionType `json:"type"` 334 } 335 336 // GithubInjectionType Injection type identifier 337 type GithubInjectionType string 338 339 // HTTPInjection Custom HTTP injection with base URL and headers 340 type HTTPInjection struct { 341 // BaseURL Base URL for matching HTTPS requests. The host is matched exactly. When a path is present, it matches the normalized request path exactly; a trailing `*` enables normalized string-prefix matching. 342 // Default scheme is https if not specified. 343 BaseURL string `json:"base_url"` 344 345 // Headers HTTP headers to inject or overwrite on matching HTTPS requests. 346 Headers *map[string]string `json:"headers,omitempty"` 347 348 // IfHeaders Optional HTTP request headers that must already be present with exact values before this injection matches. Header names are matched case-insensitively; repeated headers compare only their first value. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set request headers. 349 IfHeaders *map[string]string `json:"if_headers,omitempty"` 350 351 // IfQueries Optional query parameters that must already be present with exact values before this injection matches. Query parameter names are case-sensitive. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set query parameters. 352 IfQueries *map[string]string `json:"if_queries,omitempty"` 353 354 // Type Injection type identifier 355 Type HTTPInjectionType `json:"type"` 356 } 357 358 // HTTPInjectionType Injection type identifier 359 type HTTPInjectionType string 360 361 // Injection defines model for Injection. 362 type Injection struct { 363 union json.RawMessage 364 } 365 366 // InjectionByID Reference an existing injection rule by ID 367 type InjectionByID struct { 368 // ID ID of the pre-defined injection rule 369 ID string `json:"id"` 370 371 // Type Injection type identifier 372 Type InjectionByIDType `json:"type"` 373 } 374 375 // InjectionByIDType Injection type identifier 376 type InjectionByIDType string 377 378 // InjectionRule A saved injection rule that can be referenced by sandbox instances 379 type InjectionRule struct { 380 // CreatedAt Timestamp when the injection rule was created 381 CreatedAt time.Time `json:"createdAt"` 382 Injection Injection `json:"injection"` 383 384 // Name Human-readable name of the injection rule. Must be unique per user. 385 Name string `json:"name"` 386 387 // RuleID Unique identifier of the injection rule 388 RuleID string `json:"ruleID"` 389 390 // UpdatedAt Timestamp when the injection rule was last updated 391 UpdatedAt time.Time `json:"updatedAt"` 392 } 393 394 // KodoResource Kodo bucket resource mounted into the sandbox via NFS. 395 // The platform creates an NFS-backed proxy that maps the Kodo bucket to a local path inside the sandbox. 396 // Credentials (access_key/secret_key) are never exposed inside the sandbox. 397 // Note: Kodo resources require access key authentication. API key authentication is not supported. 398 type KodoResource struct { 399 // Bucket Kodo bucket name 400 Bucket string `json:"bucket"` 401 402 // MountPath Absolute path where the bucket contents should appear inside the sandbox 403 MountPath string `json:"mount_path"` 404 405 // Prefix Optional subdirectory (key prefix) within the bucket. Only the contents under this prefix are exposed. If omitted, the whole bucket root is mounted. 406 Prefix *string `json:"prefix,omitempty"` 407 408 // ReadOnly Whether the mount is read-only. Automatically set to true when AK/SK lacks write permission. Can also be set explicitly. 409 ReadOnly *bool `json:"read_only,omitempty"` 410 411 // Type Resource type identifier 412 Type KodoResourceType `json:"type"` 413 } 414 415 // KodoResourceType Resource type identifier 416 type KodoResourceType string 417 418 // ListedSandbox defines model for ListedSandbox. 419 type ListedSandbox struct { 420 // Alias Alias of the template 421 Alias *string `json:"alias,omitempty"` 422 423 // ClientID Identifier of the client 424 // Deprecated: 425 ClientID string `json:"clientID"` 426 427 // CPUCount CPU cores for the sandbox 428 CPUCount CPUCount `json:"cpuCount"` 429 430 // DiskSizeMB Disk size for the sandbox in MiB 431 DiskSizeMB DiskSizeMB `json:"diskSizeMB"` 432 433 // EndAt Time when the sandbox will expire 434 EndAt time.Time `json:"endAt"` 435 436 // EnvdVersion Version of the envd running in the sandbox 437 EnvdVersion EnvdVersion `json:"envdVersion"` 438 439 // ExecutionID Execution ID of the sandbox 440 ExecutionID *string `json:"executionId,omitempty"` 441 442 // MemoryMB Memory for the sandbox in MiB 443 MemoryMB MemoryMB `json:"memoryMB"` 444 Metadata *SandboxMetadata `json:"metadata,omitempty"` 445 446 // SandboxID Identifier of the sandbox 447 SandboxID string `json:"sandboxID"` 448 449 // StartedAt Time when the sandbox was started 450 StartedAt time.Time `json:"startedAt"` 451 452 // State State of the sandbox 453 State SandboxState `json:"state"` 454 455 // TemplateID Identifier of the template from which is the sandbox created 456 TemplateID string `json:"templateID"` 457 458 // UID 七牛用户 uid 459 UID *string `json:"uid,omitempty"` 460 } 461 462 // LogLevel State of the sandbox 463 type LogLevel string 464 465 // LogsDirection Direction of the logs that should be returned 466 type LogsDirection string 467 468 // LogsSource Source of the logs that should be returned 469 type LogsSource string 470 471 // Mcp MCP configuration for the sandbox 472 type Mcp map[string]interface{} 473 474 // MemoryMB Memory for the sandbox in MiB 475 type MemoryMB = int32 476 477 // NewInjectionRule Request body for creating a new injection rule 478 type NewInjectionRule struct { 479 Injection Injection `json:"injection"` 480 481 // Name Human-readable name of the injection rule. Must be unique per user. 482 Name string `json:"name"` 483 } 484 485 // NewSandbox defines model for NewSandbox. 486 type NewSandbox struct { 487 // AllowInternetAccess Allow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config. 488 AllowInternetAccess *bool `json:"allow_internet_access,omitempty"` 489 490 // AutoPause Automatically pauses the sandbox after the timeout 491 AutoPause *bool `json:"autoPause,omitempty"` 492 EnvVars *EnvVars `json:"envVars,omitempty"` 493 494 // Injections Injection rules to apply to outgoing HTTPS requests from the sandbox. 495 // Each item is a discriminated union with a "type" field. 496 Injections *[]SandboxInjection `json:"injections,omitempty"` 497 498 // Mcp MCP configuration for the sandbox 499 Mcp *Mcp `json:"mcp"` 500 Metadata *SandboxMetadata `json:"metadata,omitempty"` 501 Network *SandboxNetworkConfig `json:"network,omitempty"` 502 503 // Resources Resources to materialize for the sandbox before it starts. 504 // Each item is a discriminated union with a "type" field. 505 Resources *[]SandboxResource `json:"resources,omitempty"` 506 507 // Secure Secure all system communication with sandbox 508 Secure *bool `json:"secure,omitempty"` 509 510 // TemplateID Identifier of the required template 511 TemplateID string `json:"templateID"` 512 513 // Timeout Time to live for the sandbox in seconds. 514 Timeout *int32 `json:"timeout,omitempty"` 515 } 516 517 // OpenaiInjection OpenAI-compatible API injection. Automatically configures Authorization Bearer header. 518 // Default host: api.openai.com 519 type OpenaiInjection struct { 520 // APIKey API key for OpenAI-compatible APIs 521 APIKey *string `json:"api_key,omitempty"` 522 523 // BaseURL Optional base URL. If not specified, uses api.openai.com. The host is matched exactly. When a path is present, it matches the normalized request path exactly; a trailing `*` enables normalized string-prefix matching. 524 BaseURL *string `json:"base_url,omitempty"` 525 526 // IfHeaders Optional HTTP request headers that must already be present with exact values before this injection matches. Header names are matched case-insensitively; repeated headers compare only their first value. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set request headers. 527 IfHeaders *map[string]string `json:"if_headers,omitempty"` 528 529 // IfQueries Optional query parameters that must already be present with exact values before this injection matches. Query parameter names are case-sensitive. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set query parameters. 530 IfQueries *map[string]string `json:"if_queries,omitempty"` 531 532 // Type Injection type identifier 533 Type OpenaiInjectionType `json:"type"` 534 } 535 536 // OpenaiInjectionType Injection type identifier 537 type OpenaiInjectionType string 538 539 // QiniuInjection Qiniu AI API injection. Qiniu's gateway is compatible with both OpenAI and Anthropic 540 // protocols on the same host, so the api_key is injected into whichever auth header the 541 // outgoing request actually carries (Authorization or x-api-key). 542 // Default host: api.qnaigc.com 543 type QiniuInjection struct { 544 // APIKey API key for Qiniu AI API 545 APIKey *string `json:"api_key,omitempty"` 546 547 // BaseURL Optional base URL. If not specified, uses api.qnaigc.com. The host is matched exactly. When a path is present, it matches the normalized request path exactly; a trailing `*` enables normalized string-prefix matching. 548 BaseURL *string `json:"base_url,omitempty"` 549 550 // IfHeaders Optional HTTP request headers that must already be present with exact values before this injection matches. Header names are matched case-insensitively; repeated headers compare only their first value. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set request headers. 551 IfHeaders *map[string]string `json:"if_headers,omitempty"` 552 553 // IfQueries Optional query parameters that must already be present with exact values before this injection matches. Query parameter names are case-sensitive. These conditions only scope request matching and are not an authorization boundary; sandbox processes can set query parameters. 554 IfQueries *map[string]string `json:"if_queries,omitempty"` 555 556 // Type Injection type identifier 557 Type QiniuInjectionType `json:"type"` 558 } 559 560 // QiniuInjectionType Injection type identifier 561 type QiniuInjectionType string 562 563 // ResumedSandbox defines model for ResumedSandbox. 564 type ResumedSandbox struct { 565 // AutoPause Automatically pauses the sandbox after the timeout 566 // Deprecated: 567 AutoPause *bool `json:"autoPause,omitempty"` 568 569 // Timeout Time to live for the sandbox in seconds. 570 Timeout *int32 `json:"timeout,omitempty"` 571 } 572 573 // Sandbox defines model for Sandbox. 574 type Sandbox struct { 575 // Alias Alias of the template 576 Alias *string `json:"alias,omitempty"` 577 578 // ClientID Identifier of the client 579 // Deprecated: 580 ClientID string `json:"clientID"` 581 582 // Domain Base domain where the sandbox traffic is accessible 583 Domain *string `json:"domain"` 584 585 // EnvdAccessToken Access token used for envd communication 586 EnvdAccessToken *string `json:"envdAccessToken,omitempty"` 587 588 // EnvdVersion Version of the envd running in the sandbox 589 EnvdVersion EnvdVersion `json:"envdVersion"` 590 591 // SandboxID Identifier of the sandbox 592 SandboxID string `json:"sandboxID"` 593 594 // TemplateID Identifier of the template from which is the sandbox created 595 TemplateID string `json:"templateID"` 596 597 // TrafficAccessToken Token required for accessing sandbox via proxy. 598 TrafficAccessToken *string `json:"trafficAccessToken"` 599 } 600 601 // SandboxDetail defines model for SandboxDetail. 602 type SandboxDetail struct { 603 // Alias Alias of the template 604 Alias *string `json:"alias,omitempty"` 605 606 // ClientID Identifier of the client 607 // Deprecated: 608 ClientID string `json:"clientID"` 609 610 // CPUCount CPU cores for the sandbox 611 CPUCount CPUCount `json:"cpuCount"` 612 613 // DiskSizeMB Disk size for the sandbox in MiB 614 DiskSizeMB DiskSizeMB `json:"diskSizeMB"` 615 616 // Domain Base domain where the sandbox traffic is accessible 617 Domain *string `json:"domain"` 618 619 // EndAt Time when the sandbox will expire 620 EndAt time.Time `json:"endAt"` 621 622 // EnvdAccessToken Access token used for envd communication 623 EnvdAccessToken *string `json:"envdAccessToken,omitempty"` 624 625 // EnvdVersion Version of the envd running in the sandbox 626 EnvdVersion EnvdVersion `json:"envdVersion"` 627 628 // MemoryMB Memory for the sandbox in MiB 629 MemoryMB MemoryMB `json:"memoryMB"` 630 Metadata *SandboxMetadata `json:"metadata,omitempty"` 631 632 // SandboxID Identifier of the sandbox 633 SandboxID string `json:"sandboxID"` 634 635 // StartedAt Time when the sandbox was started 636 StartedAt time.Time `json:"startedAt"` 637 638 // State State of the sandbox 639 State SandboxState `json:"state"` 640 641 // TemplateID Identifier of the template from which is the sandbox created 642 TemplateID string `json:"templateID"` 643 } 644 645 // SandboxInjection defines model for SandboxInjection. 646 type SandboxInjection struct { 647 union json.RawMessage 648 } 649 650 // SandboxLog Log entry with timestamp and line 651 type SandboxLog struct { 652 // Line Log line content 653 Line string `json:"line"` 654 655 // Timestamp Timestamp of the log entry 656 Timestamp time.Time `json:"timestamp"` 657 } 658 659 // SandboxLogEntry defines model for SandboxLogEntry. 660 type SandboxLogEntry struct { 661 Fields map[string]string `json:"fields"` 662 663 // Level State of the sandbox 664 Level LogLevel `json:"level"` 665 666 // Message Log message content 667 Message string `json:"message"` 668 669 // Timestamp Timestamp of the log entry 670 Timestamp time.Time `json:"timestamp"` 671 } 672 673 // SandboxLogs defines model for SandboxLogs. 674 type SandboxLogs struct { 675 // LogEntries Structured logs of the sandbox 676 LogEntries []SandboxLogEntry `json:"logEntries"` 677 678 // Logs Logs of the sandbox 679 Logs []SandboxLog `json:"logs"` 680 } 681 682 // SandboxMetadata defines model for SandboxMetadata. 683 type SandboxMetadata map[string]string 684 685 // SandboxMetric Metric entry with timestamp and line 686 type SandboxMetric struct { 687 // CPUCount Number of CPU cores 688 CPUCount int32 `json:"cpuCount"` 689 690 // CPUUsedPct CPU usage percentage 691 CPUUsedPct float32 `json:"cpuUsedPct"` 692 693 // DiskTotal Total disk space in bytes 694 DiskTotal int64 `json:"diskTotal"` 695 696 // DiskUsed Disk used in bytes 697 DiskUsed int64 `json:"diskUsed"` 698 699 // MemTotal Total memory in bytes 700 MemTotal int64 `json:"memTotal"` 701 702 // MemUsed Memory used in bytes 703 MemUsed int64 `json:"memUsed"` 704 705 // Timestamp Timestamp of the metric entry 706 // Deprecated: 707 Timestamp time.Time `json:"timestamp"` 708 709 // TimestampUnix Timestamp of the metric entry in Unix time (seconds since epoch) 710 TimestampUnix int64 `json:"timestampUnix"` 711 } 712 713 // SandboxNetworkConfig defines model for SandboxNetworkConfig. 714 type SandboxNetworkConfig struct { 715 // AllowOut List of allowed CIDR blocks or IP addresses for egress traffic. Allowed addresses always take precedence over blocked addresses. 716 AllowOut *[]string `json:"allowOut,omitempty"` 717 718 // AllowPublicTraffic Specify if the sandbox URLs should be accessible only with authentication. 719 AllowPublicTraffic *bool `json:"allowPublicTraffic,omitempty"` 720 721 // DenyOut List of denied CIDR blocks or IP addresses for egress traffic 722 DenyOut *[]string `json:"denyOut,omitempty"` 723 724 // MaskRequestHost Specify host mask which will be used for all sandbox requests 725 MaskRequestHost *string `json:"maskRequestHost,omitempty"` 726 } 727 728 // SandboxResource defines model for SandboxResource. 729 type SandboxResource struct { 730 union json.RawMessage 731 } 732 733 // SandboxState State of the sandbox 734 type SandboxState string 735 736 // SandboxesWithMetrics defines model for SandboxesWithMetrics. 737 type SandboxesWithMetrics struct { 738 Sandboxes map[string]SandboxMetric `json:"sandboxes"` 739 } 740 741 // TeamUser defines model for TeamUser. 742 type TeamUser struct { 743 // Email Email of the user 744 Email string `json:"email"` 745 746 // ID Identifier of the user 747 ID openapi_types.UUID `json:"id"` 748 } 749 750 // Template defines model for Template. 751 type Template struct { 752 // Aliases Aliases of the template (deprecated) 753 // Deprecated: 754 Aliases []string `json:"aliases"` 755 756 // BuildCount Number of times the template was built 757 BuildCount int32 `json:"buildCount"` 758 759 // BuildID Identifier of the last successful build for given template 760 BuildID string `json:"buildID"` 761 762 // BuildStatus Status of the template build 763 BuildStatus TemplateBuildStatus `json:"buildStatus"` 764 765 // CPUCount CPU cores for the sandbox 766 CPUCount CPUCount `json:"cpuCount"` 767 768 // CreatedAt Time when the template was created 769 CreatedAt time.Time `json:"createdAt"` 770 CreatedBy *TeamUser `json:"createdBy"` 771 772 // DiskSizeMB Disk size for the sandbox in MiB 773 DiskSizeMB DiskSizeMB `json:"diskSizeMB"` 774 775 // EnvdVersion Version of the envd running in the sandbox 776 EnvdVersion EnvdVersion `json:"envdVersion"` 777 778 // LastSpawnedAt Time when the template was last used 779 LastSpawnedAt *time.Time `json:"lastSpawnedAt"` 780 781 // MemoryMB Memory for the sandbox in MiB 782 MemoryMB MemoryMB `json:"memoryMB"` 783 784 // Names Names of the template (namespace/alias format when namespaced) 785 Names []string `json:"names"` 786 787 // Public Whether the template is public or only accessible by the team 788 Public bool `json:"public"` 789 790 // SpawnCount Number of times the template was used 791 SpawnCount int64 `json:"spawnCount"` 792 793 // TemplateID Identifier of the template 794 TemplateID string `json:"templateID"` 795 796 // UpdatedAt Time when the template was last updated 797 UpdatedAt time.Time `json:"updatedAt"` 798 } 799 800 // TemplateAliasResponse defines model for TemplateAliasResponse. 801 type TemplateAliasResponse struct { 802 // Public Whether the template is public or only accessible by the team 803 Public bool `json:"public"` 804 805 // TemplateID Identifier of the template 806 TemplateID string `json:"templateID"` 807 } 808 809 // TemplateBuild defines model for TemplateBuild. 810 type TemplateBuild struct { 811 // BuildID Identifier of the build 812 BuildID openapi_types.UUID `json:"buildID"` 813 814 // CPUCount CPU cores for the sandbox 815 CPUCount CPUCount `json:"cpuCount"` 816 817 // CreatedAt Time when the build was created 818 CreatedAt time.Time `json:"createdAt"` 819 820 // DiskSizeMB Disk size for the sandbox in MiB 821 DiskSizeMB *DiskSizeMB `json:"diskSizeMB,omitempty"` 822 823 // EnvdVersion Version of the envd running in the sandbox 824 EnvdVersion *EnvdVersion `json:"envdVersion,omitempty"` 825 826 // FinishedAt Time when the build was finished 827 FinishedAt *time.Time `json:"finishedAt,omitempty"` 828 829 // MemoryMB Memory for the sandbox in MiB 830 MemoryMB MemoryMB `json:"memoryMB"` 831 832 // ObjectStorageBytes Total bytes used in object storage for this build 833 ObjectStorageBytes *int64 `json:"objectStorageBytes,omitempty"` 834 835 // Status Status of the template build 836 Status TemplateBuildStatus `json:"status"` 837 838 // UpdatedAt Time when the build was last updated 839 UpdatedAt time.Time `json:"updatedAt"` 840 } 841 842 // TemplateBuildFileUpload defines model for TemplateBuildFileUpload. 843 type TemplateBuildFileUpload struct { 844 // Present Whether the file is already present in the cache 845 Present bool `json:"present"` 846 847 // URL Url where the file should be uploaded to 848 URL *string `json:"url,omitempty"` 849 } 850 851 // TemplateBuildInfo defines model for TemplateBuildInfo. 852 type TemplateBuildInfo struct { 853 // BuildID Identifier of the build 854 BuildID string `json:"buildID"` 855 856 // LogEntries Build logs structured 857 LogEntries []BuildLogEntry `json:"logEntries"` 858 859 // Logs Build logs 860 Logs []string `json:"logs"` 861 Reason *BuildStatusReason `json:"reason,omitempty"` 862 863 // Status Status of the template build 864 Status TemplateBuildStatus `json:"status"` 865 866 // TemplateID Identifier of the template 867 TemplateID string `json:"templateID"` 868 } 869 870 // TemplateBuildLogsResponse defines model for TemplateBuildLogsResponse. 871 type TemplateBuildLogsResponse struct { 872 // Logs Build logs structured 873 Logs []BuildLogEntry `json:"logs"` 874 } 875 876 // TemplateBuildRequest defines model for TemplateBuildRequest. 877 type TemplateBuildRequest struct { 878 // Alias Alias of the template 879 Alias *string `json:"alias,omitempty"` 880 881 // CPUCount CPU cores for the sandbox 882 CPUCount *CPUCount `json:"cpuCount,omitempty"` 883 884 // Dockerfile Dockerfile for the template 885 Dockerfile string `json:"dockerfile"` 886 887 // MemoryMB Memory for the sandbox in MiB 888 MemoryMB *MemoryMB `json:"memoryMB,omitempty"` 889 890 // ReadyCmd Ready check command to execute in the template after the build 891 ReadyCmd *string `json:"readyCmd,omitempty"` 892 893 // StartCmd Start command to execute in the template after the build 894 StartCmd *string `json:"startCmd,omitempty"` 895 896 // TeamID Identifier of the team 897 TeamID *string `json:"teamID,omitempty"` 898 } 899 900 // TemplateBuildRequestV2 defines model for TemplateBuildRequestV2. 901 type TemplateBuildRequestV2 struct { 902 // Alias Alias of the template 903 Alias string `json:"alias"` 904 905 // CPUCount CPU cores for the sandbox 906 CPUCount *CPUCount `json:"cpuCount,omitempty"` 907 908 // MemoryMB Memory for the sandbox in MiB 909 MemoryMB *MemoryMB `json:"memoryMB,omitempty"` 910 911 // TeamID Identifier of the team 912 // Deprecated: 913 TeamID *string `json:"teamID,omitempty"` 914 } 915 916 // TemplateBuildRequestV3 defines model for TemplateBuildRequestV3. 917 type TemplateBuildRequestV3 struct { 918 // Alias Alias of the template. Deprecated, use name instead. 919 // Deprecated: 920 Alias *string `json:"alias,omitempty"` 921 922 // CPUCount CPU cores for the sandbox 923 CPUCount *CPUCount `json:"cpuCount,omitempty"` 924 925 // MemoryMB Memory for the sandbox in MiB 926 MemoryMB *MemoryMB `json:"memoryMB,omitempty"` 927 928 // Name Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array. 929 Name *string `json:"name,omitempty"` 930 931 // Tags Tags to assign to the template build 932 Tags *[]string `json:"tags,omitempty"` 933 934 // TeamID Identifier of the team 935 // Deprecated: 936 TeamID *string `json:"teamID,omitempty"` 937 } 938 939 // TemplateBuildStartV2 defines model for TemplateBuildStartV2. 940 type TemplateBuildStartV2 struct { 941 // Force Whether the whole build should be forced to run regardless of the cache 942 Force *bool `json:"force,omitempty"` 943 944 // FromImage Image to use as a base for the template build 945 FromImage *string `json:"fromImage,omitempty"` 946 FromImageRegistry *FromImageRegistry `json:"fromImageRegistry,omitempty"` 947 948 // FromTemplate Template to use as a base for the template build 949 FromTemplate *string `json:"fromTemplate,omitempty"` 950 951 // ReadyCmd Ready check command to execute in the template after the build 952 ReadyCmd *string `json:"readyCmd,omitempty"` 953 954 // StartCmd Start command to execute in the template after the build 955 StartCmd *string `json:"startCmd,omitempty"` 956 957 // Steps List of steps to execute in the template build 958 Steps *[]TemplateStep `json:"steps,omitempty"` 959 } 960 961 // TemplateBuildStatus Status of the template build 962 type TemplateBuildStatus string 963 964 // TemplateLegacy defines model for TemplateLegacy. 965 type TemplateLegacy struct { 966 // Aliases Aliases of the template 967 Aliases []string `json:"aliases"` 968 969 // BuildCount Number of times the template was built 970 BuildCount int32 `json:"buildCount"` 971 972 // BuildID Identifier of the last successful build for given template 973 BuildID string `json:"buildID"` 974 975 // CPUCount CPU cores for the sandbox 976 CPUCount CPUCount `json:"cpuCount"` 977 978 // CreatedAt Time when the template was created 979 CreatedAt time.Time `json:"createdAt"` 980 CreatedBy *TeamUser `json:"createdBy"` 981 982 // DiskSizeMB Disk size for the sandbox in MiB 983 DiskSizeMB DiskSizeMB `json:"diskSizeMB"` 984 985 // EnvdVersion Version of the envd running in the sandbox 986 EnvdVersion EnvdVersion `json:"envdVersion"` 987 988 // LastSpawnedAt Time when the template was last used 989 LastSpawnedAt *time.Time `json:"lastSpawnedAt"` 990 991 // MemoryMB Memory for the sandbox in MiB 992 MemoryMB MemoryMB `json:"memoryMB"` 993 994 // Public Whether the template is public or only accessible by the team 995 Public bool `json:"public"` 996 997 // SpawnCount Number of times the template was used 998 SpawnCount int64 `json:"spawnCount"` 999 1000 // TemplateID Identifier of the template 1001 TemplateID string `json:"templateID"` 1002 1003 // UpdatedAt Time when the template was last updated 1004 UpdatedAt time.Time `json:"updatedAt"` 1005 } 1006 1007 // TemplateRequestResponseV3 defines model for TemplateRequestResponseV3. 1008 type TemplateRequestResponseV3 struct { 1009 // Aliases Aliases of the template 1010 // Deprecated: 1011 Aliases []string `json:"aliases"` 1012 1013 // BuildID Identifier of the last successful build for given template 1014 BuildID string `json:"buildID"` 1015 1016 // Names Names of the template 1017 Names []string `json:"names"` 1018 1019 // Public Whether the template is public or only accessible by the team 1020 Public bool `json:"public"` 1021 1022 // Tags Tags assigned to the template build 1023 Tags []string `json:"tags"` 1024 1025 // TemplateID Identifier of the template 1026 TemplateID string `json:"templateID"` 1027 } 1028 1029 // TemplateStep Step in the template build process 1030 type TemplateStep struct { 1031 // Args Arguments for the step 1032 Args *[]string `json:"args,omitempty"` 1033 1034 // FilesHash Hash of the files used in the step 1035 FilesHash *string `json:"filesHash,omitempty"` 1036 1037 // Force Whether the step should be forced to run regardless of the cache 1038 Force *bool `json:"force,omitempty"` 1039 1040 // Type Type of the step 1041 Type string `json:"type"` 1042 } 1043 1044 // TemplateUpdateRequest defines model for TemplateUpdateRequest. 1045 type TemplateUpdateRequest struct { 1046 // Public Whether the template is public or only accessible by the team 1047 Public *bool `json:"public,omitempty"` 1048 } 1049 1050 // TemplateWithBuilds defines model for TemplateWithBuilds. 1051 type TemplateWithBuilds struct { 1052 // Aliases Aliases of the template (deprecated) 1053 // Deprecated: 1054 Aliases []string `json:"aliases"` 1055 1056 // Builds List of builds for the template (empty for non-owning teams) 1057 Builds []TemplateBuild `json:"builds"` 1058 1059 // CreatedAt Time when the template was created 1060 CreatedAt time.Time `json:"createdAt"` 1061 1062 // IsOwner Whether the template is owned by the requesting team 1063 IsOwner bool `json:"isOwner"` 1064 1065 // LastSpawnedAt Time when the template was last used 1066 LastSpawnedAt *time.Time `json:"lastSpawnedAt"` 1067 1068 // Names Names of the template (namespace/alias format when namespaced) 1069 Names []string `json:"names"` 1070 1071 // Public Whether the template is public or only accessible by the team 1072 Public bool `json:"public"` 1073 1074 // SpawnCount Number of times the template was used 1075 SpawnCount int64 `json:"spawnCount"` 1076 1077 // TemplateID Identifier of the template 1078 TemplateID string `json:"templateID"` 1079 1080 // UpdatedAt Time when the template was last updated 1081 UpdatedAt time.Time `json:"updatedAt"` 1082 } 1083 1084 // UpdateInjectionRule Request body for updating an existing injection rule 1085 type UpdateInjectionRule struct { 1086 Injection *Injection `json:"injection,omitempty"` 1087 1088 // Name Human-readable name of the injection rule. Must be unique per user. 1089 Name *string `json:"name,omitempty"` 1090 } 1091 1092 // BuildID defines model for buildID. 1093 type BuildID = string 1094 1095 // InjectionRuleID defines model for injectionRuleID. 1096 type InjectionRuleID = string 1097 1098 // PaginationLimit defines model for paginationLimit. 1099 type PaginationLimit = int32 1100 1101 // PaginationNextToken defines model for paginationNextToken. 1102 type PaginationNextToken = string 1103 1104 // SandboxID defines model for sandboxID. 1105 type SandboxID = string 1106 1107 // TemplateID defines model for templateID. 1108 type TemplateID = string 1109 1110 // N400 defines model for 400. 1111 type N400 = Error 1112 1113 // N401 defines model for 401. 1114 type N401 = Error 1115 1116 // N403 defines model for 403. 1117 type N403 = Error 1118 1119 // N404 defines model for 404. 1120 type N404 = Error 1121 1122 // N409 defines model for 409. 1123 type N409 = Error 1124 1125 // N500 defines model for 500. 1126 type N500 = Error 1127 1128 // ListSandboxesParams defines parameters for ListSandboxes. 1129 type ListSandboxesParams struct { 1130 // Metadata Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded. 1131 Metadata *string `form:"metadata,omitempty" json:"metadata,omitempty"` 1132 } 1133 1134 // CreateSandboxParams defines parameters for CreateSandbox. 1135 type CreateSandboxParams struct { 1136 // IdempotencyKey Identifies one logical sandbox creation within the authenticated team. Retry an uncertain request with the same key and request body. 1137 IdempotencyKey *string `json:"Idempotency-Key,omitempty"` 1138 } 1139 1140 // GetSandboxesMetricsParams defines parameters for GetSandboxesMetrics. 1141 type GetSandboxesMetricsParams struct { 1142 // SandboxIds Comma-separated list of sandbox IDs to get metrics for 1143 SandboxIds []string `form:"sandbox_ids" json:"sandbox_ids"` 1144 } 1145 1146 // UpdateSandboxGithubTokenJSONBody defines parameters for UpdateSandboxGithubToken. 1147 type UpdateSandboxGithubTokenJSONBody struct { 1148 // AuthorizationToken New GitHub authorization token 1149 AuthorizationToken string `json:"authorization_token"` 1150 } 1151 1152 // UpdateSandboxInjectionsJSONBody defines parameters for UpdateSandboxInjections. 1153 type UpdateSandboxInjectionsJSONBody struct { 1154 // Injections New injection rules. Fully replaces the existing configuration. 1155 Injections []SandboxInjection `json:"injections"` 1156 } 1157 1158 // GetSandboxLogsParams defines parameters for GetSandboxLogs. 1159 type GetSandboxLogsParams struct { 1160 // Start Starting timestamp of the logs that should be returned in milliseconds 1161 Start *int64 `form:"start,omitempty" json:"start,omitempty"` 1162 1163 // Limit Maximum number of logs that should be returned 1164 Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"` 1165 } 1166 1167 // GetSandboxMetricsParams defines parameters for GetSandboxMetrics. 1168 type GetSandboxMetricsParams struct { 1169 // Start Unix timestamp for the start of the interval, in seconds, for which the metrics 1170 Start *int64 `form:"start,omitempty" json:"start,omitempty"` 1171 End *int64 `form:"end,omitempty" json:"end,omitempty"` 1172 } 1173 1174 // RefreshSandboxJSONBody defines parameters for RefreshSandbox. 1175 type RefreshSandboxJSONBody struct { 1176 // Duration Duration for which the sandbox should be kept alive in seconds 1177 Duration *int `json:"duration,omitempty"` 1178 } 1179 1180 // UpdateSandboxTimeoutJSONBody defines parameters for UpdateSandboxTimeout. 1181 type UpdateSandboxTimeoutJSONBody struct { 1182 // Timeout Timeout in seconds from the current time after which the sandbox should expire 1183 Timeout int32 `json:"timeout"` 1184 } 1185 1186 // ListTemplatesParams defines parameters for ListTemplates. 1187 type ListTemplatesParams struct { 1188 TeamID *string `form:"teamID,omitempty" json:"teamID,omitempty"` 1189 } 1190 1191 // GetTemplateParams defines parameters for GetTemplate. 1192 type GetTemplateParams struct { 1193 // NextToken Cursor to start the list from 1194 NextToken *PaginationNextToken `form:"nextToken,omitempty" json:"nextToken,omitempty"` 1195 1196 // Limit Maximum number of items to return per page 1197 Limit *PaginationLimit `form:"limit,omitempty" json:"limit,omitempty"` 1198 } 1199 1200 // GetTemplateBuildLogsParams defines parameters for GetTemplateBuildLogs. 1201 type GetTemplateBuildLogsParams struct { 1202 // Cursor Starting timestamp of the logs that should be returned in milliseconds 1203 Cursor *int64 `form:"cursor,omitempty" json:"cursor,omitempty"` 1204 1205 // Limit Maximum number of logs that should be returned 1206 Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"` 1207 Direction *LogsDirection `form:"direction,omitempty" json:"direction,omitempty"` 1208 Level *LogLevel `form:"level,omitempty" json:"level,omitempty"` 1209 1210 // Source Source of the logs that should be returned from 1211 Source *LogsSource `form:"source,omitempty" json:"source,omitempty"` 1212 } 1213 1214 // GetTemplateBuildStatusParams defines parameters for GetTemplateBuildStatus. 1215 type GetTemplateBuildStatusParams struct { 1216 // LogsOffset Index of the starting build log that should be returned with the template 1217 LogsOffset *int32 `form:"logsOffset,omitempty" json:"logsOffset,omitempty"` 1218 1219 // Limit Maximum number of logs that should be returned 1220 Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"` 1221 Level *LogLevel `form:"level,omitempty" json:"level,omitempty"` 1222 } 1223 1224 // ListSandboxesV2Params defines parameters for ListSandboxesV2. 1225 type ListSandboxesV2Params struct { 1226 // Metadata Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded. 1227 Metadata *string `form:"metadata,omitempty" json:"metadata,omitempty"` 1228 1229 // Template Filter sandboxes by one or more template IDs or aliases. Maximum 20 values. 1230 Template *[]string `form:"template,omitempty" json:"template,omitempty"` 1231 1232 // State Filter sandboxes by one or more states 1233 State *[]SandboxState `form:"state,omitempty" json:"state,omitempty"` 1234 1235 // NextToken Cursor to start the list from 1236 NextToken *PaginationNextToken `form:"nextToken,omitempty" json:"nextToken,omitempty"` 1237 1238 // Limit Maximum number of items to return per page 1239 Limit *PaginationLimit `form:"limit,omitempty" json:"limit,omitempty"` 1240 } 1241 1242 // PostInjectionRulesJSONRequestBody defines body for PostInjectionRules for application/json ContentType. 1243 type PostInjectionRulesJSONRequestBody = NewInjectionRule 1244 1245 // PutInjectionRulesRuleIDJSONRequestBody defines body for PutInjectionRulesRuleID for application/json ContentType. 1246 type PutInjectionRulesRuleIDJSONRequestBody = UpdateInjectionRule 1247 1248 // CreateSandboxJSONRequestBody defines body for CreateSandbox for application/json ContentType. 1249 type CreateSandboxJSONRequestBody = NewSandbox 1250 1251 // ConnectSandboxJSONRequestBody defines body for ConnectSandbox for application/json ContentType. 1252 type ConnectSandboxJSONRequestBody = ConnectSandbox 1253 1254 // UpdateSandboxGithubTokenJSONRequestBody defines body for UpdateSandboxGithubToken for application/json ContentType. 1255 type UpdateSandboxGithubTokenJSONRequestBody UpdateSandboxGithubTokenJSONBody 1256 1257 // UpdateSandboxInjectionsJSONRequestBody defines body for UpdateSandboxInjections for application/json ContentType. 1258 type UpdateSandboxInjectionsJSONRequestBody UpdateSandboxInjectionsJSONBody 1259 1260 // RefreshSandboxJSONRequestBody defines body for RefreshSandbox for application/json ContentType. 1261 type RefreshSandboxJSONRequestBody RefreshSandboxJSONBody 1262 1263 // ResumeSandboxJSONRequestBody defines body for ResumeSandbox for application/json ContentType. 1264 type ResumeSandboxJSONRequestBody = ResumedSandbox 1265 1266 // UpdateSandboxTimeoutJSONRequestBody defines body for UpdateSandboxTimeout for application/json ContentType. 1267 type UpdateSandboxTimeoutJSONRequestBody UpdateSandboxTimeoutJSONBody 1268 1269 // CreateTemplateJSONRequestBody defines body for CreateTemplate for application/json ContentType. 1270 type CreateTemplateJSONRequestBody = TemplateBuildRequest 1271 1272 // DeleteTemplateTagsJSONRequestBody defines body for DeleteTemplateTags for application/json ContentType. 1273 type DeleteTemplateTagsJSONRequestBody = DeleteTemplateTagsRequest 1274 1275 // AssignTemplateTagsJSONRequestBody defines body for AssignTemplateTags for application/json ContentType. 1276 type AssignTemplateTagsJSONRequestBody = AssignTemplateTagsRequest 1277 1278 // UpdateTemplateJSONRequestBody defines body for UpdateTemplate for application/json ContentType. 1279 type UpdateTemplateJSONRequestBody = TemplateUpdateRequest 1280 1281 // RebuildTemplateJSONRequestBody defines body for RebuildTemplate for application/json ContentType. 1282 type RebuildTemplateJSONRequestBody = TemplateBuildRequest 1283 1284 // CreateTemplateV2JSONRequestBody defines body for CreateTemplateV2 for application/json ContentType. 1285 type CreateTemplateV2JSONRequestBody = TemplateBuildRequestV2 1286 1287 // StartTemplateBuildV2JSONRequestBody defines body for StartTemplateBuildV2 for application/json ContentType. 1288 type StartTemplateBuildV2JSONRequestBody = TemplateBuildStartV2 1289 1290 // CreateTemplateV3JSONRequestBody defines body for CreateTemplateV3 for application/json ContentType. 1291 type CreateTemplateV3JSONRequestBody = TemplateBuildRequestV3 1292 1293 // AsAWSRegistry returns the union data inside the FromImageRegistry as a AWSRegistry 1294 func (t FromImageRegistry) AsAWSRegistry() (AWSRegistry, error) { 1295 var body AWSRegistry 1296 err := json.Unmarshal(t.union, &body) 1297 return body, err 1298 } 1299 1300 // FromAWSRegistry overwrites any union data inside the FromImageRegistry as the provided AWSRegistry 1301 func (t *FromImageRegistry) FromAWSRegistry(v AWSRegistry) error { 1302 v.Type = "aws" 1303 b, err := json.Marshal(v) 1304 t.union = b 1305 return err 1306 } 1307 1308 // MergeAWSRegistry performs a merge with any union data inside the FromImageRegistry, using the provided AWSRegistry 1309 func (t *FromImageRegistry) MergeAWSRegistry(v AWSRegistry) error { 1310 v.Type = "aws" 1311 b, err := json.Marshal(v) 1312 if err != nil { 1313 return err 1314 } 1315 1316 merged, err := runtime.JSONMerge(t.union, b) 1317 t.union = merged 1318 return err 1319 } 1320 1321 // AsGCPRegistry returns the union data inside the FromImageRegistry as a GCPRegistry 1322 func (t FromImageRegistry) AsGCPRegistry() (GCPRegistry, error) { 1323 var body GCPRegistry 1324 err := json.Unmarshal(t.union, &body) 1325 return body, err 1326 } 1327 1328 // FromGCPRegistry overwrites any union data inside the FromImageRegistry as the provided GCPRegistry 1329 func (t *FromImageRegistry) FromGCPRegistry(v GCPRegistry) error { 1330 v.Type = "gcp" 1331 b, err := json.Marshal(v) 1332 t.union = b 1333 return err 1334 } 1335 1336 // MergeGCPRegistry performs a merge with any union data inside the FromImageRegistry, using the provided GCPRegistry 1337 func (t *FromImageRegistry) MergeGCPRegistry(v GCPRegistry) error { 1338 v.Type = "gcp" 1339 b, err := json.Marshal(v) 1340 if err != nil { 1341 return err 1342 } 1343 1344 merged, err := runtime.JSONMerge(t.union, b) 1345 t.union = merged 1346 return err 1347 } 1348 1349 // AsGeneralRegistry returns the union data inside the FromImageRegistry as a GeneralRegistry 1350 func (t FromImageRegistry) AsGeneralRegistry() (GeneralRegistry, error) { 1351 var body GeneralRegistry 1352 err := json.Unmarshal(t.union, &body) 1353 return body, err 1354 } 1355 1356 // FromGeneralRegistry overwrites any union data inside the FromImageRegistry as the provided GeneralRegistry 1357 func (t *FromImageRegistry) FromGeneralRegistry(v GeneralRegistry) error { 1358 v.Type = "registry" 1359 b, err := json.Marshal(v) 1360 t.union = b 1361 return err 1362 } 1363 1364 // MergeGeneralRegistry performs a merge with any union data inside the FromImageRegistry, using the provided GeneralRegistry 1365 func (t *FromImageRegistry) MergeGeneralRegistry(v GeneralRegistry) error { 1366 v.Type = "registry" 1367 b, err := json.Marshal(v) 1368 if err != nil { 1369 return err 1370 } 1371 1372 merged, err := runtime.JSONMerge(t.union, b) 1373 t.union = merged 1374 return err 1375 } 1376 1377 func (t FromImageRegistry) Discriminator() (string, error) { 1378 var discriminator struct { 1379 Discriminator string `json:"type"` 1380 } 1381 err := json.Unmarshal(t.union, &discriminator) 1382 return discriminator.Discriminator, err 1383 } 1384 1385 func (t FromImageRegistry) ValueByDiscriminator() (interface{}, error) { 1386 discriminator, err := t.Discriminator() 1387 if err != nil { 1388 return nil, err 1389 } 1390 switch discriminator { 1391 case "aws": 1392 return t.AsAWSRegistry() 1393 case "gcp": 1394 return t.AsGCPRegistry() 1395 case "registry": 1396 return t.AsGeneralRegistry() 1397 default: 1398 return nil, errors.New("unknown discriminator value: " + discriminator) 1399 } 1400 } 1401 1402 func (t FromImageRegistry) MarshalJSON() ([]byte, error) { 1403 b, err := t.union.MarshalJSON() 1404 return b, err 1405 } 1406 1407 func (t *FromImageRegistry) UnmarshalJSON(b []byte) error { 1408 err := t.union.UnmarshalJSON(b) 1409 return err 1410 } 1411 1412 // AsHTTPInjection returns the union data inside the Injection as a HTTPInjection 1413 func (t Injection) AsHTTPInjection() (HTTPInjection, error) { 1414 var body HTTPInjection 1415 err := json.Unmarshal(t.union, &body) 1416 return body, err 1417 } 1418 1419 // FromHTTPInjection overwrites any union data inside the Injection as the provided HTTPInjection 1420 func (t *Injection) FromHTTPInjection(v HTTPInjection) error { 1421 v.Type = "http" 1422 b, err := json.Marshal(v) 1423 t.union = b 1424 return err 1425 } 1426 1427 // MergeHTTPInjection performs a merge with any union data inside the Injection, using the provided HTTPInjection 1428 func (t *Injection) MergeHTTPInjection(v HTTPInjection) error { 1429 v.Type = "http" 1430 b, err := json.Marshal(v) 1431 if err != nil { 1432 return err 1433 } 1434 1435 merged, err := runtime.JSONMerge(t.union, b) 1436 t.union = merged 1437 return err 1438 } 1439 1440 // AsOpenaiInjection returns the union data inside the Injection as a OpenaiInjection 1441 func (t Injection) AsOpenaiInjection() (OpenaiInjection, error) { 1442 var body OpenaiInjection 1443 err := json.Unmarshal(t.union, &body) 1444 return body, err 1445 } 1446 1447 // FromOpenaiInjection overwrites any union data inside the Injection as the provided OpenaiInjection 1448 func (t *Injection) FromOpenaiInjection(v OpenaiInjection) error { 1449 v.Type = "openai" 1450 b, err := json.Marshal(v) 1451 t.union = b 1452 return err 1453 } 1454 1455 // MergeOpenaiInjection performs a merge with any union data inside the Injection, using the provided OpenaiInjection 1456 func (t *Injection) MergeOpenaiInjection(v OpenaiInjection) error { 1457 v.Type = "openai" 1458 b, err := json.Marshal(v) 1459 if err != nil { 1460 return err 1461 } 1462 1463 merged, err := runtime.JSONMerge(t.union, b) 1464 t.union = merged 1465 return err 1466 } 1467 1468 // AsAnthropicInjection returns the union data inside the Injection as a AnthropicInjection 1469 func (t Injection) AsAnthropicInjection() (AnthropicInjection, error) { 1470 var body AnthropicInjection 1471 err := json.Unmarshal(t.union, &body) 1472 return body, err 1473 } 1474 1475 // FromAnthropicInjection overwrites any union data inside the Injection as the provided AnthropicInjection 1476 func (t *Injection) FromAnthropicInjection(v AnthropicInjection) error { 1477 v.Type = "anthropic" 1478 b, err := json.Marshal(v) 1479 t.union = b 1480 return err 1481 } 1482 1483 // MergeAnthropicInjection performs a merge with any union data inside the Injection, using the provided AnthropicInjection 1484 func (t *Injection) MergeAnthropicInjection(v AnthropicInjection) error { 1485 v.Type = "anthropic" 1486 b, err := json.Marshal(v) 1487 if err != nil { 1488 return err 1489 } 1490 1491 merged, err := runtime.JSONMerge(t.union, b) 1492 t.union = merged 1493 return err 1494 } 1495 1496 // AsGeminiInjection returns the union data inside the Injection as a GeminiInjection 1497 func (t Injection) AsGeminiInjection() (GeminiInjection, error) { 1498 var body GeminiInjection 1499 err := json.Unmarshal(t.union, &body) 1500 return body, err 1501 } 1502 1503 // FromGeminiInjection overwrites any union data inside the Injection as the provided GeminiInjection 1504 func (t *Injection) FromGeminiInjection(v GeminiInjection) error { 1505 v.Type = "gemini" 1506 b, err := json.Marshal(v) 1507 t.union = b 1508 return err 1509 } 1510 1511 // MergeGeminiInjection performs a merge with any union data inside the Injection, using the provided GeminiInjection 1512 func (t *Injection) MergeGeminiInjection(v GeminiInjection) error { 1513 v.Type = "gemini" 1514 b, err := json.Marshal(v) 1515 if err != nil { 1516 return err 1517 } 1518 1519 merged, err := runtime.JSONMerge(t.union, b) 1520 t.union = merged 1521 return err 1522 } 1523 1524 // AsQiniuInjection returns the union data inside the Injection as a QiniuInjection 1525 func (t Injection) AsQiniuInjection() (QiniuInjection, error) { 1526 var body QiniuInjection 1527 err := json.Unmarshal(t.union, &body) 1528 return body, err 1529 } 1530 1531 // FromQiniuInjection overwrites any union data inside the Injection as the provided QiniuInjection 1532 func (t *Injection) FromQiniuInjection(v QiniuInjection) error { 1533 v.Type = "qiniu" 1534 b, err := json.Marshal(v) 1535 t.union = b 1536 return err 1537 } 1538 1539 // MergeQiniuInjection performs a merge with any union data inside the Injection, using the provided QiniuInjection 1540 func (t *Injection) MergeQiniuInjection(v QiniuInjection) error { 1541 v.Type = "qiniu" 1542 b, err := json.Marshal(v) 1543 if err != nil { 1544 return err 1545 } 1546 1547 merged, err := runtime.JSONMerge(t.union, b) 1548 t.union = merged 1549 return err 1550 } 1551 1552 // AsGithubInjection returns the union data inside the Injection as a GithubInjection 1553 func (t Injection) AsGithubInjection() (GithubInjection, error) { 1554 var body GithubInjection 1555 err := json.Unmarshal(t.union, &body) 1556 return body, err 1557 } 1558 1559 // FromGithubInjection overwrites any union data inside the Injection as the provided GithubInjection 1560 func (t *Injection) FromGithubInjection(v GithubInjection) error { 1561 v.Type = "github" 1562 b, err := json.Marshal(v) 1563 t.union = b 1564 return err 1565 } 1566 1567 // MergeGithubInjection performs a merge with any union data inside the Injection, using the provided GithubInjection 1568 func (t *Injection) MergeGithubInjection(v GithubInjection) error { 1569 v.Type = "github" 1570 b, err := json.Marshal(v) 1571 if err != nil { 1572 return err 1573 } 1574 1575 merged, err := runtime.JSONMerge(t.union, b) 1576 t.union = merged 1577 return err 1578 } 1579 1580 func (t Injection) Discriminator() (string, error) { 1581 var discriminator struct { 1582 Discriminator string `json:"type"` 1583 } 1584 err := json.Unmarshal(t.union, &discriminator) 1585 return discriminator.Discriminator, err 1586 } 1587 1588 func (t Injection) ValueByDiscriminator() (interface{}, error) { 1589 discriminator, err := t.Discriminator() 1590 if err != nil { 1591 return nil, err 1592 } 1593 switch discriminator { 1594 case "anthropic": 1595 return t.AsAnthropicInjection() 1596 case "gemini": 1597 return t.AsGeminiInjection() 1598 case "github": 1599 return t.AsGithubInjection() 1600 case "http": 1601 return t.AsHTTPInjection() 1602 case "openai": 1603 return t.AsOpenaiInjection() 1604 case "qiniu": 1605 return t.AsQiniuInjection() 1606 default: 1607 return nil, errors.New("unknown discriminator value: " + discriminator) 1608 } 1609 } 1610 1611 func (t Injection) MarshalJSON() ([]byte, error) { 1612 b, err := t.union.MarshalJSON() 1613 return b, err 1614 } 1615 1616 func (t *Injection) UnmarshalJSON(b []byte) error { 1617 err := t.union.UnmarshalJSON(b) 1618 return err 1619 } 1620 1621 // AsInjectionByID returns the union data inside the SandboxInjection as a InjectionByID 1622 func (t SandboxInjection) AsInjectionByID() (InjectionByID, error) { 1623 var body InjectionByID 1624 err := json.Unmarshal(t.union, &body) 1625 return body, err 1626 } 1627 1628 // FromInjectionByID overwrites any union data inside the SandboxInjection as the provided InjectionByID 1629 func (t *SandboxInjection) FromInjectionByID(v InjectionByID) error { 1630 v.Type = "id" 1631 b, err := json.Marshal(v) 1632 t.union = b 1633 return err 1634 } 1635 1636 // MergeInjectionByID performs a merge with any union data inside the SandboxInjection, using the provided InjectionByID 1637 func (t *SandboxInjection) MergeInjectionByID(v InjectionByID) error { 1638 v.Type = "id" 1639 b, err := json.Marshal(v) 1640 if err != nil { 1641 return err 1642 } 1643 1644 merged, err := runtime.JSONMerge(t.union, b) 1645 t.union = merged 1646 return err 1647 } 1648 1649 // AsHTTPInjection returns the union data inside the SandboxInjection as a HTTPInjection 1650 func (t SandboxInjection) AsHTTPInjection() (HTTPInjection, error) { 1651 var body HTTPInjection 1652 err := json.Unmarshal(t.union, &body) 1653 return body, err 1654 } 1655 1656 // FromHTTPInjection overwrites any union data inside the SandboxInjection as the provided HTTPInjection 1657 func (t *SandboxInjection) FromHTTPInjection(v HTTPInjection) error { 1658 v.Type = "http" 1659 b, err := json.Marshal(v) 1660 t.union = b 1661 return err 1662 } 1663 1664 // MergeHTTPInjection performs a merge with any union data inside the SandboxInjection, using the provided HTTPInjection 1665 func (t *SandboxInjection) MergeHTTPInjection(v HTTPInjection) error { 1666 v.Type = "http" 1667 b, err := json.Marshal(v) 1668 if err != nil { 1669 return err 1670 } 1671 1672 merged, err := runtime.JSONMerge(t.union, b) 1673 t.union = merged 1674 return err 1675 } 1676 1677 // AsOpenaiInjection returns the union data inside the SandboxInjection as a OpenaiInjection 1678 func (t SandboxInjection) AsOpenaiInjection() (OpenaiInjection, error) { 1679 var body OpenaiInjection 1680 err := json.Unmarshal(t.union, &body) 1681 return body, err 1682 } 1683 1684 // FromOpenaiInjection overwrites any union data inside the SandboxInjection as the provided OpenaiInjection 1685 func (t *SandboxInjection) FromOpenaiInjection(v OpenaiInjection) error { 1686 v.Type = "openai" 1687 b, err := json.Marshal(v) 1688 t.union = b 1689 return err 1690 } 1691 1692 // MergeOpenaiInjection performs a merge with any union data inside the SandboxInjection, using the provided OpenaiInjection 1693 func (t *SandboxInjection) MergeOpenaiInjection(v OpenaiInjection) error { 1694 v.Type = "openai" 1695 b, err := json.Marshal(v) 1696 if err != nil { 1697 return err 1698 } 1699 1700 merged, err := runtime.JSONMerge(t.union, b) 1701 t.union = merged 1702 return err 1703 } 1704 1705 // AsAnthropicInjection returns the union data inside the SandboxInjection as a AnthropicInjection 1706 func (t SandboxInjection) AsAnthropicInjection() (AnthropicInjection, error) { 1707 var body AnthropicInjection 1708 err := json.Unmarshal(t.union, &body) 1709 return body, err 1710 } 1711 1712 // FromAnthropicInjection overwrites any union data inside the SandboxInjection as the provided AnthropicInjection 1713 func (t *SandboxInjection) FromAnthropicInjection(v AnthropicInjection) error { 1714 v.Type = "anthropic" 1715 b, err := json.Marshal(v) 1716 t.union = b 1717 return err 1718 } 1719 1720 // MergeAnthropicInjection performs a merge with any union data inside the SandboxInjection, using the provided AnthropicInjection 1721 func (t *SandboxInjection) MergeAnthropicInjection(v AnthropicInjection) error { 1722 v.Type = "anthropic" 1723 b, err := json.Marshal(v) 1724 if err != nil { 1725 return err 1726 } 1727 1728 merged, err := runtime.JSONMerge(t.union, b) 1729 t.union = merged 1730 return err 1731 } 1732 1733 // AsGeminiInjection returns the union data inside the SandboxInjection as a GeminiInjection 1734 func (t SandboxInjection) AsGeminiInjection() (GeminiInjection, error) { 1735 var body GeminiInjection 1736 err := json.Unmarshal(t.union, &body) 1737 return body, err 1738 } 1739 1740 // FromGeminiInjection overwrites any union data inside the SandboxInjection as the provided GeminiInjection 1741 func (t *SandboxInjection) FromGeminiInjection(v GeminiInjection) error { 1742 v.Type = "gemini" 1743 b, err := json.Marshal(v) 1744 t.union = b 1745 return err 1746 } 1747 1748 // MergeGeminiInjection performs a merge with any union data inside the SandboxInjection, using the provided GeminiInjection 1749 func (t *SandboxInjection) MergeGeminiInjection(v GeminiInjection) error { 1750 v.Type = "gemini" 1751 b, err := json.Marshal(v) 1752 if err != nil { 1753 return err 1754 } 1755 1756 merged, err := runtime.JSONMerge(t.union, b) 1757 t.union = merged 1758 return err 1759 } 1760 1761 // AsQiniuInjection returns the union data inside the SandboxInjection as a QiniuInjection 1762 func (t SandboxInjection) AsQiniuInjection() (QiniuInjection, error) { 1763 var body QiniuInjection 1764 err := json.Unmarshal(t.union, &body) 1765 return body, err 1766 } 1767 1768 // FromQiniuInjection overwrites any union data inside the SandboxInjection as the provided QiniuInjection 1769 func (t *SandboxInjection) FromQiniuInjection(v QiniuInjection) error { 1770 v.Type = "qiniu" 1771 b, err := json.Marshal(v) 1772 t.union = b 1773 return err 1774 } 1775 1776 // MergeQiniuInjection performs a merge with any union data inside the SandboxInjection, using the provided QiniuInjection 1777 func (t *SandboxInjection) MergeQiniuInjection(v QiniuInjection) error { 1778 v.Type = "qiniu" 1779 b, err := json.Marshal(v) 1780 if err != nil { 1781 return err 1782 } 1783 1784 merged, err := runtime.JSONMerge(t.union, b) 1785 t.union = merged 1786 return err 1787 } 1788 1789 // AsGithubInjection returns the union data inside the SandboxInjection as a GithubInjection 1790 func (t SandboxInjection) AsGithubInjection() (GithubInjection, error) { 1791 var body GithubInjection 1792 err := json.Unmarshal(t.union, &body) 1793 return body, err 1794 } 1795 1796 // FromGithubInjection overwrites any union data inside the SandboxInjection as the provided GithubInjection 1797 func (t *SandboxInjection) FromGithubInjection(v GithubInjection) error { 1798 v.Type = "github" 1799 b, err := json.Marshal(v) 1800 t.union = b 1801 return err 1802 } 1803 1804 // MergeGithubInjection performs a merge with any union data inside the SandboxInjection, using the provided GithubInjection 1805 func (t *SandboxInjection) MergeGithubInjection(v GithubInjection) error { 1806 v.Type = "github" 1807 b, err := json.Marshal(v) 1808 if err != nil { 1809 return err 1810 } 1811 1812 merged, err := runtime.JSONMerge(t.union, b) 1813 t.union = merged 1814 return err 1815 } 1816 1817 func (t SandboxInjection) Discriminator() (string, error) { 1818 var discriminator struct { 1819 Discriminator string `json:"type"` 1820 } 1821 err := json.Unmarshal(t.union, &discriminator) 1822 return discriminator.Discriminator, err 1823 } 1824 1825 func (t SandboxInjection) ValueByDiscriminator() (interface{}, error) { 1826 discriminator, err := t.Discriminator() 1827 if err != nil { 1828 return nil, err 1829 } 1830 switch discriminator { 1831 case "anthropic": 1832 return t.AsAnthropicInjection() 1833 case "gemini": 1834 return t.AsGeminiInjection() 1835 case "github": 1836 return t.AsGithubInjection() 1837 case "http": 1838 return t.AsHTTPInjection() 1839 case "id": 1840 return t.AsInjectionByID() 1841 case "openai": 1842 return t.AsOpenaiInjection() 1843 case "qiniu": 1844 return t.AsQiniuInjection() 1845 default: 1846 return nil, errors.New("unknown discriminator value: " + discriminator) 1847 } 1848 } 1849 1850 func (t SandboxInjection) MarshalJSON() ([]byte, error) { 1851 b, err := t.union.MarshalJSON() 1852 return b, err 1853 } 1854 1855 func (t *SandboxInjection) UnmarshalJSON(b []byte) error { 1856 err := t.union.UnmarshalJSON(b) 1857 return err 1858 } 1859 1860 // AsGitRepositoryResource returns the union data inside the SandboxResource as a GitRepositoryResource 1861 func (t SandboxResource) AsGitRepositoryResource() (GitRepositoryResource, error) { 1862 var body GitRepositoryResource 1863 err := json.Unmarshal(t.union, &body) 1864 return body, err 1865 } 1866 1867 // FromGitRepositoryResource overwrites any union data inside the SandboxResource as the provided GitRepositoryResource 1868 func (t *SandboxResource) FromGitRepositoryResource(v GitRepositoryResource) error { 1869 v.Type = "github_repository" 1870 b, err := json.Marshal(v) 1871 t.union = b 1872 return err 1873 } 1874 1875 // MergeGitRepositoryResource performs a merge with any union data inside the SandboxResource, using the provided GitRepositoryResource 1876 func (t *SandboxResource) MergeGitRepositoryResource(v GitRepositoryResource) error { 1877 v.Type = "github_repository" 1878 b, err := json.Marshal(v) 1879 if err != nil { 1880 return err 1881 } 1882 1883 merged, err := runtime.JSONMerge(t.union, b) 1884 t.union = merged 1885 return err 1886 } 1887 1888 // AsKodoResource returns the union data inside the SandboxResource as a KodoResource 1889 func (t SandboxResource) AsKodoResource() (KodoResource, error) { 1890 var body KodoResource 1891 err := json.Unmarshal(t.union, &body) 1892 return body, err 1893 } 1894 1895 // FromKodoResource overwrites any union data inside the SandboxResource as the provided KodoResource 1896 func (t *SandboxResource) FromKodoResource(v KodoResource) error { 1897 v.Type = "kodo" 1898 b, err := json.Marshal(v) 1899 t.union = b 1900 return err 1901 } 1902 1903 // MergeKodoResource performs a merge with any union data inside the SandboxResource, using the provided KodoResource 1904 func (t *SandboxResource) MergeKodoResource(v KodoResource) error { 1905 v.Type = "kodo" 1906 b, err := json.Marshal(v) 1907 if err != nil { 1908 return err 1909 } 1910 1911 merged, err := runtime.JSONMerge(t.union, b) 1912 t.union = merged 1913 return err 1914 } 1915 1916 func (t SandboxResource) Discriminator() (string, error) { 1917 var discriminator struct { 1918 Discriminator string `json:"type"` 1919 } 1920 err := json.Unmarshal(t.union, &discriminator) 1921 return discriminator.Discriminator, err 1922 } 1923 1924 func (t SandboxResource) ValueByDiscriminator() (interface{}, error) { 1925 discriminator, err := t.Discriminator() 1926 if err != nil { 1927 return nil, err 1928 } 1929 switch discriminator { 1930 case "github_repository": 1931 return t.AsGitRepositoryResource() 1932 case "kodo": 1933 return t.AsKodoResource() 1934 default: 1935 return nil, errors.New("unknown discriminator value: " + discriminator) 1936 } 1937 } 1938 1939 func (t SandboxResource) MarshalJSON() ([]byte, error) { 1940 b, err := t.union.MarshalJSON() 1941 return b, err 1942 } 1943 1944 func (t *SandboxResource) UnmarshalJSON(b []byte) error { 1945 err := t.union.UnmarshalJSON(b) 1946 return err 1947 } 1948 1949 // RequestEditorFn is the function signature for the RequestEditor callback function 1950 type RequestEditorFn func(ctx context.Context, req *http.Request) error 1951 1952 // Doer performs HTTP requests. 1953 // 1954 // The standard http.Client implements this interface. 1955 type HttpRequestDoer interface { 1956 Do(req *http.Request) (*http.Response, error) 1957 } 1958 1959 // Client which conforms to the OpenAPI3 specification for this service. 1960 type Client struct { 1961 // The endpoint of the server conforming to this interface, with scheme, 1962 // https://api.deepmap.com for example. This can contain a path relative 1963 // to the server, such as https://api.deepmap.com/dev-test, and all the 1964 // paths in the swagger spec will be appended to the server. 1965 Server string 1966 1967 // Doer for performing requests, typically a *http.Client with any 1968 // customized settings, such as certificate chains. 1969 Client HttpRequestDoer 1970 1971 // A list of callbacks for modifying requests which are generated before sending over 1972 // the network. 1973 RequestEditors []RequestEditorFn 1974 } 1975 1976 // ClientOption allows setting custom parameters during construction 1977 type ClientOption func(*Client) error 1978 1979 // Creates a new Client, with reasonable defaults 1980 func NewClient(server string, opts ...ClientOption) (*Client, error) { 1981 // create a client with sane default values 1982 client := Client{ 1983 Server: server, 1984 } 1985 // mutate client and add all optional params 1986 for _, o := range opts { 1987 if err := o(&client); err != nil { 1988 return nil, err 1989 } 1990 } 1991 // ensure the server URL always has a trailing slash 1992 if !strings.HasSuffix(client.Server, "/") { 1993 client.Server += "/" 1994 } 1995 // create httpClient, if not already present 1996 if client.Client == nil { 1997 client.Client = &http.Client{} 1998 } 1999 return &client, nil 2000 } 2001 2002 // WithHTTPClient allows overriding the default Doer, which is 2003 // automatically created using http.Client. This is useful for tests. 2004 func WithHTTPClient(doer HttpRequestDoer) ClientOption { 2005 return func(c *Client) error { 2006 c.Client = doer 2007 return nil 2008 } 2009 } 2010 2011 // WithRequestEditorFn allows setting up a callback function, which will be 2012 // called right before sending the request. This can be used to mutate the request. 2013 func WithRequestEditorFn(fn RequestEditorFn) ClientOption { 2014 return func(c *Client) error { 2015 c.RequestEditors = append(c.RequestEditors, fn) 2016 return nil 2017 } 2018 } 2019 2020 // The interface specification for the client above. 2021 type ClientInterface interface { 2022 // ListDefaultTemplates request 2023 ListDefaultTemplates(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) 2024 2025 // GetInjectionRules request 2026 GetInjectionRules(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) 2027 2028 // PostInjectionRulesWithBody request with any body 2029 PostInjectionRulesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2030 2031 PostInjectionRules(ctx context.Context, body PostInjectionRulesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2032 2033 // DeleteInjectionRulesRuleID request 2034 DeleteInjectionRulesRuleID(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*http.Response, error) 2035 2036 // GetInjectionRulesRuleID request 2037 GetInjectionRulesRuleID(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*http.Response, error) 2038 2039 // PutInjectionRulesRuleIDWithBody request with any body 2040 PutInjectionRulesRuleIDWithBody(ctx context.Context, ruleID InjectionRuleID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2041 2042 PutInjectionRulesRuleID(ctx context.Context, ruleID InjectionRuleID, body PutInjectionRulesRuleIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2043 2044 // ListSandboxes request 2045 ListSandboxes(ctx context.Context, params *ListSandboxesParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2046 2047 // CreateSandboxWithBody request with any body 2048 CreateSandboxWithBody(ctx context.Context, params *CreateSandboxParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2049 2050 CreateSandbox(ctx context.Context, params *CreateSandboxParams, body CreateSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2051 2052 // GetSandboxesMetrics request 2053 GetSandboxesMetrics(ctx context.Context, params *GetSandboxesMetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2054 2055 // DeleteSandbox request 2056 DeleteSandbox(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) 2057 2058 // GetSandbox request 2059 GetSandbox(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) 2060 2061 // ConnectSandboxWithBody request with any body 2062 ConnectSandboxWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2063 2064 ConnectSandbox(ctx context.Context, sandboxID SandboxID, body ConnectSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2065 2066 // UpdateSandboxGithubTokenWithBody request with any body 2067 UpdateSandboxGithubTokenWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2068 2069 UpdateSandboxGithubToken(ctx context.Context, sandboxID SandboxID, body UpdateSandboxGithubTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2070 2071 // GetSandboxInjections request 2072 GetSandboxInjections(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) 2073 2074 // UpdateSandboxInjectionsWithBody request with any body 2075 UpdateSandboxInjectionsWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2076 2077 UpdateSandboxInjections(ctx context.Context, sandboxID SandboxID, body UpdateSandboxInjectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2078 2079 // GetSandboxLogs request 2080 GetSandboxLogs(ctx context.Context, sandboxID SandboxID, params *GetSandboxLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2081 2082 // GetSandboxMetrics request 2083 GetSandboxMetrics(ctx context.Context, sandboxID SandboxID, params *GetSandboxMetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2084 2085 // PauseSandbox request 2086 PauseSandbox(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) 2087 2088 // RefreshSandboxWithBody request with any body 2089 RefreshSandboxWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2090 2091 RefreshSandbox(ctx context.Context, sandboxID SandboxID, body RefreshSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2092 2093 // ResumeSandboxWithBody request with any body 2094 ResumeSandboxWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2095 2096 ResumeSandbox(ctx context.Context, sandboxID SandboxID, body ResumeSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2097 2098 // UpdateSandboxTimeoutWithBody request with any body 2099 UpdateSandboxTimeoutWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2100 2101 UpdateSandboxTimeout(ctx context.Context, sandboxID SandboxID, body UpdateSandboxTimeoutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2102 2103 // ListTemplates request 2104 ListTemplates(ctx context.Context, params *ListTemplatesParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2105 2106 // CreateTemplateWithBody request with any body 2107 CreateTemplateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2108 2109 CreateTemplate(ctx context.Context, body CreateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2110 2111 // GetTemplateByAlias request 2112 GetTemplateByAlias(ctx context.Context, alias string, reqEditors ...RequestEditorFn) (*http.Response, error) 2113 2114 // DeleteTemplateTagsWithBody request with any body 2115 DeleteTemplateTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2116 2117 DeleteTemplateTags(ctx context.Context, body DeleteTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2118 2119 // AssignTemplateTagsWithBody request with any body 2120 AssignTemplateTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2121 2122 AssignTemplateTags(ctx context.Context, body AssignTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2123 2124 // DeleteTemplate request 2125 DeleteTemplate(ctx context.Context, templateID TemplateID, reqEditors ...RequestEditorFn) (*http.Response, error) 2126 2127 // GetTemplate request 2128 GetTemplate(ctx context.Context, templateID TemplateID, params *GetTemplateParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2129 2130 // UpdateTemplateWithBody request with any body 2131 UpdateTemplateWithBody(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2132 2133 UpdateTemplate(ctx context.Context, templateID TemplateID, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2134 2135 // RebuildTemplateWithBody request with any body 2136 RebuildTemplateWithBody(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2137 2138 RebuildTemplate(ctx context.Context, templateID TemplateID, body RebuildTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2139 2140 // StartTemplateBuild request 2141 StartTemplateBuild(ctx context.Context, templateID TemplateID, buildID BuildID, reqEditors ...RequestEditorFn) (*http.Response, error) 2142 2143 // GetTemplateBuildLogs request 2144 GetTemplateBuildLogs(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2145 2146 // GetTemplateBuildStatus request 2147 GetTemplateBuildStatus(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildStatusParams, reqEditors ...RequestEditorFn) (*http.Response, error) 2148 2149 // GetTemplateFiles request 2150 GetTemplateFiles(ctx context.Context, templateID TemplateID, hash string, reqEditors ...RequestEditorFn) (*http.Response, error) 2151 2152 // ListSandboxesV2 request 2153 ListSandboxesV2(ctx context.Context, params *ListSandboxesV2Params, reqEditors ...RequestEditorFn) (*http.Response, error) 2154 2155 // CreateTemplateV2WithBody request with any body 2156 CreateTemplateV2WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2157 2158 CreateTemplateV2(ctx context.Context, body CreateTemplateV2JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2159 2160 // StartTemplateBuildV2WithBody request with any body 2161 StartTemplateBuildV2WithBody(ctx context.Context, templateID TemplateID, buildID BuildID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2162 2163 StartTemplateBuildV2(ctx context.Context, templateID TemplateID, buildID BuildID, body StartTemplateBuildV2JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2164 2165 // CreateTemplateV3WithBody request with any body 2166 CreateTemplateV3WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) 2167 2168 CreateTemplateV3(ctx context.Context, body CreateTemplateV3JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) 2169 } 2170 2171 func (c *Client) ListDefaultTemplates(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { 2172 req, err := NewListDefaultTemplatesRequest(c.Server) 2173 if err != nil { 2174 return nil, err 2175 } 2176 req = req.WithContext(ctx) 2177 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2178 return nil, err 2179 } 2180 return c.Client.Do(req) 2181 } 2182 2183 func (c *Client) GetInjectionRules(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { 2184 req, err := NewGetInjectionRulesRequest(c.Server) 2185 if err != nil { 2186 return nil, err 2187 } 2188 req = req.WithContext(ctx) 2189 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2190 return nil, err 2191 } 2192 return c.Client.Do(req) 2193 } 2194 2195 func (c *Client) PostInjectionRulesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2196 req, err := NewPostInjectionRulesRequestWithBody(c.Server, contentType, body) 2197 if err != nil { 2198 return nil, err 2199 } 2200 req = req.WithContext(ctx) 2201 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2202 return nil, err 2203 } 2204 return c.Client.Do(req) 2205 } 2206 2207 func (c *Client) PostInjectionRules(ctx context.Context, body PostInjectionRulesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2208 req, err := NewPostInjectionRulesRequest(c.Server, body) 2209 if err != nil { 2210 return nil, err 2211 } 2212 req = req.WithContext(ctx) 2213 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2214 return nil, err 2215 } 2216 return c.Client.Do(req) 2217 } 2218 2219 func (c *Client) DeleteInjectionRulesRuleID(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2220 req, err := NewDeleteInjectionRulesRuleIDRequest(c.Server, ruleID) 2221 if err != nil { 2222 return nil, err 2223 } 2224 req = req.WithContext(ctx) 2225 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2226 return nil, err 2227 } 2228 return c.Client.Do(req) 2229 } 2230 2231 func (c *Client) GetInjectionRulesRuleID(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2232 req, err := NewGetInjectionRulesRuleIDRequest(c.Server, ruleID) 2233 if err != nil { 2234 return nil, err 2235 } 2236 req = req.WithContext(ctx) 2237 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2238 return nil, err 2239 } 2240 return c.Client.Do(req) 2241 } 2242 2243 func (c *Client) PutInjectionRulesRuleIDWithBody(ctx context.Context, ruleID InjectionRuleID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2244 req, err := NewPutInjectionRulesRuleIDRequestWithBody(c.Server, ruleID, contentType, body) 2245 if err != nil { 2246 return nil, err 2247 } 2248 req = req.WithContext(ctx) 2249 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2250 return nil, err 2251 } 2252 return c.Client.Do(req) 2253 } 2254 2255 func (c *Client) PutInjectionRulesRuleID(ctx context.Context, ruleID InjectionRuleID, body PutInjectionRulesRuleIDJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2256 req, err := NewPutInjectionRulesRuleIDRequest(c.Server, ruleID, body) 2257 if err != nil { 2258 return nil, err 2259 } 2260 req = req.WithContext(ctx) 2261 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2262 return nil, err 2263 } 2264 return c.Client.Do(req) 2265 } 2266 2267 func (c *Client) ListSandboxes(ctx context.Context, params *ListSandboxesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2268 req, err := NewListSandboxesRequest(c.Server, params) 2269 if err != nil { 2270 return nil, err 2271 } 2272 req = req.WithContext(ctx) 2273 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2274 return nil, err 2275 } 2276 return c.Client.Do(req) 2277 } 2278 2279 func (c *Client) CreateSandboxWithBody(ctx context.Context, params *CreateSandboxParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2280 req, err := NewCreateSandboxRequestWithBody(c.Server, params, contentType, body) 2281 if err != nil { 2282 return nil, err 2283 } 2284 req = req.WithContext(ctx) 2285 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2286 return nil, err 2287 } 2288 return c.Client.Do(req) 2289 } 2290 2291 func (c *Client) CreateSandbox(ctx context.Context, params *CreateSandboxParams, body CreateSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2292 req, err := NewCreateSandboxRequest(c.Server, params, body) 2293 if err != nil { 2294 return nil, err 2295 } 2296 req = req.WithContext(ctx) 2297 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2298 return nil, err 2299 } 2300 return c.Client.Do(req) 2301 } 2302 2303 func (c *Client) GetSandboxesMetrics(ctx context.Context, params *GetSandboxesMetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2304 req, err := NewGetSandboxesMetricsRequest(c.Server, params) 2305 if err != nil { 2306 return nil, err 2307 } 2308 req = req.WithContext(ctx) 2309 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2310 return nil, err 2311 } 2312 return c.Client.Do(req) 2313 } 2314 2315 func (c *Client) DeleteSandbox(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2316 req, err := NewDeleteSandboxRequest(c.Server, sandboxID) 2317 if err != nil { 2318 return nil, err 2319 } 2320 req = req.WithContext(ctx) 2321 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2322 return nil, err 2323 } 2324 return c.Client.Do(req) 2325 } 2326 2327 func (c *Client) GetSandbox(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2328 req, err := NewGetSandboxRequest(c.Server, sandboxID) 2329 if err != nil { 2330 return nil, err 2331 } 2332 req = req.WithContext(ctx) 2333 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2334 return nil, err 2335 } 2336 return c.Client.Do(req) 2337 } 2338 2339 func (c *Client) ConnectSandboxWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2340 req, err := NewConnectSandboxRequestWithBody(c.Server, sandboxID, contentType, body) 2341 if err != nil { 2342 return nil, err 2343 } 2344 req = req.WithContext(ctx) 2345 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2346 return nil, err 2347 } 2348 return c.Client.Do(req) 2349 } 2350 2351 func (c *Client) ConnectSandbox(ctx context.Context, sandboxID SandboxID, body ConnectSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2352 req, err := NewConnectSandboxRequest(c.Server, sandboxID, body) 2353 if err != nil { 2354 return nil, err 2355 } 2356 req = req.WithContext(ctx) 2357 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2358 return nil, err 2359 } 2360 return c.Client.Do(req) 2361 } 2362 2363 func (c *Client) UpdateSandboxGithubTokenWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2364 req, err := NewUpdateSandboxGithubTokenRequestWithBody(c.Server, sandboxID, contentType, body) 2365 if err != nil { 2366 return nil, err 2367 } 2368 req = req.WithContext(ctx) 2369 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2370 return nil, err 2371 } 2372 return c.Client.Do(req) 2373 } 2374 2375 func (c *Client) UpdateSandboxGithubToken(ctx context.Context, sandboxID SandboxID, body UpdateSandboxGithubTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2376 req, err := NewUpdateSandboxGithubTokenRequest(c.Server, sandboxID, body) 2377 if err != nil { 2378 return nil, err 2379 } 2380 req = req.WithContext(ctx) 2381 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2382 return nil, err 2383 } 2384 return c.Client.Do(req) 2385 } 2386 2387 func (c *Client) GetSandboxInjections(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2388 req, err := NewGetSandboxInjectionsRequest(c.Server, sandboxID) 2389 if err != nil { 2390 return nil, err 2391 } 2392 req = req.WithContext(ctx) 2393 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2394 return nil, err 2395 } 2396 return c.Client.Do(req) 2397 } 2398 2399 func (c *Client) UpdateSandboxInjectionsWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2400 req, err := NewUpdateSandboxInjectionsRequestWithBody(c.Server, sandboxID, contentType, body) 2401 if err != nil { 2402 return nil, err 2403 } 2404 req = req.WithContext(ctx) 2405 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2406 return nil, err 2407 } 2408 return c.Client.Do(req) 2409 } 2410 2411 func (c *Client) UpdateSandboxInjections(ctx context.Context, sandboxID SandboxID, body UpdateSandboxInjectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2412 req, err := NewUpdateSandboxInjectionsRequest(c.Server, sandboxID, body) 2413 if err != nil { 2414 return nil, err 2415 } 2416 req = req.WithContext(ctx) 2417 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2418 return nil, err 2419 } 2420 return c.Client.Do(req) 2421 } 2422 2423 func (c *Client) GetSandboxLogs(ctx context.Context, sandboxID SandboxID, params *GetSandboxLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2424 req, err := NewGetSandboxLogsRequest(c.Server, sandboxID, params) 2425 if err != nil { 2426 return nil, err 2427 } 2428 req = req.WithContext(ctx) 2429 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2430 return nil, err 2431 } 2432 return c.Client.Do(req) 2433 } 2434 2435 func (c *Client) GetSandboxMetrics(ctx context.Context, sandboxID SandboxID, params *GetSandboxMetricsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2436 req, err := NewGetSandboxMetricsRequest(c.Server, sandboxID, params) 2437 if err != nil { 2438 return nil, err 2439 } 2440 req = req.WithContext(ctx) 2441 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2442 return nil, err 2443 } 2444 return c.Client.Do(req) 2445 } 2446 2447 func (c *Client) PauseSandbox(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2448 req, err := NewPauseSandboxRequest(c.Server, sandboxID) 2449 if err != nil { 2450 return nil, err 2451 } 2452 req = req.WithContext(ctx) 2453 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2454 return nil, err 2455 } 2456 return c.Client.Do(req) 2457 } 2458 2459 func (c *Client) RefreshSandboxWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2460 req, err := NewRefreshSandboxRequestWithBody(c.Server, sandboxID, contentType, body) 2461 if err != nil { 2462 return nil, err 2463 } 2464 req = req.WithContext(ctx) 2465 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2466 return nil, err 2467 } 2468 return c.Client.Do(req) 2469 } 2470 2471 func (c *Client) RefreshSandbox(ctx context.Context, sandboxID SandboxID, body RefreshSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2472 req, err := NewRefreshSandboxRequest(c.Server, sandboxID, body) 2473 if err != nil { 2474 return nil, err 2475 } 2476 req = req.WithContext(ctx) 2477 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2478 return nil, err 2479 } 2480 return c.Client.Do(req) 2481 } 2482 2483 func (c *Client) ResumeSandboxWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2484 req, err := NewResumeSandboxRequestWithBody(c.Server, sandboxID, contentType, body) 2485 if err != nil { 2486 return nil, err 2487 } 2488 req = req.WithContext(ctx) 2489 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2490 return nil, err 2491 } 2492 return c.Client.Do(req) 2493 } 2494 2495 func (c *Client) ResumeSandbox(ctx context.Context, sandboxID SandboxID, body ResumeSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2496 req, err := NewResumeSandboxRequest(c.Server, sandboxID, body) 2497 if err != nil { 2498 return nil, err 2499 } 2500 req = req.WithContext(ctx) 2501 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2502 return nil, err 2503 } 2504 return c.Client.Do(req) 2505 } 2506 2507 func (c *Client) UpdateSandboxTimeoutWithBody(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2508 req, err := NewUpdateSandboxTimeoutRequestWithBody(c.Server, sandboxID, contentType, body) 2509 if err != nil { 2510 return nil, err 2511 } 2512 req = req.WithContext(ctx) 2513 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2514 return nil, err 2515 } 2516 return c.Client.Do(req) 2517 } 2518 2519 func (c *Client) UpdateSandboxTimeout(ctx context.Context, sandboxID SandboxID, body UpdateSandboxTimeoutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2520 req, err := NewUpdateSandboxTimeoutRequest(c.Server, sandboxID, body) 2521 if err != nil { 2522 return nil, err 2523 } 2524 req = req.WithContext(ctx) 2525 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2526 return nil, err 2527 } 2528 return c.Client.Do(req) 2529 } 2530 2531 func (c *Client) ListTemplates(ctx context.Context, params *ListTemplatesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2532 req, err := NewListTemplatesRequest(c.Server, params) 2533 if err != nil { 2534 return nil, err 2535 } 2536 req = req.WithContext(ctx) 2537 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2538 return nil, err 2539 } 2540 return c.Client.Do(req) 2541 } 2542 2543 func (c *Client) CreateTemplateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2544 req, err := NewCreateTemplateRequestWithBody(c.Server, contentType, body) 2545 if err != nil { 2546 return nil, err 2547 } 2548 req = req.WithContext(ctx) 2549 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2550 return nil, err 2551 } 2552 return c.Client.Do(req) 2553 } 2554 2555 func (c *Client) CreateTemplate(ctx context.Context, body CreateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2556 req, err := NewCreateTemplateRequest(c.Server, body) 2557 if err != nil { 2558 return nil, err 2559 } 2560 req = req.WithContext(ctx) 2561 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2562 return nil, err 2563 } 2564 return c.Client.Do(req) 2565 } 2566 2567 func (c *Client) GetTemplateByAlias(ctx context.Context, alias string, reqEditors ...RequestEditorFn) (*http.Response, error) { 2568 req, err := NewGetTemplateByAliasRequest(c.Server, alias) 2569 if err != nil { 2570 return nil, err 2571 } 2572 req = req.WithContext(ctx) 2573 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2574 return nil, err 2575 } 2576 return c.Client.Do(req) 2577 } 2578 2579 func (c *Client) DeleteTemplateTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2580 req, err := NewDeleteTemplateTagsRequestWithBody(c.Server, contentType, body) 2581 if err != nil { 2582 return nil, err 2583 } 2584 req = req.WithContext(ctx) 2585 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2586 return nil, err 2587 } 2588 return c.Client.Do(req) 2589 } 2590 2591 func (c *Client) DeleteTemplateTags(ctx context.Context, body DeleteTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2592 req, err := NewDeleteTemplateTagsRequest(c.Server, body) 2593 if err != nil { 2594 return nil, err 2595 } 2596 req = req.WithContext(ctx) 2597 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2598 return nil, err 2599 } 2600 return c.Client.Do(req) 2601 } 2602 2603 func (c *Client) AssignTemplateTagsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2604 req, err := NewAssignTemplateTagsRequestWithBody(c.Server, contentType, body) 2605 if err != nil { 2606 return nil, err 2607 } 2608 req = req.WithContext(ctx) 2609 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2610 return nil, err 2611 } 2612 return c.Client.Do(req) 2613 } 2614 2615 func (c *Client) AssignTemplateTags(ctx context.Context, body AssignTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2616 req, err := NewAssignTemplateTagsRequest(c.Server, body) 2617 if err != nil { 2618 return nil, err 2619 } 2620 req = req.WithContext(ctx) 2621 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2622 return nil, err 2623 } 2624 return c.Client.Do(req) 2625 } 2626 2627 func (c *Client) DeleteTemplate(ctx context.Context, templateID TemplateID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2628 req, err := NewDeleteTemplateRequest(c.Server, templateID) 2629 if err != nil { 2630 return nil, err 2631 } 2632 req = req.WithContext(ctx) 2633 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2634 return nil, err 2635 } 2636 return c.Client.Do(req) 2637 } 2638 2639 func (c *Client) GetTemplate(ctx context.Context, templateID TemplateID, params *GetTemplateParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2640 req, err := NewGetTemplateRequest(c.Server, templateID, params) 2641 if err != nil { 2642 return nil, err 2643 } 2644 req = req.WithContext(ctx) 2645 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2646 return nil, err 2647 } 2648 return c.Client.Do(req) 2649 } 2650 2651 func (c *Client) UpdateTemplateWithBody(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2652 req, err := NewUpdateTemplateRequestWithBody(c.Server, templateID, contentType, body) 2653 if err != nil { 2654 return nil, err 2655 } 2656 req = req.WithContext(ctx) 2657 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2658 return nil, err 2659 } 2660 return c.Client.Do(req) 2661 } 2662 2663 func (c *Client) UpdateTemplate(ctx context.Context, templateID TemplateID, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2664 req, err := NewUpdateTemplateRequest(c.Server, templateID, body) 2665 if err != nil { 2666 return nil, err 2667 } 2668 req = req.WithContext(ctx) 2669 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2670 return nil, err 2671 } 2672 return c.Client.Do(req) 2673 } 2674 2675 func (c *Client) RebuildTemplateWithBody(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2676 req, err := NewRebuildTemplateRequestWithBody(c.Server, templateID, contentType, body) 2677 if err != nil { 2678 return nil, err 2679 } 2680 req = req.WithContext(ctx) 2681 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2682 return nil, err 2683 } 2684 return c.Client.Do(req) 2685 } 2686 2687 func (c *Client) RebuildTemplate(ctx context.Context, templateID TemplateID, body RebuildTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2688 req, err := NewRebuildTemplateRequest(c.Server, templateID, body) 2689 if err != nil { 2690 return nil, err 2691 } 2692 req = req.WithContext(ctx) 2693 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2694 return nil, err 2695 } 2696 return c.Client.Do(req) 2697 } 2698 2699 func (c *Client) StartTemplateBuild(ctx context.Context, templateID TemplateID, buildID BuildID, reqEditors ...RequestEditorFn) (*http.Response, error) { 2700 req, err := NewStartTemplateBuildRequest(c.Server, templateID, buildID) 2701 if err != nil { 2702 return nil, err 2703 } 2704 req = req.WithContext(ctx) 2705 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2706 return nil, err 2707 } 2708 return c.Client.Do(req) 2709 } 2710 2711 func (c *Client) GetTemplateBuildLogs(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2712 req, err := NewGetTemplateBuildLogsRequest(c.Server, templateID, buildID, params) 2713 if err != nil { 2714 return nil, err 2715 } 2716 req = req.WithContext(ctx) 2717 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2718 return nil, err 2719 } 2720 return c.Client.Do(req) 2721 } 2722 2723 func (c *Client) GetTemplateBuildStatus(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildStatusParams, reqEditors ...RequestEditorFn) (*http.Response, error) { 2724 req, err := NewGetTemplateBuildStatusRequest(c.Server, templateID, buildID, params) 2725 if err != nil { 2726 return nil, err 2727 } 2728 req = req.WithContext(ctx) 2729 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2730 return nil, err 2731 } 2732 return c.Client.Do(req) 2733 } 2734 2735 func (c *Client) GetTemplateFiles(ctx context.Context, templateID TemplateID, hash string, reqEditors ...RequestEditorFn) (*http.Response, error) { 2736 req, err := NewGetTemplateFilesRequest(c.Server, templateID, hash) 2737 if err != nil { 2738 return nil, err 2739 } 2740 req = req.WithContext(ctx) 2741 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2742 return nil, err 2743 } 2744 return c.Client.Do(req) 2745 } 2746 2747 func (c *Client) ListSandboxesV2(ctx context.Context, params *ListSandboxesV2Params, reqEditors ...RequestEditorFn) (*http.Response, error) { 2748 req, err := NewListSandboxesV2Request(c.Server, params) 2749 if err != nil { 2750 return nil, err 2751 } 2752 req = req.WithContext(ctx) 2753 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2754 return nil, err 2755 } 2756 return c.Client.Do(req) 2757 } 2758 2759 func (c *Client) CreateTemplateV2WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2760 req, err := NewCreateTemplateV2RequestWithBody(c.Server, contentType, body) 2761 if err != nil { 2762 return nil, err 2763 } 2764 req = req.WithContext(ctx) 2765 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2766 return nil, err 2767 } 2768 return c.Client.Do(req) 2769 } 2770 2771 func (c *Client) CreateTemplateV2(ctx context.Context, body CreateTemplateV2JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2772 req, err := NewCreateTemplateV2Request(c.Server, body) 2773 if err != nil { 2774 return nil, err 2775 } 2776 req = req.WithContext(ctx) 2777 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2778 return nil, err 2779 } 2780 return c.Client.Do(req) 2781 } 2782 2783 func (c *Client) StartTemplateBuildV2WithBody(ctx context.Context, templateID TemplateID, buildID BuildID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2784 req, err := NewStartTemplateBuildV2RequestWithBody(c.Server, templateID, buildID, contentType, body) 2785 if err != nil { 2786 return nil, err 2787 } 2788 req = req.WithContext(ctx) 2789 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2790 return nil, err 2791 } 2792 return c.Client.Do(req) 2793 } 2794 2795 func (c *Client) StartTemplateBuildV2(ctx context.Context, templateID TemplateID, buildID BuildID, body StartTemplateBuildV2JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2796 req, err := NewStartTemplateBuildV2Request(c.Server, templateID, buildID, body) 2797 if err != nil { 2798 return nil, err 2799 } 2800 req = req.WithContext(ctx) 2801 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2802 return nil, err 2803 } 2804 return c.Client.Do(req) 2805 } 2806 2807 func (c *Client) CreateTemplateV3WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { 2808 req, err := NewCreateTemplateV3RequestWithBody(c.Server, contentType, body) 2809 if err != nil { 2810 return nil, err 2811 } 2812 req = req.WithContext(ctx) 2813 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2814 return nil, err 2815 } 2816 return c.Client.Do(req) 2817 } 2818 2819 func (c *Client) CreateTemplateV3(ctx context.Context, body CreateTemplateV3JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { 2820 req, err := NewCreateTemplateV3Request(c.Server, body) 2821 if err != nil { 2822 return nil, err 2823 } 2824 req = req.WithContext(ctx) 2825 if err := c.applyEditors(ctx, req, reqEditors); err != nil { 2826 return nil, err 2827 } 2828 return c.Client.Do(req) 2829 } 2830 2831 // NewListDefaultTemplatesRequest generates requests for ListDefaultTemplates 2832 func NewListDefaultTemplatesRequest(server string) (*http.Request, error) { 2833 var err error 2834 2835 serverURL, err := url.Parse(server) 2836 if err != nil { 2837 return nil, err 2838 } 2839 2840 operationPath := fmt.Sprintf("/default-templates") 2841 if operationPath[0] == '/' { 2842 operationPath = "." + operationPath 2843 } 2844 2845 queryURL, err := serverURL.Parse(operationPath) 2846 if err != nil { 2847 return nil, err 2848 } 2849 2850 req, err := http.NewRequest("GET", queryURL.String(), nil) 2851 if err != nil { 2852 return nil, err 2853 } 2854 2855 return req, nil 2856 } 2857 2858 // NewGetInjectionRulesRequest generates requests for GetInjectionRules 2859 func NewGetInjectionRulesRequest(server string) (*http.Request, error) { 2860 var err error 2861 2862 serverURL, err := url.Parse(server) 2863 if err != nil { 2864 return nil, err 2865 } 2866 2867 operationPath := fmt.Sprintf("/injection-rules") 2868 if operationPath[0] == '/' { 2869 operationPath = "." + operationPath 2870 } 2871 2872 queryURL, err := serverURL.Parse(operationPath) 2873 if err != nil { 2874 return nil, err 2875 } 2876 2877 req, err := http.NewRequest("GET", queryURL.String(), nil) 2878 if err != nil { 2879 return nil, err 2880 } 2881 2882 return req, nil 2883 } 2884 2885 // NewPostInjectionRulesRequest calls the generic PostInjectionRules builder with application/json body 2886 func NewPostInjectionRulesRequest(server string, body PostInjectionRulesJSONRequestBody) (*http.Request, error) { 2887 var bodyReader io.Reader 2888 buf, err := json.Marshal(body) 2889 if err != nil { 2890 return nil, err 2891 } 2892 bodyReader = bytes.NewReader(buf) 2893 return NewPostInjectionRulesRequestWithBody(server, "application/json", bodyReader) 2894 } 2895 2896 // NewPostInjectionRulesRequestWithBody generates requests for PostInjectionRules with any type of body 2897 func NewPostInjectionRulesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 2898 var err error 2899 2900 serverURL, err := url.Parse(server) 2901 if err != nil { 2902 return nil, err 2903 } 2904 2905 operationPath := fmt.Sprintf("/injection-rules") 2906 if operationPath[0] == '/' { 2907 operationPath = "." + operationPath 2908 } 2909 2910 queryURL, err := serverURL.Parse(operationPath) 2911 if err != nil { 2912 return nil, err 2913 } 2914 2915 req, err := http.NewRequest("POST", queryURL.String(), body) 2916 if err != nil { 2917 return nil, err 2918 } 2919 2920 req.Header.Add("Content-Type", contentType) 2921 2922 return req, nil 2923 } 2924 2925 // NewDeleteInjectionRulesRuleIDRequest generates requests for DeleteInjectionRulesRuleID 2926 func NewDeleteInjectionRulesRuleIDRequest(server string, ruleID InjectionRuleID) (*http.Request, error) { 2927 var err error 2928 2929 var pathParam0 string 2930 2931 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ruleID", runtime.ParamLocationPath, ruleID) 2932 if err != nil { 2933 return nil, err 2934 } 2935 2936 serverURL, err := url.Parse(server) 2937 if err != nil { 2938 return nil, err 2939 } 2940 2941 operationPath := fmt.Sprintf("/injection-rules/%s", pathParam0) 2942 if operationPath[0] == '/' { 2943 operationPath = "." + operationPath 2944 } 2945 2946 queryURL, err := serverURL.Parse(operationPath) 2947 if err != nil { 2948 return nil, err 2949 } 2950 2951 req, err := http.NewRequest("DELETE", queryURL.String(), nil) 2952 if err != nil { 2953 return nil, err 2954 } 2955 2956 return req, nil 2957 } 2958 2959 // NewGetInjectionRulesRuleIDRequest generates requests for GetInjectionRulesRuleID 2960 func NewGetInjectionRulesRuleIDRequest(server string, ruleID InjectionRuleID) (*http.Request, error) { 2961 var err error 2962 2963 var pathParam0 string 2964 2965 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ruleID", runtime.ParamLocationPath, ruleID) 2966 if err != nil { 2967 return nil, err 2968 } 2969 2970 serverURL, err := url.Parse(server) 2971 if err != nil { 2972 return nil, err 2973 } 2974 2975 operationPath := fmt.Sprintf("/injection-rules/%s", pathParam0) 2976 if operationPath[0] == '/' { 2977 operationPath = "." + operationPath 2978 } 2979 2980 queryURL, err := serverURL.Parse(operationPath) 2981 if err != nil { 2982 return nil, err 2983 } 2984 2985 req, err := http.NewRequest("GET", queryURL.String(), nil) 2986 if err != nil { 2987 return nil, err 2988 } 2989 2990 return req, nil 2991 } 2992 2993 // NewPutInjectionRulesRuleIDRequest calls the generic PutInjectionRulesRuleID builder with application/json body 2994 func NewPutInjectionRulesRuleIDRequest(server string, ruleID InjectionRuleID, body PutInjectionRulesRuleIDJSONRequestBody) (*http.Request, error) { 2995 var bodyReader io.Reader 2996 buf, err := json.Marshal(body) 2997 if err != nil { 2998 return nil, err 2999 } 3000 bodyReader = bytes.NewReader(buf) 3001 return NewPutInjectionRulesRuleIDRequestWithBody(server, ruleID, "application/json", bodyReader) 3002 } 3003 3004 // NewPutInjectionRulesRuleIDRequestWithBody generates requests for PutInjectionRulesRuleID with any type of body 3005 func NewPutInjectionRulesRuleIDRequestWithBody(server string, ruleID InjectionRuleID, contentType string, body io.Reader) (*http.Request, error) { 3006 var err error 3007 3008 var pathParam0 string 3009 3010 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ruleID", runtime.ParamLocationPath, ruleID) 3011 if err != nil { 3012 return nil, err 3013 } 3014 3015 serverURL, err := url.Parse(server) 3016 if err != nil { 3017 return nil, err 3018 } 3019 3020 operationPath := fmt.Sprintf("/injection-rules/%s", pathParam0) 3021 if operationPath[0] == '/' { 3022 operationPath = "." + operationPath 3023 } 3024 3025 queryURL, err := serverURL.Parse(operationPath) 3026 if err != nil { 3027 return nil, err 3028 } 3029 3030 req, err := http.NewRequest("PUT", queryURL.String(), body) 3031 if err != nil { 3032 return nil, err 3033 } 3034 3035 req.Header.Add("Content-Type", contentType) 3036 3037 return req, nil 3038 } 3039 3040 // NewListSandboxesRequest generates requests for ListSandboxes 3041 func NewListSandboxesRequest(server string, params *ListSandboxesParams) (*http.Request, error) { 3042 var err error 3043 3044 serverURL, err := url.Parse(server) 3045 if err != nil { 3046 return nil, err 3047 } 3048 3049 operationPath := fmt.Sprintf("/sandboxes") 3050 if operationPath[0] == '/' { 3051 operationPath = "." + operationPath 3052 } 3053 3054 queryURL, err := serverURL.Parse(operationPath) 3055 if err != nil { 3056 return nil, err 3057 } 3058 3059 if params != nil { 3060 queryValues := queryURL.Query() 3061 3062 if params.Metadata != nil { 3063 3064 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "metadata", runtime.ParamLocationQuery, *params.Metadata); err != nil { 3065 return nil, err 3066 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3067 return nil, err 3068 } else { 3069 for k, v := range parsed { 3070 for _, v2 := range v { 3071 queryValues.Add(k, v2) 3072 } 3073 } 3074 } 3075 3076 } 3077 3078 queryURL.RawQuery = queryValues.Encode() 3079 } 3080 3081 req, err := http.NewRequest("GET", queryURL.String(), nil) 3082 if err != nil { 3083 return nil, err 3084 } 3085 3086 return req, nil 3087 } 3088 3089 // NewCreateSandboxRequest calls the generic CreateSandbox builder with application/json body 3090 func NewCreateSandboxRequest(server string, params *CreateSandboxParams, body CreateSandboxJSONRequestBody) (*http.Request, error) { 3091 var bodyReader io.Reader 3092 buf, err := json.Marshal(body) 3093 if err != nil { 3094 return nil, err 3095 } 3096 bodyReader = bytes.NewReader(buf) 3097 return NewCreateSandboxRequestWithBody(server, params, "application/json", bodyReader) 3098 } 3099 3100 // NewCreateSandboxRequestWithBody generates requests for CreateSandbox with any type of body 3101 func NewCreateSandboxRequestWithBody(server string, params *CreateSandboxParams, contentType string, body io.Reader) (*http.Request, error) { 3102 var err error 3103 3104 serverURL, err := url.Parse(server) 3105 if err != nil { 3106 return nil, err 3107 } 3108 3109 operationPath := fmt.Sprintf("/sandboxes") 3110 if operationPath[0] == '/' { 3111 operationPath = "." + operationPath 3112 } 3113 3114 queryURL, err := serverURL.Parse(operationPath) 3115 if err != nil { 3116 return nil, err 3117 } 3118 3119 req, err := http.NewRequest("POST", queryURL.String(), body) 3120 if err != nil { 3121 return nil, err 3122 } 3123 3124 req.Header.Add("Content-Type", contentType) 3125 3126 if params != nil { 3127 3128 if params.IdempotencyKey != nil { 3129 var headerParam0 string 3130 3131 headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Idempotency-Key", runtime.ParamLocationHeader, *params.IdempotencyKey) 3132 if err != nil { 3133 return nil, err 3134 } 3135 3136 req.Header.Set("Idempotency-Key", headerParam0) 3137 } 3138 3139 } 3140 3141 return req, nil 3142 } 3143 3144 // NewGetSandboxesMetricsRequest generates requests for GetSandboxesMetrics 3145 func NewGetSandboxesMetricsRequest(server string, params *GetSandboxesMetricsParams) (*http.Request, error) { 3146 var err error 3147 3148 serverURL, err := url.Parse(server) 3149 if err != nil { 3150 return nil, err 3151 } 3152 3153 operationPath := fmt.Sprintf("/sandboxes/metrics") 3154 if operationPath[0] == '/' { 3155 operationPath = "." + operationPath 3156 } 3157 3158 queryURL, err := serverURL.Parse(operationPath) 3159 if err != nil { 3160 return nil, err 3161 } 3162 3163 if params != nil { 3164 queryValues := queryURL.Query() 3165 3166 if queryFrag, err := runtime.StyleParamWithLocation("form", false, "sandbox_ids", runtime.ParamLocationQuery, params.SandboxIds); err != nil { 3167 return nil, err 3168 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3169 return nil, err 3170 } else { 3171 for k, v := range parsed { 3172 for _, v2 := range v { 3173 queryValues.Add(k, v2) 3174 } 3175 } 3176 } 3177 3178 queryURL.RawQuery = queryValues.Encode() 3179 } 3180 3181 req, err := http.NewRequest("GET", queryURL.String(), nil) 3182 if err != nil { 3183 return nil, err 3184 } 3185 3186 return req, nil 3187 } 3188 3189 // NewDeleteSandboxRequest generates requests for DeleteSandbox 3190 func NewDeleteSandboxRequest(server string, sandboxID SandboxID) (*http.Request, error) { 3191 var err error 3192 3193 var pathParam0 string 3194 3195 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3196 if err != nil { 3197 return nil, err 3198 } 3199 3200 serverURL, err := url.Parse(server) 3201 if err != nil { 3202 return nil, err 3203 } 3204 3205 operationPath := fmt.Sprintf("/sandboxes/%s", pathParam0) 3206 if operationPath[0] == '/' { 3207 operationPath = "." + operationPath 3208 } 3209 3210 queryURL, err := serverURL.Parse(operationPath) 3211 if err != nil { 3212 return nil, err 3213 } 3214 3215 req, err := http.NewRequest("DELETE", queryURL.String(), nil) 3216 if err != nil { 3217 return nil, err 3218 } 3219 3220 return req, nil 3221 } 3222 3223 // NewGetSandboxRequest generates requests for GetSandbox 3224 func NewGetSandboxRequest(server string, sandboxID SandboxID) (*http.Request, error) { 3225 var err error 3226 3227 var pathParam0 string 3228 3229 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3230 if err != nil { 3231 return nil, err 3232 } 3233 3234 serverURL, err := url.Parse(server) 3235 if err != nil { 3236 return nil, err 3237 } 3238 3239 operationPath := fmt.Sprintf("/sandboxes/%s", pathParam0) 3240 if operationPath[0] == '/' { 3241 operationPath = "." + operationPath 3242 } 3243 3244 queryURL, err := serverURL.Parse(operationPath) 3245 if err != nil { 3246 return nil, err 3247 } 3248 3249 req, err := http.NewRequest("GET", queryURL.String(), nil) 3250 if err != nil { 3251 return nil, err 3252 } 3253 3254 return req, nil 3255 } 3256 3257 // NewConnectSandboxRequest calls the generic ConnectSandbox builder with application/json body 3258 func NewConnectSandboxRequest(server string, sandboxID SandboxID, body ConnectSandboxJSONRequestBody) (*http.Request, error) { 3259 var bodyReader io.Reader 3260 buf, err := json.Marshal(body) 3261 if err != nil { 3262 return nil, err 3263 } 3264 bodyReader = bytes.NewReader(buf) 3265 return NewConnectSandboxRequestWithBody(server, sandboxID, "application/json", bodyReader) 3266 } 3267 3268 // NewConnectSandboxRequestWithBody generates requests for ConnectSandbox with any type of body 3269 func NewConnectSandboxRequestWithBody(server string, sandboxID SandboxID, contentType string, body io.Reader) (*http.Request, error) { 3270 var err error 3271 3272 var pathParam0 string 3273 3274 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3275 if err != nil { 3276 return nil, err 3277 } 3278 3279 serverURL, err := url.Parse(server) 3280 if err != nil { 3281 return nil, err 3282 } 3283 3284 operationPath := fmt.Sprintf("/sandboxes/%s/connect", pathParam0) 3285 if operationPath[0] == '/' { 3286 operationPath = "." + operationPath 3287 } 3288 3289 queryURL, err := serverURL.Parse(operationPath) 3290 if err != nil { 3291 return nil, err 3292 } 3293 3294 req, err := http.NewRequest("POST", queryURL.String(), body) 3295 if err != nil { 3296 return nil, err 3297 } 3298 3299 req.Header.Add("Content-Type", contentType) 3300 3301 return req, nil 3302 } 3303 3304 // NewUpdateSandboxGithubTokenRequest calls the generic UpdateSandboxGithubToken builder with application/json body 3305 func NewUpdateSandboxGithubTokenRequest(server string, sandboxID SandboxID, body UpdateSandboxGithubTokenJSONRequestBody) (*http.Request, error) { 3306 var bodyReader io.Reader 3307 buf, err := json.Marshal(body) 3308 if err != nil { 3309 return nil, err 3310 } 3311 bodyReader = bytes.NewReader(buf) 3312 return NewUpdateSandboxGithubTokenRequestWithBody(server, sandboxID, "application/json", bodyReader) 3313 } 3314 3315 // NewUpdateSandboxGithubTokenRequestWithBody generates requests for UpdateSandboxGithubToken with any type of body 3316 func NewUpdateSandboxGithubTokenRequestWithBody(server string, sandboxID SandboxID, contentType string, body io.Reader) (*http.Request, error) { 3317 var err error 3318 3319 var pathParam0 string 3320 3321 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3322 if err != nil { 3323 return nil, err 3324 } 3325 3326 serverURL, err := url.Parse(server) 3327 if err != nil { 3328 return nil, err 3329 } 3330 3331 operationPath := fmt.Sprintf("/sandboxes/%s/github-token", pathParam0) 3332 if operationPath[0] == '/' { 3333 operationPath = "." + operationPath 3334 } 3335 3336 queryURL, err := serverURL.Parse(operationPath) 3337 if err != nil { 3338 return nil, err 3339 } 3340 3341 req, err := http.NewRequest("PUT", queryURL.String(), body) 3342 if err != nil { 3343 return nil, err 3344 } 3345 3346 req.Header.Add("Content-Type", contentType) 3347 3348 return req, nil 3349 } 3350 3351 // NewGetSandboxInjectionsRequest generates requests for GetSandboxInjections 3352 func NewGetSandboxInjectionsRequest(server string, sandboxID SandboxID) (*http.Request, error) { 3353 var err error 3354 3355 var pathParam0 string 3356 3357 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3358 if err != nil { 3359 return nil, err 3360 } 3361 3362 serverURL, err := url.Parse(server) 3363 if err != nil { 3364 return nil, err 3365 } 3366 3367 operationPath := fmt.Sprintf("/sandboxes/%s/injections", pathParam0) 3368 if operationPath[0] == '/' { 3369 operationPath = "." + operationPath 3370 } 3371 3372 queryURL, err := serverURL.Parse(operationPath) 3373 if err != nil { 3374 return nil, err 3375 } 3376 3377 req, err := http.NewRequest("GET", queryURL.String(), nil) 3378 if err != nil { 3379 return nil, err 3380 } 3381 3382 return req, nil 3383 } 3384 3385 // NewUpdateSandboxInjectionsRequest calls the generic UpdateSandboxInjections builder with application/json body 3386 func NewUpdateSandboxInjectionsRequest(server string, sandboxID SandboxID, body UpdateSandboxInjectionsJSONRequestBody) (*http.Request, error) { 3387 var bodyReader io.Reader 3388 buf, err := json.Marshal(body) 3389 if err != nil { 3390 return nil, err 3391 } 3392 bodyReader = bytes.NewReader(buf) 3393 return NewUpdateSandboxInjectionsRequestWithBody(server, sandboxID, "application/json", bodyReader) 3394 } 3395 3396 // NewUpdateSandboxInjectionsRequestWithBody generates requests for UpdateSandboxInjections with any type of body 3397 func NewUpdateSandboxInjectionsRequestWithBody(server string, sandboxID SandboxID, contentType string, body io.Reader) (*http.Request, error) { 3398 var err error 3399 3400 var pathParam0 string 3401 3402 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3403 if err != nil { 3404 return nil, err 3405 } 3406 3407 serverURL, err := url.Parse(server) 3408 if err != nil { 3409 return nil, err 3410 } 3411 3412 operationPath := fmt.Sprintf("/sandboxes/%s/injections", pathParam0) 3413 if operationPath[0] == '/' { 3414 operationPath = "." + operationPath 3415 } 3416 3417 queryURL, err := serverURL.Parse(operationPath) 3418 if err != nil { 3419 return nil, err 3420 } 3421 3422 req, err := http.NewRequest("PUT", queryURL.String(), body) 3423 if err != nil { 3424 return nil, err 3425 } 3426 3427 req.Header.Add("Content-Type", contentType) 3428 3429 return req, nil 3430 } 3431 3432 // NewGetSandboxLogsRequest generates requests for GetSandboxLogs 3433 func NewGetSandboxLogsRequest(server string, sandboxID SandboxID, params *GetSandboxLogsParams) (*http.Request, error) { 3434 var err error 3435 3436 var pathParam0 string 3437 3438 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3439 if err != nil { 3440 return nil, err 3441 } 3442 3443 serverURL, err := url.Parse(server) 3444 if err != nil { 3445 return nil, err 3446 } 3447 3448 operationPath := fmt.Sprintf("/sandboxes/%s/logs", pathParam0) 3449 if operationPath[0] == '/' { 3450 operationPath = "." + operationPath 3451 } 3452 3453 queryURL, err := serverURL.Parse(operationPath) 3454 if err != nil { 3455 return nil, err 3456 } 3457 3458 if params != nil { 3459 queryValues := queryURL.Query() 3460 3461 if params.Start != nil { 3462 3463 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start", runtime.ParamLocationQuery, *params.Start); err != nil { 3464 return nil, err 3465 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3466 return nil, err 3467 } else { 3468 for k, v := range parsed { 3469 for _, v2 := range v { 3470 queryValues.Add(k, v2) 3471 } 3472 } 3473 } 3474 3475 } 3476 3477 if params.Limit != nil { 3478 3479 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { 3480 return nil, err 3481 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3482 return nil, err 3483 } else { 3484 for k, v := range parsed { 3485 for _, v2 := range v { 3486 queryValues.Add(k, v2) 3487 } 3488 } 3489 } 3490 3491 } 3492 3493 queryURL.RawQuery = queryValues.Encode() 3494 } 3495 3496 req, err := http.NewRequest("GET", queryURL.String(), nil) 3497 if err != nil { 3498 return nil, err 3499 } 3500 3501 return req, nil 3502 } 3503 3504 // NewGetSandboxMetricsRequest generates requests for GetSandboxMetrics 3505 func NewGetSandboxMetricsRequest(server string, sandboxID SandboxID, params *GetSandboxMetricsParams) (*http.Request, error) { 3506 var err error 3507 3508 var pathParam0 string 3509 3510 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3511 if err != nil { 3512 return nil, err 3513 } 3514 3515 serverURL, err := url.Parse(server) 3516 if err != nil { 3517 return nil, err 3518 } 3519 3520 operationPath := fmt.Sprintf("/sandboxes/%s/metrics", pathParam0) 3521 if operationPath[0] == '/' { 3522 operationPath = "." + operationPath 3523 } 3524 3525 queryURL, err := serverURL.Parse(operationPath) 3526 if err != nil { 3527 return nil, err 3528 } 3529 3530 if params != nil { 3531 queryValues := queryURL.Query() 3532 3533 if params.Start != nil { 3534 3535 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start", runtime.ParamLocationQuery, *params.Start); err != nil { 3536 return nil, err 3537 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3538 return nil, err 3539 } else { 3540 for k, v := range parsed { 3541 for _, v2 := range v { 3542 queryValues.Add(k, v2) 3543 } 3544 } 3545 } 3546 3547 } 3548 3549 if params.End != nil { 3550 3551 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end", runtime.ParamLocationQuery, *params.End); err != nil { 3552 return nil, err 3553 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3554 return nil, err 3555 } else { 3556 for k, v := range parsed { 3557 for _, v2 := range v { 3558 queryValues.Add(k, v2) 3559 } 3560 } 3561 } 3562 3563 } 3564 3565 queryURL.RawQuery = queryValues.Encode() 3566 } 3567 3568 req, err := http.NewRequest("GET", queryURL.String(), nil) 3569 if err != nil { 3570 return nil, err 3571 } 3572 3573 return req, nil 3574 } 3575 3576 // NewPauseSandboxRequest generates requests for PauseSandbox 3577 func NewPauseSandboxRequest(server string, sandboxID SandboxID) (*http.Request, error) { 3578 var err error 3579 3580 var pathParam0 string 3581 3582 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3583 if err != nil { 3584 return nil, err 3585 } 3586 3587 serverURL, err := url.Parse(server) 3588 if err != nil { 3589 return nil, err 3590 } 3591 3592 operationPath := fmt.Sprintf("/sandboxes/%s/pause", pathParam0) 3593 if operationPath[0] == '/' { 3594 operationPath = "." + operationPath 3595 } 3596 3597 queryURL, err := serverURL.Parse(operationPath) 3598 if err != nil { 3599 return nil, err 3600 } 3601 3602 req, err := http.NewRequest("POST", queryURL.String(), nil) 3603 if err != nil { 3604 return nil, err 3605 } 3606 3607 return req, nil 3608 } 3609 3610 // NewRefreshSandboxRequest calls the generic RefreshSandbox builder with application/json body 3611 func NewRefreshSandboxRequest(server string, sandboxID SandboxID, body RefreshSandboxJSONRequestBody) (*http.Request, error) { 3612 var bodyReader io.Reader 3613 buf, err := json.Marshal(body) 3614 if err != nil { 3615 return nil, err 3616 } 3617 bodyReader = bytes.NewReader(buf) 3618 return NewRefreshSandboxRequestWithBody(server, sandboxID, "application/json", bodyReader) 3619 } 3620 3621 // NewRefreshSandboxRequestWithBody generates requests for RefreshSandbox with any type of body 3622 func NewRefreshSandboxRequestWithBody(server string, sandboxID SandboxID, contentType string, body io.Reader) (*http.Request, error) { 3623 var err error 3624 3625 var pathParam0 string 3626 3627 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3628 if err != nil { 3629 return nil, err 3630 } 3631 3632 serverURL, err := url.Parse(server) 3633 if err != nil { 3634 return nil, err 3635 } 3636 3637 operationPath := fmt.Sprintf("/sandboxes/%s/refreshes", pathParam0) 3638 if operationPath[0] == '/' { 3639 operationPath = "." + operationPath 3640 } 3641 3642 queryURL, err := serverURL.Parse(operationPath) 3643 if err != nil { 3644 return nil, err 3645 } 3646 3647 req, err := http.NewRequest("POST", queryURL.String(), body) 3648 if err != nil { 3649 return nil, err 3650 } 3651 3652 req.Header.Add("Content-Type", contentType) 3653 3654 return req, nil 3655 } 3656 3657 // NewResumeSandboxRequest calls the generic ResumeSandbox builder with application/json body 3658 func NewResumeSandboxRequest(server string, sandboxID SandboxID, body ResumeSandboxJSONRequestBody) (*http.Request, error) { 3659 var bodyReader io.Reader 3660 buf, err := json.Marshal(body) 3661 if err != nil { 3662 return nil, err 3663 } 3664 bodyReader = bytes.NewReader(buf) 3665 return NewResumeSandboxRequestWithBody(server, sandboxID, "application/json", bodyReader) 3666 } 3667 3668 // NewResumeSandboxRequestWithBody generates requests for ResumeSandbox with any type of body 3669 func NewResumeSandboxRequestWithBody(server string, sandboxID SandboxID, contentType string, body io.Reader) (*http.Request, error) { 3670 var err error 3671 3672 var pathParam0 string 3673 3674 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3675 if err != nil { 3676 return nil, err 3677 } 3678 3679 serverURL, err := url.Parse(server) 3680 if err != nil { 3681 return nil, err 3682 } 3683 3684 operationPath := fmt.Sprintf("/sandboxes/%s/resume", pathParam0) 3685 if operationPath[0] == '/' { 3686 operationPath = "." + operationPath 3687 } 3688 3689 queryURL, err := serverURL.Parse(operationPath) 3690 if err != nil { 3691 return nil, err 3692 } 3693 3694 req, err := http.NewRequest("POST", queryURL.String(), body) 3695 if err != nil { 3696 return nil, err 3697 } 3698 3699 req.Header.Add("Content-Type", contentType) 3700 3701 return req, nil 3702 } 3703 3704 // NewUpdateSandboxTimeoutRequest calls the generic UpdateSandboxTimeout builder with application/json body 3705 func NewUpdateSandboxTimeoutRequest(server string, sandboxID SandboxID, body UpdateSandboxTimeoutJSONRequestBody) (*http.Request, error) { 3706 var bodyReader io.Reader 3707 buf, err := json.Marshal(body) 3708 if err != nil { 3709 return nil, err 3710 } 3711 bodyReader = bytes.NewReader(buf) 3712 return NewUpdateSandboxTimeoutRequestWithBody(server, sandboxID, "application/json", bodyReader) 3713 } 3714 3715 // NewUpdateSandboxTimeoutRequestWithBody generates requests for UpdateSandboxTimeout with any type of body 3716 func NewUpdateSandboxTimeoutRequestWithBody(server string, sandboxID SandboxID, contentType string, body io.Reader) (*http.Request, error) { 3717 var err error 3718 3719 var pathParam0 string 3720 3721 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "sandboxID", runtime.ParamLocationPath, sandboxID) 3722 if err != nil { 3723 return nil, err 3724 } 3725 3726 serverURL, err := url.Parse(server) 3727 if err != nil { 3728 return nil, err 3729 } 3730 3731 operationPath := fmt.Sprintf("/sandboxes/%s/timeout", pathParam0) 3732 if operationPath[0] == '/' { 3733 operationPath = "." + operationPath 3734 } 3735 3736 queryURL, err := serverURL.Parse(operationPath) 3737 if err != nil { 3738 return nil, err 3739 } 3740 3741 req, err := http.NewRequest("POST", queryURL.String(), body) 3742 if err != nil { 3743 return nil, err 3744 } 3745 3746 req.Header.Add("Content-Type", contentType) 3747 3748 return req, nil 3749 } 3750 3751 // NewListTemplatesRequest generates requests for ListTemplates 3752 func NewListTemplatesRequest(server string, params *ListTemplatesParams) (*http.Request, error) { 3753 var err error 3754 3755 serverURL, err := url.Parse(server) 3756 if err != nil { 3757 return nil, err 3758 } 3759 3760 operationPath := fmt.Sprintf("/templates") 3761 if operationPath[0] == '/' { 3762 operationPath = "." + operationPath 3763 } 3764 3765 queryURL, err := serverURL.Parse(operationPath) 3766 if err != nil { 3767 return nil, err 3768 } 3769 3770 if params != nil { 3771 queryValues := queryURL.Query() 3772 3773 if params.TeamID != nil { 3774 3775 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "teamID", runtime.ParamLocationQuery, *params.TeamID); err != nil { 3776 return nil, err 3777 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 3778 return nil, err 3779 } else { 3780 for k, v := range parsed { 3781 for _, v2 := range v { 3782 queryValues.Add(k, v2) 3783 } 3784 } 3785 } 3786 3787 } 3788 3789 queryURL.RawQuery = queryValues.Encode() 3790 } 3791 3792 req, err := http.NewRequest("GET", queryURL.String(), nil) 3793 if err != nil { 3794 return nil, err 3795 } 3796 3797 return req, nil 3798 } 3799 3800 // NewCreateTemplateRequest calls the generic CreateTemplate builder with application/json body 3801 func NewCreateTemplateRequest(server string, body CreateTemplateJSONRequestBody) (*http.Request, error) { 3802 var bodyReader io.Reader 3803 buf, err := json.Marshal(body) 3804 if err != nil { 3805 return nil, err 3806 } 3807 bodyReader = bytes.NewReader(buf) 3808 return NewCreateTemplateRequestWithBody(server, "application/json", bodyReader) 3809 } 3810 3811 // NewCreateTemplateRequestWithBody generates requests for CreateTemplate with any type of body 3812 func NewCreateTemplateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 3813 var err error 3814 3815 serverURL, err := url.Parse(server) 3816 if err != nil { 3817 return nil, err 3818 } 3819 3820 operationPath := fmt.Sprintf("/templates") 3821 if operationPath[0] == '/' { 3822 operationPath = "." + operationPath 3823 } 3824 3825 queryURL, err := serverURL.Parse(operationPath) 3826 if err != nil { 3827 return nil, err 3828 } 3829 3830 req, err := http.NewRequest("POST", queryURL.String(), body) 3831 if err != nil { 3832 return nil, err 3833 } 3834 3835 req.Header.Add("Content-Type", contentType) 3836 3837 return req, nil 3838 } 3839 3840 // NewGetTemplateByAliasRequest generates requests for GetTemplateByAlias 3841 func NewGetTemplateByAliasRequest(server string, alias string) (*http.Request, error) { 3842 var err error 3843 3844 var pathParam0 string 3845 3846 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "alias", runtime.ParamLocationPath, alias) 3847 if err != nil { 3848 return nil, err 3849 } 3850 3851 serverURL, err := url.Parse(server) 3852 if err != nil { 3853 return nil, err 3854 } 3855 3856 operationPath := fmt.Sprintf("/templates/aliases/%s", pathParam0) 3857 if operationPath[0] == '/' { 3858 operationPath = "." + operationPath 3859 } 3860 3861 queryURL, err := serverURL.Parse(operationPath) 3862 if err != nil { 3863 return nil, err 3864 } 3865 3866 req, err := http.NewRequest("GET", queryURL.String(), nil) 3867 if err != nil { 3868 return nil, err 3869 } 3870 3871 return req, nil 3872 } 3873 3874 // NewDeleteTemplateTagsRequest calls the generic DeleteTemplateTags builder with application/json body 3875 func NewDeleteTemplateTagsRequest(server string, body DeleteTemplateTagsJSONRequestBody) (*http.Request, error) { 3876 var bodyReader io.Reader 3877 buf, err := json.Marshal(body) 3878 if err != nil { 3879 return nil, err 3880 } 3881 bodyReader = bytes.NewReader(buf) 3882 return NewDeleteTemplateTagsRequestWithBody(server, "application/json", bodyReader) 3883 } 3884 3885 // NewDeleteTemplateTagsRequestWithBody generates requests for DeleteTemplateTags with any type of body 3886 func NewDeleteTemplateTagsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 3887 var err error 3888 3889 serverURL, err := url.Parse(server) 3890 if err != nil { 3891 return nil, err 3892 } 3893 3894 operationPath := fmt.Sprintf("/templates/tags") 3895 if operationPath[0] == '/' { 3896 operationPath = "." + operationPath 3897 } 3898 3899 queryURL, err := serverURL.Parse(operationPath) 3900 if err != nil { 3901 return nil, err 3902 } 3903 3904 req, err := http.NewRequest("DELETE", queryURL.String(), body) 3905 if err != nil { 3906 return nil, err 3907 } 3908 3909 req.Header.Add("Content-Type", contentType) 3910 3911 return req, nil 3912 } 3913 3914 // NewAssignTemplateTagsRequest calls the generic AssignTemplateTags builder with application/json body 3915 func NewAssignTemplateTagsRequest(server string, body AssignTemplateTagsJSONRequestBody) (*http.Request, error) { 3916 var bodyReader io.Reader 3917 buf, err := json.Marshal(body) 3918 if err != nil { 3919 return nil, err 3920 } 3921 bodyReader = bytes.NewReader(buf) 3922 return NewAssignTemplateTagsRequestWithBody(server, "application/json", bodyReader) 3923 } 3924 3925 // NewAssignTemplateTagsRequestWithBody generates requests for AssignTemplateTags with any type of body 3926 func NewAssignTemplateTagsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 3927 var err error 3928 3929 serverURL, err := url.Parse(server) 3930 if err != nil { 3931 return nil, err 3932 } 3933 3934 operationPath := fmt.Sprintf("/templates/tags") 3935 if operationPath[0] == '/' { 3936 operationPath = "." + operationPath 3937 } 3938 3939 queryURL, err := serverURL.Parse(operationPath) 3940 if err != nil { 3941 return nil, err 3942 } 3943 3944 req, err := http.NewRequest("POST", queryURL.String(), body) 3945 if err != nil { 3946 return nil, err 3947 } 3948 3949 req.Header.Add("Content-Type", contentType) 3950 3951 return req, nil 3952 } 3953 3954 // NewDeleteTemplateRequest generates requests for DeleteTemplate 3955 func NewDeleteTemplateRequest(server string, templateID TemplateID) (*http.Request, error) { 3956 var err error 3957 3958 var pathParam0 string 3959 3960 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 3961 if err != nil { 3962 return nil, err 3963 } 3964 3965 serverURL, err := url.Parse(server) 3966 if err != nil { 3967 return nil, err 3968 } 3969 3970 operationPath := fmt.Sprintf("/templates/%s", pathParam0) 3971 if operationPath[0] == '/' { 3972 operationPath = "." + operationPath 3973 } 3974 3975 queryURL, err := serverURL.Parse(operationPath) 3976 if err != nil { 3977 return nil, err 3978 } 3979 3980 req, err := http.NewRequest("DELETE", queryURL.String(), nil) 3981 if err != nil { 3982 return nil, err 3983 } 3984 3985 return req, nil 3986 } 3987 3988 // NewGetTemplateRequest generates requests for GetTemplate 3989 func NewGetTemplateRequest(server string, templateID TemplateID, params *GetTemplateParams) (*http.Request, error) { 3990 var err error 3991 3992 var pathParam0 string 3993 3994 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 3995 if err != nil { 3996 return nil, err 3997 } 3998 3999 serverURL, err := url.Parse(server) 4000 if err != nil { 4001 return nil, err 4002 } 4003 4004 operationPath := fmt.Sprintf("/templates/%s", pathParam0) 4005 if operationPath[0] == '/' { 4006 operationPath = "." + operationPath 4007 } 4008 4009 queryURL, err := serverURL.Parse(operationPath) 4010 if err != nil { 4011 return nil, err 4012 } 4013 4014 if params != nil { 4015 queryValues := queryURL.Query() 4016 4017 if params.NextToken != nil { 4018 4019 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "nextToken", runtime.ParamLocationQuery, *params.NextToken); err != nil { 4020 return nil, err 4021 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4022 return nil, err 4023 } else { 4024 for k, v := range parsed { 4025 for _, v2 := range v { 4026 queryValues.Add(k, v2) 4027 } 4028 } 4029 } 4030 4031 } 4032 4033 if params.Limit != nil { 4034 4035 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { 4036 return nil, err 4037 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4038 return nil, err 4039 } else { 4040 for k, v := range parsed { 4041 for _, v2 := range v { 4042 queryValues.Add(k, v2) 4043 } 4044 } 4045 } 4046 4047 } 4048 4049 queryURL.RawQuery = queryValues.Encode() 4050 } 4051 4052 req, err := http.NewRequest("GET", queryURL.String(), nil) 4053 if err != nil { 4054 return nil, err 4055 } 4056 4057 return req, nil 4058 } 4059 4060 // NewUpdateTemplateRequest calls the generic UpdateTemplate builder with application/json body 4061 func NewUpdateTemplateRequest(server string, templateID TemplateID, body UpdateTemplateJSONRequestBody) (*http.Request, error) { 4062 var bodyReader io.Reader 4063 buf, err := json.Marshal(body) 4064 if err != nil { 4065 return nil, err 4066 } 4067 bodyReader = bytes.NewReader(buf) 4068 return NewUpdateTemplateRequestWithBody(server, templateID, "application/json", bodyReader) 4069 } 4070 4071 // NewUpdateTemplateRequestWithBody generates requests for UpdateTemplate with any type of body 4072 func NewUpdateTemplateRequestWithBody(server string, templateID TemplateID, contentType string, body io.Reader) (*http.Request, error) { 4073 var err error 4074 4075 var pathParam0 string 4076 4077 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4078 if err != nil { 4079 return nil, err 4080 } 4081 4082 serverURL, err := url.Parse(server) 4083 if err != nil { 4084 return nil, err 4085 } 4086 4087 operationPath := fmt.Sprintf("/templates/%s", pathParam0) 4088 if operationPath[0] == '/' { 4089 operationPath = "." + operationPath 4090 } 4091 4092 queryURL, err := serverURL.Parse(operationPath) 4093 if err != nil { 4094 return nil, err 4095 } 4096 4097 req, err := http.NewRequest("PATCH", queryURL.String(), body) 4098 if err != nil { 4099 return nil, err 4100 } 4101 4102 req.Header.Add("Content-Type", contentType) 4103 4104 return req, nil 4105 } 4106 4107 // NewRebuildTemplateRequest calls the generic RebuildTemplate builder with application/json body 4108 func NewRebuildTemplateRequest(server string, templateID TemplateID, body RebuildTemplateJSONRequestBody) (*http.Request, error) { 4109 var bodyReader io.Reader 4110 buf, err := json.Marshal(body) 4111 if err != nil { 4112 return nil, err 4113 } 4114 bodyReader = bytes.NewReader(buf) 4115 return NewRebuildTemplateRequestWithBody(server, templateID, "application/json", bodyReader) 4116 } 4117 4118 // NewRebuildTemplateRequestWithBody generates requests for RebuildTemplate with any type of body 4119 func NewRebuildTemplateRequestWithBody(server string, templateID TemplateID, contentType string, body io.Reader) (*http.Request, error) { 4120 var err error 4121 4122 var pathParam0 string 4123 4124 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4125 if err != nil { 4126 return nil, err 4127 } 4128 4129 serverURL, err := url.Parse(server) 4130 if err != nil { 4131 return nil, err 4132 } 4133 4134 operationPath := fmt.Sprintf("/templates/%s", pathParam0) 4135 if operationPath[0] == '/' { 4136 operationPath = "." + operationPath 4137 } 4138 4139 queryURL, err := serverURL.Parse(operationPath) 4140 if err != nil { 4141 return nil, err 4142 } 4143 4144 req, err := http.NewRequest("POST", queryURL.String(), body) 4145 if err != nil { 4146 return nil, err 4147 } 4148 4149 req.Header.Add("Content-Type", contentType) 4150 4151 return req, nil 4152 } 4153 4154 // NewStartTemplateBuildRequest generates requests for StartTemplateBuild 4155 func NewStartTemplateBuildRequest(server string, templateID TemplateID, buildID BuildID) (*http.Request, error) { 4156 var err error 4157 4158 var pathParam0 string 4159 4160 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4161 if err != nil { 4162 return nil, err 4163 } 4164 4165 var pathParam1 string 4166 4167 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "buildID", runtime.ParamLocationPath, buildID) 4168 if err != nil { 4169 return nil, err 4170 } 4171 4172 serverURL, err := url.Parse(server) 4173 if err != nil { 4174 return nil, err 4175 } 4176 4177 operationPath := fmt.Sprintf("/templates/%s/builds/%s", pathParam0, pathParam1) 4178 if operationPath[0] == '/' { 4179 operationPath = "." + operationPath 4180 } 4181 4182 queryURL, err := serverURL.Parse(operationPath) 4183 if err != nil { 4184 return nil, err 4185 } 4186 4187 req, err := http.NewRequest("POST", queryURL.String(), nil) 4188 if err != nil { 4189 return nil, err 4190 } 4191 4192 return req, nil 4193 } 4194 4195 // NewGetTemplateBuildLogsRequest generates requests for GetTemplateBuildLogs 4196 func NewGetTemplateBuildLogsRequest(server string, templateID TemplateID, buildID BuildID, params *GetTemplateBuildLogsParams) (*http.Request, error) { 4197 var err error 4198 4199 var pathParam0 string 4200 4201 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4202 if err != nil { 4203 return nil, err 4204 } 4205 4206 var pathParam1 string 4207 4208 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "buildID", runtime.ParamLocationPath, buildID) 4209 if err != nil { 4210 return nil, err 4211 } 4212 4213 serverURL, err := url.Parse(server) 4214 if err != nil { 4215 return nil, err 4216 } 4217 4218 operationPath := fmt.Sprintf("/templates/%s/builds/%s/logs", pathParam0, pathParam1) 4219 if operationPath[0] == '/' { 4220 operationPath = "." + operationPath 4221 } 4222 4223 queryURL, err := serverURL.Parse(operationPath) 4224 if err != nil { 4225 return nil, err 4226 } 4227 4228 if params != nil { 4229 queryValues := queryURL.Query() 4230 4231 if params.Cursor != nil { 4232 4233 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cursor", runtime.ParamLocationQuery, *params.Cursor); err != nil { 4234 return nil, err 4235 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4236 return nil, err 4237 } else { 4238 for k, v := range parsed { 4239 for _, v2 := range v { 4240 queryValues.Add(k, v2) 4241 } 4242 } 4243 } 4244 4245 } 4246 4247 if params.Limit != nil { 4248 4249 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { 4250 return nil, err 4251 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4252 return nil, err 4253 } else { 4254 for k, v := range parsed { 4255 for _, v2 := range v { 4256 queryValues.Add(k, v2) 4257 } 4258 } 4259 } 4260 4261 } 4262 4263 if params.Direction != nil { 4264 4265 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "direction", runtime.ParamLocationQuery, *params.Direction); err != nil { 4266 return nil, err 4267 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4268 return nil, err 4269 } else { 4270 for k, v := range parsed { 4271 for _, v2 := range v { 4272 queryValues.Add(k, v2) 4273 } 4274 } 4275 } 4276 4277 } 4278 4279 if params.Level != nil { 4280 4281 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "level", runtime.ParamLocationQuery, *params.Level); err != nil { 4282 return nil, err 4283 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4284 return nil, err 4285 } else { 4286 for k, v := range parsed { 4287 for _, v2 := range v { 4288 queryValues.Add(k, v2) 4289 } 4290 } 4291 } 4292 4293 } 4294 4295 if params.Source != nil { 4296 4297 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "source", runtime.ParamLocationQuery, *params.Source); err != nil { 4298 return nil, err 4299 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4300 return nil, err 4301 } else { 4302 for k, v := range parsed { 4303 for _, v2 := range v { 4304 queryValues.Add(k, v2) 4305 } 4306 } 4307 } 4308 4309 } 4310 4311 queryURL.RawQuery = queryValues.Encode() 4312 } 4313 4314 req, err := http.NewRequest("GET", queryURL.String(), nil) 4315 if err != nil { 4316 return nil, err 4317 } 4318 4319 return req, nil 4320 } 4321 4322 // NewGetTemplateBuildStatusRequest generates requests for GetTemplateBuildStatus 4323 func NewGetTemplateBuildStatusRequest(server string, templateID TemplateID, buildID BuildID, params *GetTemplateBuildStatusParams) (*http.Request, error) { 4324 var err error 4325 4326 var pathParam0 string 4327 4328 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4329 if err != nil { 4330 return nil, err 4331 } 4332 4333 var pathParam1 string 4334 4335 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "buildID", runtime.ParamLocationPath, buildID) 4336 if err != nil { 4337 return nil, err 4338 } 4339 4340 serverURL, err := url.Parse(server) 4341 if err != nil { 4342 return nil, err 4343 } 4344 4345 operationPath := fmt.Sprintf("/templates/%s/builds/%s/status", pathParam0, pathParam1) 4346 if operationPath[0] == '/' { 4347 operationPath = "." + operationPath 4348 } 4349 4350 queryURL, err := serverURL.Parse(operationPath) 4351 if err != nil { 4352 return nil, err 4353 } 4354 4355 if params != nil { 4356 queryValues := queryURL.Query() 4357 4358 if params.LogsOffset != nil { 4359 4360 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "logsOffset", runtime.ParamLocationQuery, *params.LogsOffset); err != nil { 4361 return nil, err 4362 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4363 return nil, err 4364 } else { 4365 for k, v := range parsed { 4366 for _, v2 := range v { 4367 queryValues.Add(k, v2) 4368 } 4369 } 4370 } 4371 4372 } 4373 4374 if params.Limit != nil { 4375 4376 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { 4377 return nil, err 4378 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4379 return nil, err 4380 } else { 4381 for k, v := range parsed { 4382 for _, v2 := range v { 4383 queryValues.Add(k, v2) 4384 } 4385 } 4386 } 4387 4388 } 4389 4390 if params.Level != nil { 4391 4392 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "level", runtime.ParamLocationQuery, *params.Level); err != nil { 4393 return nil, err 4394 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4395 return nil, err 4396 } else { 4397 for k, v := range parsed { 4398 for _, v2 := range v { 4399 queryValues.Add(k, v2) 4400 } 4401 } 4402 } 4403 4404 } 4405 4406 queryURL.RawQuery = queryValues.Encode() 4407 } 4408 4409 req, err := http.NewRequest("GET", queryURL.String(), nil) 4410 if err != nil { 4411 return nil, err 4412 } 4413 4414 return req, nil 4415 } 4416 4417 // NewGetTemplateFilesRequest generates requests for GetTemplateFiles 4418 func NewGetTemplateFilesRequest(server string, templateID TemplateID, hash string) (*http.Request, error) { 4419 var err error 4420 4421 var pathParam0 string 4422 4423 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4424 if err != nil { 4425 return nil, err 4426 } 4427 4428 var pathParam1 string 4429 4430 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "hash", runtime.ParamLocationPath, hash) 4431 if err != nil { 4432 return nil, err 4433 } 4434 4435 serverURL, err := url.Parse(server) 4436 if err != nil { 4437 return nil, err 4438 } 4439 4440 operationPath := fmt.Sprintf("/templates/%s/files/%s", pathParam0, pathParam1) 4441 if operationPath[0] == '/' { 4442 operationPath = "." + operationPath 4443 } 4444 4445 queryURL, err := serverURL.Parse(operationPath) 4446 if err != nil { 4447 return nil, err 4448 } 4449 4450 req, err := http.NewRequest("GET", queryURL.String(), nil) 4451 if err != nil { 4452 return nil, err 4453 } 4454 4455 return req, nil 4456 } 4457 4458 // NewListSandboxesV2Request generates requests for ListSandboxesV2 4459 func NewListSandboxesV2Request(server string, params *ListSandboxesV2Params) (*http.Request, error) { 4460 var err error 4461 4462 serverURL, err := url.Parse(server) 4463 if err != nil { 4464 return nil, err 4465 } 4466 4467 operationPath := fmt.Sprintf("/v2/sandboxes") 4468 if operationPath[0] == '/' { 4469 operationPath = "." + operationPath 4470 } 4471 4472 queryURL, err := serverURL.Parse(operationPath) 4473 if err != nil { 4474 return nil, err 4475 } 4476 4477 if params != nil { 4478 queryValues := queryURL.Query() 4479 4480 if params.Metadata != nil { 4481 4482 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "metadata", runtime.ParamLocationQuery, *params.Metadata); err != nil { 4483 return nil, err 4484 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4485 return nil, err 4486 } else { 4487 for k, v := range parsed { 4488 for _, v2 := range v { 4489 queryValues.Add(k, v2) 4490 } 4491 } 4492 } 4493 4494 } 4495 4496 if params.Template != nil { 4497 4498 if queryFrag, err := runtime.StyleParamWithLocation("form", false, "template", runtime.ParamLocationQuery, *params.Template); err != nil { 4499 return nil, err 4500 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4501 return nil, err 4502 } else { 4503 for k, v := range parsed { 4504 for _, v2 := range v { 4505 queryValues.Add(k, v2) 4506 } 4507 } 4508 } 4509 4510 } 4511 4512 if params.State != nil { 4513 4514 if queryFrag, err := runtime.StyleParamWithLocation("form", false, "state", runtime.ParamLocationQuery, *params.State); err != nil { 4515 return nil, err 4516 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4517 return nil, err 4518 } else { 4519 for k, v := range parsed { 4520 for _, v2 := range v { 4521 queryValues.Add(k, v2) 4522 } 4523 } 4524 } 4525 4526 } 4527 4528 if params.NextToken != nil { 4529 4530 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "nextToken", runtime.ParamLocationQuery, *params.NextToken); err != nil { 4531 return nil, err 4532 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4533 return nil, err 4534 } else { 4535 for k, v := range parsed { 4536 for _, v2 := range v { 4537 queryValues.Add(k, v2) 4538 } 4539 } 4540 } 4541 4542 } 4543 4544 if params.Limit != nil { 4545 4546 if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { 4547 return nil, err 4548 } else if parsed, err := url.ParseQuery(queryFrag); err != nil { 4549 return nil, err 4550 } else { 4551 for k, v := range parsed { 4552 for _, v2 := range v { 4553 queryValues.Add(k, v2) 4554 } 4555 } 4556 } 4557 4558 } 4559 4560 queryURL.RawQuery = queryValues.Encode() 4561 } 4562 4563 req, err := http.NewRequest("GET", queryURL.String(), nil) 4564 if err != nil { 4565 return nil, err 4566 } 4567 4568 return req, nil 4569 } 4570 4571 // NewCreateTemplateV2Request calls the generic CreateTemplateV2 builder with application/json body 4572 func NewCreateTemplateV2Request(server string, body CreateTemplateV2JSONRequestBody) (*http.Request, error) { 4573 var bodyReader io.Reader 4574 buf, err := json.Marshal(body) 4575 if err != nil { 4576 return nil, err 4577 } 4578 bodyReader = bytes.NewReader(buf) 4579 return NewCreateTemplateV2RequestWithBody(server, "application/json", bodyReader) 4580 } 4581 4582 // NewCreateTemplateV2RequestWithBody generates requests for CreateTemplateV2 with any type of body 4583 func NewCreateTemplateV2RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 4584 var err error 4585 4586 serverURL, err := url.Parse(server) 4587 if err != nil { 4588 return nil, err 4589 } 4590 4591 operationPath := fmt.Sprintf("/v2/templates") 4592 if operationPath[0] == '/' { 4593 operationPath = "." + operationPath 4594 } 4595 4596 queryURL, err := serverURL.Parse(operationPath) 4597 if err != nil { 4598 return nil, err 4599 } 4600 4601 req, err := http.NewRequest("POST", queryURL.String(), body) 4602 if err != nil { 4603 return nil, err 4604 } 4605 4606 req.Header.Add("Content-Type", contentType) 4607 4608 return req, nil 4609 } 4610 4611 // NewStartTemplateBuildV2Request calls the generic StartTemplateBuildV2 builder with application/json body 4612 func NewStartTemplateBuildV2Request(server string, templateID TemplateID, buildID BuildID, body StartTemplateBuildV2JSONRequestBody) (*http.Request, error) { 4613 var bodyReader io.Reader 4614 buf, err := json.Marshal(body) 4615 if err != nil { 4616 return nil, err 4617 } 4618 bodyReader = bytes.NewReader(buf) 4619 return NewStartTemplateBuildV2RequestWithBody(server, templateID, buildID, "application/json", bodyReader) 4620 } 4621 4622 // NewStartTemplateBuildV2RequestWithBody generates requests for StartTemplateBuildV2 with any type of body 4623 func NewStartTemplateBuildV2RequestWithBody(server string, templateID TemplateID, buildID BuildID, contentType string, body io.Reader) (*http.Request, error) { 4624 var err error 4625 4626 var pathParam0 string 4627 4628 pathParam0, err = runtime.StyleParamWithLocation("simple", false, "templateID", runtime.ParamLocationPath, templateID) 4629 if err != nil { 4630 return nil, err 4631 } 4632 4633 var pathParam1 string 4634 4635 pathParam1, err = runtime.StyleParamWithLocation("simple", false, "buildID", runtime.ParamLocationPath, buildID) 4636 if err != nil { 4637 return nil, err 4638 } 4639 4640 serverURL, err := url.Parse(server) 4641 if err != nil { 4642 return nil, err 4643 } 4644 4645 operationPath := fmt.Sprintf("/v2/templates/%s/builds/%s", pathParam0, pathParam1) 4646 if operationPath[0] == '/' { 4647 operationPath = "." + operationPath 4648 } 4649 4650 queryURL, err := serverURL.Parse(operationPath) 4651 if err != nil { 4652 return nil, err 4653 } 4654 4655 req, err := http.NewRequest("POST", queryURL.String(), body) 4656 if err != nil { 4657 return nil, err 4658 } 4659 4660 req.Header.Add("Content-Type", contentType) 4661 4662 return req, nil 4663 } 4664 4665 // NewCreateTemplateV3Request calls the generic CreateTemplateV3 builder with application/json body 4666 func NewCreateTemplateV3Request(server string, body CreateTemplateV3JSONRequestBody) (*http.Request, error) { 4667 var bodyReader io.Reader 4668 buf, err := json.Marshal(body) 4669 if err != nil { 4670 return nil, err 4671 } 4672 bodyReader = bytes.NewReader(buf) 4673 return NewCreateTemplateV3RequestWithBody(server, "application/json", bodyReader) 4674 } 4675 4676 // NewCreateTemplateV3RequestWithBody generates requests for CreateTemplateV3 with any type of body 4677 func NewCreateTemplateV3RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { 4678 var err error 4679 4680 serverURL, err := url.Parse(server) 4681 if err != nil { 4682 return nil, err 4683 } 4684 4685 operationPath := fmt.Sprintf("/v3/templates") 4686 if operationPath[0] == '/' { 4687 operationPath = "." + operationPath 4688 } 4689 4690 queryURL, err := serverURL.Parse(operationPath) 4691 if err != nil { 4692 return nil, err 4693 } 4694 4695 req, err := http.NewRequest("POST", queryURL.String(), body) 4696 if err != nil { 4697 return nil, err 4698 } 4699 4700 req.Header.Add("Content-Type", contentType) 4701 4702 return req, nil 4703 } 4704 4705 func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { 4706 for _, r := range c.RequestEditors { 4707 if err := r(ctx, req); err != nil { 4708 return err 4709 } 4710 } 4711 for _, r := range additionalEditors { 4712 if err := r(ctx, req); err != nil { 4713 return err 4714 } 4715 } 4716 return nil 4717 } 4718 4719 // ClientWithResponses builds on ClientInterface to offer response payloads 4720 type ClientWithResponses struct { 4721 ClientInterface 4722 } 4723 4724 // NewClientWithResponses creates a new ClientWithResponses, which wraps 4725 // Client with return type handling 4726 func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { 4727 client, err := NewClient(server, opts...) 4728 if err != nil { 4729 return nil, err 4730 } 4731 return &ClientWithResponses{client}, nil 4732 } 4733 4734 // WithBaseURL overrides the baseURL. 4735 func WithBaseURL(baseURL string) ClientOption { 4736 return func(c *Client) error { 4737 newBaseURL, err := url.Parse(baseURL) 4738 if err != nil { 4739 return err 4740 } 4741 c.Server = newBaseURL.String() 4742 return nil 4743 } 4744 } 4745 4746 // ClientWithResponsesInterface is the interface specification for the client with responses above. 4747 type ClientWithResponsesInterface interface { 4748 // ListDefaultTemplatesWithResponse request 4749 ListDefaultTemplatesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDefaultTemplatesResponse, error) 4750 4751 // GetInjectionRulesWithResponse request 4752 GetInjectionRulesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInjectionRulesResponse, error) 4753 4754 // PostInjectionRulesWithBodyWithResponse request with any body 4755 PostInjectionRulesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInjectionRulesResponse, error) 4756 4757 PostInjectionRulesWithResponse(ctx context.Context, body PostInjectionRulesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInjectionRulesResponse, error) 4758 4759 // DeleteInjectionRulesRuleIDWithResponse request 4760 DeleteInjectionRulesRuleIDWithResponse(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*DeleteInjectionRulesRuleIDResponse, error) 4761 4762 // GetInjectionRulesRuleIDWithResponse request 4763 GetInjectionRulesRuleIDWithResponse(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*GetInjectionRulesRuleIDResponse, error) 4764 4765 // PutInjectionRulesRuleIDWithBodyWithResponse request with any body 4766 PutInjectionRulesRuleIDWithBodyWithResponse(ctx context.Context, ruleID InjectionRuleID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutInjectionRulesRuleIDResponse, error) 4767 4768 PutInjectionRulesRuleIDWithResponse(ctx context.Context, ruleID InjectionRuleID, body PutInjectionRulesRuleIDJSONRequestBody, reqEditors ...RequestEditorFn) (*PutInjectionRulesRuleIDResponse, error) 4769 4770 // ListSandboxesWithResponse request 4771 ListSandboxesWithResponse(ctx context.Context, params *ListSandboxesParams, reqEditors ...RequestEditorFn) (*ListSandboxesResponse, error) 4772 4773 // CreateSandboxWithBodyWithResponse request with any body 4774 CreateSandboxWithBodyWithResponse(ctx context.Context, params *CreateSandboxParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSandboxResponse, error) 4775 4776 CreateSandboxWithResponse(ctx context.Context, params *CreateSandboxParams, body CreateSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSandboxResponse, error) 4777 4778 // GetSandboxesMetricsWithResponse request 4779 GetSandboxesMetricsWithResponse(ctx context.Context, params *GetSandboxesMetricsParams, reqEditors ...RequestEditorFn) (*GetSandboxesMetricsResponse, error) 4780 4781 // DeleteSandboxWithResponse request 4782 DeleteSandboxWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*DeleteSandboxResponse, error) 4783 4784 // GetSandboxWithResponse request 4785 GetSandboxWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*GetSandboxResponse, error) 4786 4787 // ConnectSandboxWithBodyWithResponse request with any body 4788 ConnectSandboxWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConnectSandboxResponse, error) 4789 4790 ConnectSandboxWithResponse(ctx context.Context, sandboxID SandboxID, body ConnectSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*ConnectSandboxResponse, error) 4791 4792 // UpdateSandboxGithubTokenWithBodyWithResponse request with any body 4793 UpdateSandboxGithubTokenWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSandboxGithubTokenResponse, error) 4794 4795 UpdateSandboxGithubTokenWithResponse(ctx context.Context, sandboxID SandboxID, body UpdateSandboxGithubTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSandboxGithubTokenResponse, error) 4796 4797 // GetSandboxInjectionsWithResponse request 4798 GetSandboxInjectionsWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*GetSandboxInjectionsResponse, error) 4799 4800 // UpdateSandboxInjectionsWithBodyWithResponse request with any body 4801 UpdateSandboxInjectionsWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSandboxInjectionsResponse, error) 4802 4803 UpdateSandboxInjectionsWithResponse(ctx context.Context, sandboxID SandboxID, body UpdateSandboxInjectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSandboxInjectionsResponse, error) 4804 4805 // GetSandboxLogsWithResponse request 4806 GetSandboxLogsWithResponse(ctx context.Context, sandboxID SandboxID, params *GetSandboxLogsParams, reqEditors ...RequestEditorFn) (*GetSandboxLogsResponse, error) 4807 4808 // GetSandboxMetricsWithResponse request 4809 GetSandboxMetricsWithResponse(ctx context.Context, sandboxID SandboxID, params *GetSandboxMetricsParams, reqEditors ...RequestEditorFn) (*GetSandboxMetricsResponse, error) 4810 4811 // PauseSandboxWithResponse request 4812 PauseSandboxWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*PauseSandboxResponse, error) 4813 4814 // RefreshSandboxWithBodyWithResponse request with any body 4815 RefreshSandboxWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RefreshSandboxResponse, error) 4816 4817 RefreshSandboxWithResponse(ctx context.Context, sandboxID SandboxID, body RefreshSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*RefreshSandboxResponse, error) 4818 4819 // ResumeSandboxWithBodyWithResponse request with any body 4820 ResumeSandboxWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResumeSandboxResponse, error) 4821 4822 ResumeSandboxWithResponse(ctx context.Context, sandboxID SandboxID, body ResumeSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*ResumeSandboxResponse, error) 4823 4824 // UpdateSandboxTimeoutWithBodyWithResponse request with any body 4825 UpdateSandboxTimeoutWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSandboxTimeoutResponse, error) 4826 4827 UpdateSandboxTimeoutWithResponse(ctx context.Context, sandboxID SandboxID, body UpdateSandboxTimeoutJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSandboxTimeoutResponse, error) 4828 4829 // ListTemplatesWithResponse request 4830 ListTemplatesWithResponse(ctx context.Context, params *ListTemplatesParams, reqEditors ...RequestEditorFn) (*ListTemplatesResponse, error) 4831 4832 // CreateTemplateWithBodyWithResponse request with any body 4833 CreateTemplateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTemplateResponse, error) 4834 4835 CreateTemplateWithResponse(ctx context.Context, body CreateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTemplateResponse, error) 4836 4837 // GetTemplateByAliasWithResponse request 4838 GetTemplateByAliasWithResponse(ctx context.Context, alias string, reqEditors ...RequestEditorFn) (*GetTemplateByAliasResponse, error) 4839 4840 // DeleteTemplateTagsWithBodyWithResponse request with any body 4841 DeleteTemplateTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteTemplateTagsResponse, error) 4842 4843 DeleteTemplateTagsWithResponse(ctx context.Context, body DeleteTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteTemplateTagsResponse, error) 4844 4845 // AssignTemplateTagsWithBodyWithResponse request with any body 4846 AssignTemplateTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssignTemplateTagsResponse, error) 4847 4848 AssignTemplateTagsWithResponse(ctx context.Context, body AssignTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*AssignTemplateTagsResponse, error) 4849 4850 // DeleteTemplateWithResponse request 4851 DeleteTemplateWithResponse(ctx context.Context, templateID TemplateID, reqEditors ...RequestEditorFn) (*DeleteTemplateResponse, error) 4852 4853 // GetTemplateWithResponse request 4854 GetTemplateWithResponse(ctx context.Context, templateID TemplateID, params *GetTemplateParams, reqEditors ...RequestEditorFn) (*GetTemplateResponse, error) 4855 4856 // UpdateTemplateWithBodyWithResponse request with any body 4857 UpdateTemplateWithBodyWithResponse(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTemplateResponse, error) 4858 4859 UpdateTemplateWithResponse(ctx context.Context, templateID TemplateID, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTemplateResponse, error) 4860 4861 // RebuildTemplateWithBodyWithResponse request with any body 4862 RebuildTemplateWithBodyWithResponse(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RebuildTemplateResponse, error) 4863 4864 RebuildTemplateWithResponse(ctx context.Context, templateID TemplateID, body RebuildTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*RebuildTemplateResponse, error) 4865 4866 // StartTemplateBuildWithResponse request 4867 StartTemplateBuildWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, reqEditors ...RequestEditorFn) (*StartTemplateBuildResponse, error) 4868 4869 // GetTemplateBuildLogsWithResponse request 4870 GetTemplateBuildLogsWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildLogsParams, reqEditors ...RequestEditorFn) (*GetTemplateBuildLogsResponse, error) 4871 4872 // GetTemplateBuildStatusWithResponse request 4873 GetTemplateBuildStatusWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildStatusParams, reqEditors ...RequestEditorFn) (*GetTemplateBuildStatusResponse, error) 4874 4875 // GetTemplateFilesWithResponse request 4876 GetTemplateFilesWithResponse(ctx context.Context, templateID TemplateID, hash string, reqEditors ...RequestEditorFn) (*GetTemplateFilesResponse, error) 4877 4878 // ListSandboxesV2WithResponse request 4879 ListSandboxesV2WithResponse(ctx context.Context, params *ListSandboxesV2Params, reqEditors ...RequestEditorFn) (*ListSandboxesV2Response, error) 4880 4881 // CreateTemplateV2WithBodyWithResponse request with any body 4882 CreateTemplateV2WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTemplateV2Response, error) 4883 4884 CreateTemplateV2WithResponse(ctx context.Context, body CreateTemplateV2JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTemplateV2Response, error) 4885 4886 // StartTemplateBuildV2WithBodyWithResponse request with any body 4887 StartTemplateBuildV2WithBodyWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartTemplateBuildV2Response, error) 4888 4889 StartTemplateBuildV2WithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, body StartTemplateBuildV2JSONRequestBody, reqEditors ...RequestEditorFn) (*StartTemplateBuildV2Response, error) 4890 4891 // CreateTemplateV3WithBodyWithResponse request with any body 4892 CreateTemplateV3WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTemplateV3Response, error) 4893 4894 CreateTemplateV3WithResponse(ctx context.Context, body CreateTemplateV3JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTemplateV3Response, error) 4895 } 4896 4897 type ListDefaultTemplatesResponse struct { 4898 Body []byte 4899 HTTPResponse *http.Response 4900 JSON200 *[]Template 4901 JSON401 *N401 4902 JSON500 *N500 4903 } 4904 4905 // Status returns HTTPResponse.Status 4906 func (r ListDefaultTemplatesResponse) Status() string { 4907 if r.HTTPResponse != nil { 4908 return r.HTTPResponse.Status 4909 } 4910 return http.StatusText(0) 4911 } 4912 4913 // StatusCode returns HTTPResponse.StatusCode 4914 func (r ListDefaultTemplatesResponse) StatusCode() int { 4915 if r.HTTPResponse != nil { 4916 return r.HTTPResponse.StatusCode 4917 } 4918 return 0 4919 } 4920 4921 type GetInjectionRulesResponse struct { 4922 Body []byte 4923 HTTPResponse *http.Response 4924 JSON200 *[]InjectionRule 4925 JSON400 *N400 4926 JSON401 *N401 4927 JSON500 *N500 4928 } 4929 4930 // Status returns HTTPResponse.Status 4931 func (r GetInjectionRulesResponse) Status() string { 4932 if r.HTTPResponse != nil { 4933 return r.HTTPResponse.Status 4934 } 4935 return http.StatusText(0) 4936 } 4937 4938 // StatusCode returns HTTPResponse.StatusCode 4939 func (r GetInjectionRulesResponse) StatusCode() int { 4940 if r.HTTPResponse != nil { 4941 return r.HTTPResponse.StatusCode 4942 } 4943 return 0 4944 } 4945 4946 type PostInjectionRulesResponse struct { 4947 Body []byte 4948 HTTPResponse *http.Response 4949 JSON201 *InjectionRule 4950 JSON400 *N400 4951 JSON401 *N401 4952 JSON409 *N409 4953 JSON500 *N500 4954 } 4955 4956 // Status returns HTTPResponse.Status 4957 func (r PostInjectionRulesResponse) Status() string { 4958 if r.HTTPResponse != nil { 4959 return r.HTTPResponse.Status 4960 } 4961 return http.StatusText(0) 4962 } 4963 4964 // StatusCode returns HTTPResponse.StatusCode 4965 func (r PostInjectionRulesResponse) StatusCode() int { 4966 if r.HTTPResponse != nil { 4967 return r.HTTPResponse.StatusCode 4968 } 4969 return 0 4970 } 4971 4972 type DeleteInjectionRulesRuleIDResponse struct { 4973 Body []byte 4974 HTTPResponse *http.Response 4975 JSON401 *N401 4976 JSON404 *N404 4977 JSON500 *N500 4978 } 4979 4980 // Status returns HTTPResponse.Status 4981 func (r DeleteInjectionRulesRuleIDResponse) Status() string { 4982 if r.HTTPResponse != nil { 4983 return r.HTTPResponse.Status 4984 } 4985 return http.StatusText(0) 4986 } 4987 4988 // StatusCode returns HTTPResponse.StatusCode 4989 func (r DeleteInjectionRulesRuleIDResponse) StatusCode() int { 4990 if r.HTTPResponse != nil { 4991 return r.HTTPResponse.StatusCode 4992 } 4993 return 0 4994 } 4995 4996 type GetInjectionRulesRuleIDResponse struct { 4997 Body []byte 4998 HTTPResponse *http.Response 4999 JSON200 *InjectionRule 5000 JSON401 *N401 5001 JSON404 *N404 5002 JSON500 *N500 5003 } 5004 5005 // Status returns HTTPResponse.Status 5006 func (r GetInjectionRulesRuleIDResponse) Status() string { 5007 if r.HTTPResponse != nil { 5008 return r.HTTPResponse.Status 5009 } 5010 return http.StatusText(0) 5011 } 5012 5013 // StatusCode returns HTTPResponse.StatusCode 5014 func (r GetInjectionRulesRuleIDResponse) StatusCode() int { 5015 if r.HTTPResponse != nil { 5016 return r.HTTPResponse.StatusCode 5017 } 5018 return 0 5019 } 5020 5021 type PutInjectionRulesRuleIDResponse struct { 5022 Body []byte 5023 HTTPResponse *http.Response 5024 JSON200 *InjectionRule 5025 JSON400 *N400 5026 JSON404 *N404 5027 JSON409 *N409 5028 JSON500 *N500 5029 } 5030 5031 // Status returns HTTPResponse.Status 5032 func (r PutInjectionRulesRuleIDResponse) Status() string { 5033 if r.HTTPResponse != nil { 5034 return r.HTTPResponse.Status 5035 } 5036 return http.StatusText(0) 5037 } 5038 5039 // StatusCode returns HTTPResponse.StatusCode 5040 func (r PutInjectionRulesRuleIDResponse) StatusCode() int { 5041 if r.HTTPResponse != nil { 5042 return r.HTTPResponse.StatusCode 5043 } 5044 return 0 5045 } 5046 5047 type ListSandboxesResponse struct { 5048 Body []byte 5049 HTTPResponse *http.Response 5050 JSON200 *[]ListedSandbox 5051 JSON400 *N400 5052 JSON401 *N401 5053 JSON500 *N500 5054 } 5055 5056 // Status returns HTTPResponse.Status 5057 func (r ListSandboxesResponse) Status() string { 5058 if r.HTTPResponse != nil { 5059 return r.HTTPResponse.Status 5060 } 5061 return http.StatusText(0) 5062 } 5063 5064 // StatusCode returns HTTPResponse.StatusCode 5065 func (r ListSandboxesResponse) StatusCode() int { 5066 if r.HTTPResponse != nil { 5067 return r.HTTPResponse.StatusCode 5068 } 5069 return 0 5070 } 5071 5072 type CreateSandboxResponse struct { 5073 Body []byte 5074 HTTPResponse *http.Response 5075 JSON201 *Sandbox 5076 JSON400 *N400 5077 JSON401 *N401 5078 JSON408 *Error 5079 JSON409 *Error 5080 JSON500 *N500 5081 } 5082 5083 // Status returns HTTPResponse.Status 5084 func (r CreateSandboxResponse) Status() string { 5085 if r.HTTPResponse != nil { 5086 return r.HTTPResponse.Status 5087 } 5088 return http.StatusText(0) 5089 } 5090 5091 // StatusCode returns HTTPResponse.StatusCode 5092 func (r CreateSandboxResponse) StatusCode() int { 5093 if r.HTTPResponse != nil { 5094 return r.HTTPResponse.StatusCode 5095 } 5096 return 0 5097 } 5098 5099 type GetSandboxesMetricsResponse struct { 5100 Body []byte 5101 HTTPResponse *http.Response 5102 JSON200 *SandboxesWithMetrics 5103 JSON400 *N400 5104 JSON401 *N401 5105 JSON500 *N500 5106 } 5107 5108 // Status returns HTTPResponse.Status 5109 func (r GetSandboxesMetricsResponse) Status() string { 5110 if r.HTTPResponse != nil { 5111 return r.HTTPResponse.Status 5112 } 5113 return http.StatusText(0) 5114 } 5115 5116 // StatusCode returns HTTPResponse.StatusCode 5117 func (r GetSandboxesMetricsResponse) StatusCode() int { 5118 if r.HTTPResponse != nil { 5119 return r.HTTPResponse.StatusCode 5120 } 5121 return 0 5122 } 5123 5124 type DeleteSandboxResponse struct { 5125 Body []byte 5126 HTTPResponse *http.Response 5127 JSON401 *N401 5128 JSON404 *N404 5129 JSON500 *N500 5130 } 5131 5132 // Status returns HTTPResponse.Status 5133 func (r DeleteSandboxResponse) Status() string { 5134 if r.HTTPResponse != nil { 5135 return r.HTTPResponse.Status 5136 } 5137 return http.StatusText(0) 5138 } 5139 5140 // StatusCode returns HTTPResponse.StatusCode 5141 func (r DeleteSandboxResponse) StatusCode() int { 5142 if r.HTTPResponse != nil { 5143 return r.HTTPResponse.StatusCode 5144 } 5145 return 0 5146 } 5147 5148 type GetSandboxResponse struct { 5149 Body []byte 5150 HTTPResponse *http.Response 5151 JSON200 *SandboxDetail 5152 JSON401 *N401 5153 JSON404 *N404 5154 JSON500 *N500 5155 } 5156 5157 // Status returns HTTPResponse.Status 5158 func (r GetSandboxResponse) Status() string { 5159 if r.HTTPResponse != nil { 5160 return r.HTTPResponse.Status 5161 } 5162 return http.StatusText(0) 5163 } 5164 5165 // StatusCode returns HTTPResponse.StatusCode 5166 func (r GetSandboxResponse) StatusCode() int { 5167 if r.HTTPResponse != nil { 5168 return r.HTTPResponse.StatusCode 5169 } 5170 return 0 5171 } 5172 5173 type ConnectSandboxResponse struct { 5174 Body []byte 5175 HTTPResponse *http.Response 5176 JSON200 *Sandbox 5177 JSON201 *Sandbox 5178 JSON400 *N400 5179 JSON401 *N401 5180 JSON404 *N404 5181 JSON500 *N500 5182 } 5183 5184 // Status returns HTTPResponse.Status 5185 func (r ConnectSandboxResponse) Status() string { 5186 if r.HTTPResponse != nil { 5187 return r.HTTPResponse.Status 5188 } 5189 return http.StatusText(0) 5190 } 5191 5192 // StatusCode returns HTTPResponse.StatusCode 5193 func (r ConnectSandboxResponse) StatusCode() int { 5194 if r.HTTPResponse != nil { 5195 return r.HTTPResponse.StatusCode 5196 } 5197 return 0 5198 } 5199 5200 type UpdateSandboxGithubTokenResponse struct { 5201 Body []byte 5202 HTTPResponse *http.Response 5203 JSON400 *N400 5204 JSON401 *N401 5205 JSON404 *N404 5206 JSON500 *N500 5207 } 5208 5209 // Status returns HTTPResponse.Status 5210 func (r UpdateSandboxGithubTokenResponse) Status() string { 5211 if r.HTTPResponse != nil { 5212 return r.HTTPResponse.Status 5213 } 5214 return http.StatusText(0) 5215 } 5216 5217 // StatusCode returns HTTPResponse.StatusCode 5218 func (r UpdateSandboxGithubTokenResponse) StatusCode() int { 5219 if r.HTTPResponse != nil { 5220 return r.HTTPResponse.StatusCode 5221 } 5222 return 0 5223 } 5224 5225 type GetSandboxInjectionsResponse struct { 5226 Body []byte 5227 HTTPResponse *http.Response 5228 JSON200 *struct { 5229 Injections []SandboxInjection `json:"injections"` 5230 } 5231 JSON401 *N401 5232 JSON404 *N404 5233 JSON500 *N500 5234 } 5235 5236 // Status returns HTTPResponse.Status 5237 func (r GetSandboxInjectionsResponse) Status() string { 5238 if r.HTTPResponse != nil { 5239 return r.HTTPResponse.Status 5240 } 5241 return http.StatusText(0) 5242 } 5243 5244 // StatusCode returns HTTPResponse.StatusCode 5245 func (r GetSandboxInjectionsResponse) StatusCode() int { 5246 if r.HTTPResponse != nil { 5247 return r.HTTPResponse.StatusCode 5248 } 5249 return 0 5250 } 5251 5252 type UpdateSandboxInjectionsResponse struct { 5253 Body []byte 5254 HTTPResponse *http.Response 5255 JSON400 *N400 5256 JSON401 *N401 5257 JSON404 *N404 5258 JSON500 *N500 5259 } 5260 5261 // Status returns HTTPResponse.Status 5262 func (r UpdateSandboxInjectionsResponse) Status() string { 5263 if r.HTTPResponse != nil { 5264 return r.HTTPResponse.Status 5265 } 5266 return http.StatusText(0) 5267 } 5268 5269 // StatusCode returns HTTPResponse.StatusCode 5270 func (r UpdateSandboxInjectionsResponse) StatusCode() int { 5271 if r.HTTPResponse != nil { 5272 return r.HTTPResponse.StatusCode 5273 } 5274 return 0 5275 } 5276 5277 type GetSandboxLogsResponse struct { 5278 Body []byte 5279 HTTPResponse *http.Response 5280 JSON200 *SandboxLogs 5281 JSON401 *N401 5282 JSON404 *N404 5283 JSON500 *N500 5284 } 5285 5286 // Status returns HTTPResponse.Status 5287 func (r GetSandboxLogsResponse) Status() string { 5288 if r.HTTPResponse != nil { 5289 return r.HTTPResponse.Status 5290 } 5291 return http.StatusText(0) 5292 } 5293 5294 // StatusCode returns HTTPResponse.StatusCode 5295 func (r GetSandboxLogsResponse) StatusCode() int { 5296 if r.HTTPResponse != nil { 5297 return r.HTTPResponse.StatusCode 5298 } 5299 return 0 5300 } 5301 5302 type GetSandboxMetricsResponse struct { 5303 Body []byte 5304 HTTPResponse *http.Response 5305 JSON200 *[]SandboxMetric 5306 JSON400 *N400 5307 JSON401 *N401 5308 JSON404 *N404 5309 JSON500 *N500 5310 } 5311 5312 // Status returns HTTPResponse.Status 5313 func (r GetSandboxMetricsResponse) Status() string { 5314 if r.HTTPResponse != nil { 5315 return r.HTTPResponse.Status 5316 } 5317 return http.StatusText(0) 5318 } 5319 5320 // StatusCode returns HTTPResponse.StatusCode 5321 func (r GetSandboxMetricsResponse) StatusCode() int { 5322 if r.HTTPResponse != nil { 5323 return r.HTTPResponse.StatusCode 5324 } 5325 return 0 5326 } 5327 5328 type PauseSandboxResponse struct { 5329 Body []byte 5330 HTTPResponse *http.Response 5331 JSON401 *N401 5332 JSON404 *N404 5333 JSON409 *N409 5334 JSON500 *N500 5335 } 5336 5337 // Status returns HTTPResponse.Status 5338 func (r PauseSandboxResponse) Status() string { 5339 if r.HTTPResponse != nil { 5340 return r.HTTPResponse.Status 5341 } 5342 return http.StatusText(0) 5343 } 5344 5345 // StatusCode returns HTTPResponse.StatusCode 5346 func (r PauseSandboxResponse) StatusCode() int { 5347 if r.HTTPResponse != nil { 5348 return r.HTTPResponse.StatusCode 5349 } 5350 return 0 5351 } 5352 5353 type RefreshSandboxResponse struct { 5354 Body []byte 5355 HTTPResponse *http.Response 5356 JSON401 *N401 5357 JSON404 *N404 5358 } 5359 5360 // Status returns HTTPResponse.Status 5361 func (r RefreshSandboxResponse) Status() string { 5362 if r.HTTPResponse != nil { 5363 return r.HTTPResponse.Status 5364 } 5365 return http.StatusText(0) 5366 } 5367 5368 // StatusCode returns HTTPResponse.StatusCode 5369 func (r RefreshSandboxResponse) StatusCode() int { 5370 if r.HTTPResponse != nil { 5371 return r.HTTPResponse.StatusCode 5372 } 5373 return 0 5374 } 5375 5376 type ResumeSandboxResponse struct { 5377 Body []byte 5378 HTTPResponse *http.Response 5379 JSON201 *Sandbox 5380 JSON401 *N401 5381 JSON404 *N404 5382 JSON409 *N409 5383 JSON500 *N500 5384 } 5385 5386 // Status returns HTTPResponse.Status 5387 func (r ResumeSandboxResponse) Status() string { 5388 if r.HTTPResponse != nil { 5389 return r.HTTPResponse.Status 5390 } 5391 return http.StatusText(0) 5392 } 5393 5394 // StatusCode returns HTTPResponse.StatusCode 5395 func (r ResumeSandboxResponse) StatusCode() int { 5396 if r.HTTPResponse != nil { 5397 return r.HTTPResponse.StatusCode 5398 } 5399 return 0 5400 } 5401 5402 type UpdateSandboxTimeoutResponse struct { 5403 Body []byte 5404 HTTPResponse *http.Response 5405 JSON401 *N401 5406 JSON404 *N404 5407 JSON500 *N500 5408 } 5409 5410 // Status returns HTTPResponse.Status 5411 func (r UpdateSandboxTimeoutResponse) Status() string { 5412 if r.HTTPResponse != nil { 5413 return r.HTTPResponse.Status 5414 } 5415 return http.StatusText(0) 5416 } 5417 5418 // StatusCode returns HTTPResponse.StatusCode 5419 func (r UpdateSandboxTimeoutResponse) StatusCode() int { 5420 if r.HTTPResponse != nil { 5421 return r.HTTPResponse.StatusCode 5422 } 5423 return 0 5424 } 5425 5426 type ListTemplatesResponse struct { 5427 Body []byte 5428 HTTPResponse *http.Response 5429 JSON200 *[]Template 5430 JSON401 *N401 5431 JSON500 *N500 5432 } 5433 5434 // Status returns HTTPResponse.Status 5435 func (r ListTemplatesResponse) Status() string { 5436 if r.HTTPResponse != nil { 5437 return r.HTTPResponse.Status 5438 } 5439 return http.StatusText(0) 5440 } 5441 5442 // StatusCode returns HTTPResponse.StatusCode 5443 func (r ListTemplatesResponse) StatusCode() int { 5444 if r.HTTPResponse != nil { 5445 return r.HTTPResponse.StatusCode 5446 } 5447 return 0 5448 } 5449 5450 type CreateTemplateResponse struct { 5451 Body []byte 5452 HTTPResponse *http.Response 5453 JSON202 *TemplateLegacy 5454 JSON400 *N400 5455 JSON401 *N401 5456 JSON500 *N500 5457 } 5458 5459 // Status returns HTTPResponse.Status 5460 func (r CreateTemplateResponse) Status() string { 5461 if r.HTTPResponse != nil { 5462 return r.HTTPResponse.Status 5463 } 5464 return http.StatusText(0) 5465 } 5466 5467 // StatusCode returns HTTPResponse.StatusCode 5468 func (r CreateTemplateResponse) StatusCode() int { 5469 if r.HTTPResponse != nil { 5470 return r.HTTPResponse.StatusCode 5471 } 5472 return 0 5473 } 5474 5475 type GetTemplateByAliasResponse struct { 5476 Body []byte 5477 HTTPResponse *http.Response 5478 JSON200 *TemplateAliasResponse 5479 JSON400 *N400 5480 JSON403 *N403 5481 JSON404 *N404 5482 JSON500 *N500 5483 } 5484 5485 // Status returns HTTPResponse.Status 5486 func (r GetTemplateByAliasResponse) Status() string { 5487 if r.HTTPResponse != nil { 5488 return r.HTTPResponse.Status 5489 } 5490 return http.StatusText(0) 5491 } 5492 5493 // StatusCode returns HTTPResponse.StatusCode 5494 func (r GetTemplateByAliasResponse) StatusCode() int { 5495 if r.HTTPResponse != nil { 5496 return r.HTTPResponse.StatusCode 5497 } 5498 return 0 5499 } 5500 5501 type DeleteTemplateTagsResponse struct { 5502 Body []byte 5503 HTTPResponse *http.Response 5504 JSON400 *N400 5505 JSON401 *N401 5506 JSON404 *N404 5507 JSON500 *N500 5508 } 5509 5510 // Status returns HTTPResponse.Status 5511 func (r DeleteTemplateTagsResponse) Status() string { 5512 if r.HTTPResponse != nil { 5513 return r.HTTPResponse.Status 5514 } 5515 return http.StatusText(0) 5516 } 5517 5518 // StatusCode returns HTTPResponse.StatusCode 5519 func (r DeleteTemplateTagsResponse) StatusCode() int { 5520 if r.HTTPResponse != nil { 5521 return r.HTTPResponse.StatusCode 5522 } 5523 return 0 5524 } 5525 5526 type AssignTemplateTagsResponse struct { 5527 Body []byte 5528 HTTPResponse *http.Response 5529 JSON201 *AssignedTemplateTags 5530 JSON400 *N400 5531 JSON401 *N401 5532 JSON404 *N404 5533 JSON500 *N500 5534 } 5535 5536 // Status returns HTTPResponse.Status 5537 func (r AssignTemplateTagsResponse) Status() string { 5538 if r.HTTPResponse != nil { 5539 return r.HTTPResponse.Status 5540 } 5541 return http.StatusText(0) 5542 } 5543 5544 // StatusCode returns HTTPResponse.StatusCode 5545 func (r AssignTemplateTagsResponse) StatusCode() int { 5546 if r.HTTPResponse != nil { 5547 return r.HTTPResponse.StatusCode 5548 } 5549 return 0 5550 } 5551 5552 type DeleteTemplateResponse struct { 5553 Body []byte 5554 HTTPResponse *http.Response 5555 JSON401 *N401 5556 JSON500 *N500 5557 } 5558 5559 // Status returns HTTPResponse.Status 5560 func (r DeleteTemplateResponse) Status() string { 5561 if r.HTTPResponse != nil { 5562 return r.HTTPResponse.Status 5563 } 5564 return http.StatusText(0) 5565 } 5566 5567 // StatusCode returns HTTPResponse.StatusCode 5568 func (r DeleteTemplateResponse) StatusCode() int { 5569 if r.HTTPResponse != nil { 5570 return r.HTTPResponse.StatusCode 5571 } 5572 return 0 5573 } 5574 5575 type GetTemplateResponse struct { 5576 Body []byte 5577 HTTPResponse *http.Response 5578 JSON200 *TemplateWithBuilds 5579 JSON401 *N401 5580 JSON500 *N500 5581 } 5582 5583 // Status returns HTTPResponse.Status 5584 func (r GetTemplateResponse) Status() string { 5585 if r.HTTPResponse != nil { 5586 return r.HTTPResponse.Status 5587 } 5588 return http.StatusText(0) 5589 } 5590 5591 // StatusCode returns HTTPResponse.StatusCode 5592 func (r GetTemplateResponse) StatusCode() int { 5593 if r.HTTPResponse != nil { 5594 return r.HTTPResponse.StatusCode 5595 } 5596 return 0 5597 } 5598 5599 type UpdateTemplateResponse struct { 5600 Body []byte 5601 HTTPResponse *http.Response 5602 JSON400 *N400 5603 JSON401 *N401 5604 JSON500 *N500 5605 } 5606 5607 // Status returns HTTPResponse.Status 5608 func (r UpdateTemplateResponse) Status() string { 5609 if r.HTTPResponse != nil { 5610 return r.HTTPResponse.Status 5611 } 5612 return http.StatusText(0) 5613 } 5614 5615 // StatusCode returns HTTPResponse.StatusCode 5616 func (r UpdateTemplateResponse) StatusCode() int { 5617 if r.HTTPResponse != nil { 5618 return r.HTTPResponse.StatusCode 5619 } 5620 return 0 5621 } 5622 5623 type RebuildTemplateResponse struct { 5624 Body []byte 5625 HTTPResponse *http.Response 5626 JSON202 *TemplateLegacy 5627 JSON401 *N401 5628 JSON500 *N500 5629 } 5630 5631 // Status returns HTTPResponse.Status 5632 func (r RebuildTemplateResponse) Status() string { 5633 if r.HTTPResponse != nil { 5634 return r.HTTPResponse.Status 5635 } 5636 return http.StatusText(0) 5637 } 5638 5639 // StatusCode returns HTTPResponse.StatusCode 5640 func (r RebuildTemplateResponse) StatusCode() int { 5641 if r.HTTPResponse != nil { 5642 return r.HTTPResponse.StatusCode 5643 } 5644 return 0 5645 } 5646 5647 type StartTemplateBuildResponse struct { 5648 Body []byte 5649 HTTPResponse *http.Response 5650 JSON401 *N401 5651 JSON500 *N500 5652 } 5653 5654 // Status returns HTTPResponse.Status 5655 func (r StartTemplateBuildResponse) Status() string { 5656 if r.HTTPResponse != nil { 5657 return r.HTTPResponse.Status 5658 } 5659 return http.StatusText(0) 5660 } 5661 5662 // StatusCode returns HTTPResponse.StatusCode 5663 func (r StartTemplateBuildResponse) StatusCode() int { 5664 if r.HTTPResponse != nil { 5665 return r.HTTPResponse.StatusCode 5666 } 5667 return 0 5668 } 5669 5670 type GetTemplateBuildLogsResponse struct { 5671 Body []byte 5672 HTTPResponse *http.Response 5673 JSON200 *TemplateBuildLogsResponse 5674 JSON401 *N401 5675 JSON404 *N404 5676 JSON500 *N500 5677 } 5678 5679 // Status returns HTTPResponse.Status 5680 func (r GetTemplateBuildLogsResponse) Status() string { 5681 if r.HTTPResponse != nil { 5682 return r.HTTPResponse.Status 5683 } 5684 return http.StatusText(0) 5685 } 5686 5687 // StatusCode returns HTTPResponse.StatusCode 5688 func (r GetTemplateBuildLogsResponse) StatusCode() int { 5689 if r.HTTPResponse != nil { 5690 return r.HTTPResponse.StatusCode 5691 } 5692 return 0 5693 } 5694 5695 type GetTemplateBuildStatusResponse struct { 5696 Body []byte 5697 HTTPResponse *http.Response 5698 JSON200 *TemplateBuildInfo 5699 JSON401 *N401 5700 JSON404 *N404 5701 JSON500 *N500 5702 } 5703 5704 // Status returns HTTPResponse.Status 5705 func (r GetTemplateBuildStatusResponse) Status() string { 5706 if r.HTTPResponse != nil { 5707 return r.HTTPResponse.Status 5708 } 5709 return http.StatusText(0) 5710 } 5711 5712 // StatusCode returns HTTPResponse.StatusCode 5713 func (r GetTemplateBuildStatusResponse) StatusCode() int { 5714 if r.HTTPResponse != nil { 5715 return r.HTTPResponse.StatusCode 5716 } 5717 return 0 5718 } 5719 5720 type GetTemplateFilesResponse struct { 5721 Body []byte 5722 HTTPResponse *http.Response 5723 JSON201 *TemplateBuildFileUpload 5724 JSON400 *N400 5725 JSON401 *N401 5726 JSON404 *N404 5727 JSON500 *N500 5728 } 5729 5730 // Status returns HTTPResponse.Status 5731 func (r GetTemplateFilesResponse) Status() string { 5732 if r.HTTPResponse != nil { 5733 return r.HTTPResponse.Status 5734 } 5735 return http.StatusText(0) 5736 } 5737 5738 // StatusCode returns HTTPResponse.StatusCode 5739 func (r GetTemplateFilesResponse) StatusCode() int { 5740 if r.HTTPResponse != nil { 5741 return r.HTTPResponse.StatusCode 5742 } 5743 return 0 5744 } 5745 5746 type ListSandboxesV2Response struct { 5747 Body []byte 5748 HTTPResponse *http.Response 5749 JSON200 *[]ListedSandbox 5750 JSON400 *N400 5751 JSON401 *N401 5752 JSON500 *N500 5753 } 5754 5755 // Status returns HTTPResponse.Status 5756 func (r ListSandboxesV2Response) Status() string { 5757 if r.HTTPResponse != nil { 5758 return r.HTTPResponse.Status 5759 } 5760 return http.StatusText(0) 5761 } 5762 5763 // StatusCode returns HTTPResponse.StatusCode 5764 func (r ListSandboxesV2Response) StatusCode() int { 5765 if r.HTTPResponse != nil { 5766 return r.HTTPResponse.StatusCode 5767 } 5768 return 0 5769 } 5770 5771 type CreateTemplateV2Response struct { 5772 Body []byte 5773 HTTPResponse *http.Response 5774 JSON202 *TemplateLegacy 5775 JSON400 *N400 5776 JSON401 *N401 5777 JSON500 *N500 5778 } 5779 5780 // Status returns HTTPResponse.Status 5781 func (r CreateTemplateV2Response) Status() string { 5782 if r.HTTPResponse != nil { 5783 return r.HTTPResponse.Status 5784 } 5785 return http.StatusText(0) 5786 } 5787 5788 // StatusCode returns HTTPResponse.StatusCode 5789 func (r CreateTemplateV2Response) StatusCode() int { 5790 if r.HTTPResponse != nil { 5791 return r.HTTPResponse.StatusCode 5792 } 5793 return 0 5794 } 5795 5796 type StartTemplateBuildV2Response struct { 5797 Body []byte 5798 HTTPResponse *http.Response 5799 JSON401 *N401 5800 JSON500 *N500 5801 } 5802 5803 // Status returns HTTPResponse.Status 5804 func (r StartTemplateBuildV2Response) Status() string { 5805 if r.HTTPResponse != nil { 5806 return r.HTTPResponse.Status 5807 } 5808 return http.StatusText(0) 5809 } 5810 5811 // StatusCode returns HTTPResponse.StatusCode 5812 func (r StartTemplateBuildV2Response) StatusCode() int { 5813 if r.HTTPResponse != nil { 5814 return r.HTTPResponse.StatusCode 5815 } 5816 return 0 5817 } 5818 5819 type CreateTemplateV3Response struct { 5820 Body []byte 5821 HTTPResponse *http.Response 5822 JSON202 *TemplateRequestResponseV3 5823 JSON400 *N400 5824 JSON401 *N401 5825 JSON500 *N500 5826 } 5827 5828 // Status returns HTTPResponse.Status 5829 func (r CreateTemplateV3Response) Status() string { 5830 if r.HTTPResponse != nil { 5831 return r.HTTPResponse.Status 5832 } 5833 return http.StatusText(0) 5834 } 5835 5836 // StatusCode returns HTTPResponse.StatusCode 5837 func (r CreateTemplateV3Response) StatusCode() int { 5838 if r.HTTPResponse != nil { 5839 return r.HTTPResponse.StatusCode 5840 } 5841 return 0 5842 } 5843 5844 // ListDefaultTemplatesWithResponse request returning *ListDefaultTemplatesResponse 5845 func (c *ClientWithResponses) ListDefaultTemplatesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDefaultTemplatesResponse, error) { 5846 rsp, err := c.ListDefaultTemplates(ctx, reqEditors...) 5847 if err != nil { 5848 return nil, err 5849 } 5850 return ParseListDefaultTemplatesResponse(rsp) 5851 } 5852 5853 // GetInjectionRulesWithResponse request returning *GetInjectionRulesResponse 5854 func (c *ClientWithResponses) GetInjectionRulesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInjectionRulesResponse, error) { 5855 rsp, err := c.GetInjectionRules(ctx, reqEditors...) 5856 if err != nil { 5857 return nil, err 5858 } 5859 return ParseGetInjectionRulesResponse(rsp) 5860 } 5861 5862 // PostInjectionRulesWithBodyWithResponse request with arbitrary body returning *PostInjectionRulesResponse 5863 func (c *ClientWithResponses) PostInjectionRulesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInjectionRulesResponse, error) { 5864 rsp, err := c.PostInjectionRulesWithBody(ctx, contentType, body, reqEditors...) 5865 if err != nil { 5866 return nil, err 5867 } 5868 return ParsePostInjectionRulesResponse(rsp) 5869 } 5870 5871 func (c *ClientWithResponses) PostInjectionRulesWithResponse(ctx context.Context, body PostInjectionRulesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInjectionRulesResponse, error) { 5872 rsp, err := c.PostInjectionRules(ctx, body, reqEditors...) 5873 if err != nil { 5874 return nil, err 5875 } 5876 return ParsePostInjectionRulesResponse(rsp) 5877 } 5878 5879 // DeleteInjectionRulesRuleIDWithResponse request returning *DeleteInjectionRulesRuleIDResponse 5880 func (c *ClientWithResponses) DeleteInjectionRulesRuleIDWithResponse(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*DeleteInjectionRulesRuleIDResponse, error) { 5881 rsp, err := c.DeleteInjectionRulesRuleID(ctx, ruleID, reqEditors...) 5882 if err != nil { 5883 return nil, err 5884 } 5885 return ParseDeleteInjectionRulesRuleIDResponse(rsp) 5886 } 5887 5888 // GetInjectionRulesRuleIDWithResponse request returning *GetInjectionRulesRuleIDResponse 5889 func (c *ClientWithResponses) GetInjectionRulesRuleIDWithResponse(ctx context.Context, ruleID InjectionRuleID, reqEditors ...RequestEditorFn) (*GetInjectionRulesRuleIDResponse, error) { 5890 rsp, err := c.GetInjectionRulesRuleID(ctx, ruleID, reqEditors...) 5891 if err != nil { 5892 return nil, err 5893 } 5894 return ParseGetInjectionRulesRuleIDResponse(rsp) 5895 } 5896 5897 // PutInjectionRulesRuleIDWithBodyWithResponse request with arbitrary body returning *PutInjectionRulesRuleIDResponse 5898 func (c *ClientWithResponses) PutInjectionRulesRuleIDWithBodyWithResponse(ctx context.Context, ruleID InjectionRuleID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutInjectionRulesRuleIDResponse, error) { 5899 rsp, err := c.PutInjectionRulesRuleIDWithBody(ctx, ruleID, contentType, body, reqEditors...) 5900 if err != nil { 5901 return nil, err 5902 } 5903 return ParsePutInjectionRulesRuleIDResponse(rsp) 5904 } 5905 5906 func (c *ClientWithResponses) PutInjectionRulesRuleIDWithResponse(ctx context.Context, ruleID InjectionRuleID, body PutInjectionRulesRuleIDJSONRequestBody, reqEditors ...RequestEditorFn) (*PutInjectionRulesRuleIDResponse, error) { 5907 rsp, err := c.PutInjectionRulesRuleID(ctx, ruleID, body, reqEditors...) 5908 if err != nil { 5909 return nil, err 5910 } 5911 return ParsePutInjectionRulesRuleIDResponse(rsp) 5912 } 5913 5914 // ListSandboxesWithResponse request returning *ListSandboxesResponse 5915 func (c *ClientWithResponses) ListSandboxesWithResponse(ctx context.Context, params *ListSandboxesParams, reqEditors ...RequestEditorFn) (*ListSandboxesResponse, error) { 5916 rsp, err := c.ListSandboxes(ctx, params, reqEditors...) 5917 if err != nil { 5918 return nil, err 5919 } 5920 return ParseListSandboxesResponse(rsp) 5921 } 5922 5923 // CreateSandboxWithBodyWithResponse request with arbitrary body returning *CreateSandboxResponse 5924 func (c *ClientWithResponses) CreateSandboxWithBodyWithResponse(ctx context.Context, params *CreateSandboxParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSandboxResponse, error) { 5925 rsp, err := c.CreateSandboxWithBody(ctx, params, contentType, body, reqEditors...) 5926 if err != nil { 5927 return nil, err 5928 } 5929 return ParseCreateSandboxResponse(rsp) 5930 } 5931 5932 func (c *ClientWithResponses) CreateSandboxWithResponse(ctx context.Context, params *CreateSandboxParams, body CreateSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSandboxResponse, error) { 5933 rsp, err := c.CreateSandbox(ctx, params, body, reqEditors...) 5934 if err != nil { 5935 return nil, err 5936 } 5937 return ParseCreateSandboxResponse(rsp) 5938 } 5939 5940 // GetSandboxesMetricsWithResponse request returning *GetSandboxesMetricsResponse 5941 func (c *ClientWithResponses) GetSandboxesMetricsWithResponse(ctx context.Context, params *GetSandboxesMetricsParams, reqEditors ...RequestEditorFn) (*GetSandboxesMetricsResponse, error) { 5942 rsp, err := c.GetSandboxesMetrics(ctx, params, reqEditors...) 5943 if err != nil { 5944 return nil, err 5945 } 5946 return ParseGetSandboxesMetricsResponse(rsp) 5947 } 5948 5949 // DeleteSandboxWithResponse request returning *DeleteSandboxResponse 5950 func (c *ClientWithResponses) DeleteSandboxWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*DeleteSandboxResponse, error) { 5951 rsp, err := c.DeleteSandbox(ctx, sandboxID, reqEditors...) 5952 if err != nil { 5953 return nil, err 5954 } 5955 return ParseDeleteSandboxResponse(rsp) 5956 } 5957 5958 // GetSandboxWithResponse request returning *GetSandboxResponse 5959 func (c *ClientWithResponses) GetSandboxWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*GetSandboxResponse, error) { 5960 rsp, err := c.GetSandbox(ctx, sandboxID, reqEditors...) 5961 if err != nil { 5962 return nil, err 5963 } 5964 return ParseGetSandboxResponse(rsp) 5965 } 5966 5967 // ConnectSandboxWithBodyWithResponse request with arbitrary body returning *ConnectSandboxResponse 5968 func (c *ClientWithResponses) ConnectSandboxWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConnectSandboxResponse, error) { 5969 rsp, err := c.ConnectSandboxWithBody(ctx, sandboxID, contentType, body, reqEditors...) 5970 if err != nil { 5971 return nil, err 5972 } 5973 return ParseConnectSandboxResponse(rsp) 5974 } 5975 5976 func (c *ClientWithResponses) ConnectSandboxWithResponse(ctx context.Context, sandboxID SandboxID, body ConnectSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*ConnectSandboxResponse, error) { 5977 rsp, err := c.ConnectSandbox(ctx, sandboxID, body, reqEditors...) 5978 if err != nil { 5979 return nil, err 5980 } 5981 return ParseConnectSandboxResponse(rsp) 5982 } 5983 5984 // UpdateSandboxGithubTokenWithBodyWithResponse request with arbitrary body returning *UpdateSandboxGithubTokenResponse 5985 func (c *ClientWithResponses) UpdateSandboxGithubTokenWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSandboxGithubTokenResponse, error) { 5986 rsp, err := c.UpdateSandboxGithubTokenWithBody(ctx, sandboxID, contentType, body, reqEditors...) 5987 if err != nil { 5988 return nil, err 5989 } 5990 return ParseUpdateSandboxGithubTokenResponse(rsp) 5991 } 5992 5993 func (c *ClientWithResponses) UpdateSandboxGithubTokenWithResponse(ctx context.Context, sandboxID SandboxID, body UpdateSandboxGithubTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSandboxGithubTokenResponse, error) { 5994 rsp, err := c.UpdateSandboxGithubToken(ctx, sandboxID, body, reqEditors...) 5995 if err != nil { 5996 return nil, err 5997 } 5998 return ParseUpdateSandboxGithubTokenResponse(rsp) 5999 } 6000 6001 // GetSandboxInjectionsWithResponse request returning *GetSandboxInjectionsResponse 6002 func (c *ClientWithResponses) GetSandboxInjectionsWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*GetSandboxInjectionsResponse, error) { 6003 rsp, err := c.GetSandboxInjections(ctx, sandboxID, reqEditors...) 6004 if err != nil { 6005 return nil, err 6006 } 6007 return ParseGetSandboxInjectionsResponse(rsp) 6008 } 6009 6010 // UpdateSandboxInjectionsWithBodyWithResponse request with arbitrary body returning *UpdateSandboxInjectionsResponse 6011 func (c *ClientWithResponses) UpdateSandboxInjectionsWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSandboxInjectionsResponse, error) { 6012 rsp, err := c.UpdateSandboxInjectionsWithBody(ctx, sandboxID, contentType, body, reqEditors...) 6013 if err != nil { 6014 return nil, err 6015 } 6016 return ParseUpdateSandboxInjectionsResponse(rsp) 6017 } 6018 6019 func (c *ClientWithResponses) UpdateSandboxInjectionsWithResponse(ctx context.Context, sandboxID SandboxID, body UpdateSandboxInjectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSandboxInjectionsResponse, error) { 6020 rsp, err := c.UpdateSandboxInjections(ctx, sandboxID, body, reqEditors...) 6021 if err != nil { 6022 return nil, err 6023 } 6024 return ParseUpdateSandboxInjectionsResponse(rsp) 6025 } 6026 6027 // GetSandboxLogsWithResponse request returning *GetSandboxLogsResponse 6028 func (c *ClientWithResponses) GetSandboxLogsWithResponse(ctx context.Context, sandboxID SandboxID, params *GetSandboxLogsParams, reqEditors ...RequestEditorFn) (*GetSandboxLogsResponse, error) { 6029 rsp, err := c.GetSandboxLogs(ctx, sandboxID, params, reqEditors...) 6030 if err != nil { 6031 return nil, err 6032 } 6033 return ParseGetSandboxLogsResponse(rsp) 6034 } 6035 6036 // GetSandboxMetricsWithResponse request returning *GetSandboxMetricsResponse 6037 func (c *ClientWithResponses) GetSandboxMetricsWithResponse(ctx context.Context, sandboxID SandboxID, params *GetSandboxMetricsParams, reqEditors ...RequestEditorFn) (*GetSandboxMetricsResponse, error) { 6038 rsp, err := c.GetSandboxMetrics(ctx, sandboxID, params, reqEditors...) 6039 if err != nil { 6040 return nil, err 6041 } 6042 return ParseGetSandboxMetricsResponse(rsp) 6043 } 6044 6045 // PauseSandboxWithResponse request returning *PauseSandboxResponse 6046 func (c *ClientWithResponses) PauseSandboxWithResponse(ctx context.Context, sandboxID SandboxID, reqEditors ...RequestEditorFn) (*PauseSandboxResponse, error) { 6047 rsp, err := c.PauseSandbox(ctx, sandboxID, reqEditors...) 6048 if err != nil { 6049 return nil, err 6050 } 6051 return ParsePauseSandboxResponse(rsp) 6052 } 6053 6054 // RefreshSandboxWithBodyWithResponse request with arbitrary body returning *RefreshSandboxResponse 6055 func (c *ClientWithResponses) RefreshSandboxWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RefreshSandboxResponse, error) { 6056 rsp, err := c.RefreshSandboxWithBody(ctx, sandboxID, contentType, body, reqEditors...) 6057 if err != nil { 6058 return nil, err 6059 } 6060 return ParseRefreshSandboxResponse(rsp) 6061 } 6062 6063 func (c *ClientWithResponses) RefreshSandboxWithResponse(ctx context.Context, sandboxID SandboxID, body RefreshSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*RefreshSandboxResponse, error) { 6064 rsp, err := c.RefreshSandbox(ctx, sandboxID, body, reqEditors...) 6065 if err != nil { 6066 return nil, err 6067 } 6068 return ParseRefreshSandboxResponse(rsp) 6069 } 6070 6071 // ResumeSandboxWithBodyWithResponse request with arbitrary body returning *ResumeSandboxResponse 6072 func (c *ClientWithResponses) ResumeSandboxWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResumeSandboxResponse, error) { 6073 rsp, err := c.ResumeSandboxWithBody(ctx, sandboxID, contentType, body, reqEditors...) 6074 if err != nil { 6075 return nil, err 6076 } 6077 return ParseResumeSandboxResponse(rsp) 6078 } 6079 6080 func (c *ClientWithResponses) ResumeSandboxWithResponse(ctx context.Context, sandboxID SandboxID, body ResumeSandboxJSONRequestBody, reqEditors ...RequestEditorFn) (*ResumeSandboxResponse, error) { 6081 rsp, err := c.ResumeSandbox(ctx, sandboxID, body, reqEditors...) 6082 if err != nil { 6083 return nil, err 6084 } 6085 return ParseResumeSandboxResponse(rsp) 6086 } 6087 6088 // UpdateSandboxTimeoutWithBodyWithResponse request with arbitrary body returning *UpdateSandboxTimeoutResponse 6089 func (c *ClientWithResponses) UpdateSandboxTimeoutWithBodyWithResponse(ctx context.Context, sandboxID SandboxID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSandboxTimeoutResponse, error) { 6090 rsp, err := c.UpdateSandboxTimeoutWithBody(ctx, sandboxID, contentType, body, reqEditors...) 6091 if err != nil { 6092 return nil, err 6093 } 6094 return ParseUpdateSandboxTimeoutResponse(rsp) 6095 } 6096 6097 func (c *ClientWithResponses) UpdateSandboxTimeoutWithResponse(ctx context.Context, sandboxID SandboxID, body UpdateSandboxTimeoutJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSandboxTimeoutResponse, error) { 6098 rsp, err := c.UpdateSandboxTimeout(ctx, sandboxID, body, reqEditors...) 6099 if err != nil { 6100 return nil, err 6101 } 6102 return ParseUpdateSandboxTimeoutResponse(rsp) 6103 } 6104 6105 // ListTemplatesWithResponse request returning *ListTemplatesResponse 6106 func (c *ClientWithResponses) ListTemplatesWithResponse(ctx context.Context, params *ListTemplatesParams, reqEditors ...RequestEditorFn) (*ListTemplatesResponse, error) { 6107 rsp, err := c.ListTemplates(ctx, params, reqEditors...) 6108 if err != nil { 6109 return nil, err 6110 } 6111 return ParseListTemplatesResponse(rsp) 6112 } 6113 6114 // CreateTemplateWithBodyWithResponse request with arbitrary body returning *CreateTemplateResponse 6115 func (c *ClientWithResponses) CreateTemplateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTemplateResponse, error) { 6116 rsp, err := c.CreateTemplateWithBody(ctx, contentType, body, reqEditors...) 6117 if err != nil { 6118 return nil, err 6119 } 6120 return ParseCreateTemplateResponse(rsp) 6121 } 6122 6123 func (c *ClientWithResponses) CreateTemplateWithResponse(ctx context.Context, body CreateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTemplateResponse, error) { 6124 rsp, err := c.CreateTemplate(ctx, body, reqEditors...) 6125 if err != nil { 6126 return nil, err 6127 } 6128 return ParseCreateTemplateResponse(rsp) 6129 } 6130 6131 // GetTemplateByAliasWithResponse request returning *GetTemplateByAliasResponse 6132 func (c *ClientWithResponses) GetTemplateByAliasWithResponse(ctx context.Context, alias string, reqEditors ...RequestEditorFn) (*GetTemplateByAliasResponse, error) { 6133 rsp, err := c.GetTemplateByAlias(ctx, alias, reqEditors...) 6134 if err != nil { 6135 return nil, err 6136 } 6137 return ParseGetTemplateByAliasResponse(rsp) 6138 } 6139 6140 // DeleteTemplateTagsWithBodyWithResponse request with arbitrary body returning *DeleteTemplateTagsResponse 6141 func (c *ClientWithResponses) DeleteTemplateTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteTemplateTagsResponse, error) { 6142 rsp, err := c.DeleteTemplateTagsWithBody(ctx, contentType, body, reqEditors...) 6143 if err != nil { 6144 return nil, err 6145 } 6146 return ParseDeleteTemplateTagsResponse(rsp) 6147 } 6148 6149 func (c *ClientWithResponses) DeleteTemplateTagsWithResponse(ctx context.Context, body DeleteTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteTemplateTagsResponse, error) { 6150 rsp, err := c.DeleteTemplateTags(ctx, body, reqEditors...) 6151 if err != nil { 6152 return nil, err 6153 } 6154 return ParseDeleteTemplateTagsResponse(rsp) 6155 } 6156 6157 // AssignTemplateTagsWithBodyWithResponse request with arbitrary body returning *AssignTemplateTagsResponse 6158 func (c *ClientWithResponses) AssignTemplateTagsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssignTemplateTagsResponse, error) { 6159 rsp, err := c.AssignTemplateTagsWithBody(ctx, contentType, body, reqEditors...) 6160 if err != nil { 6161 return nil, err 6162 } 6163 return ParseAssignTemplateTagsResponse(rsp) 6164 } 6165 6166 func (c *ClientWithResponses) AssignTemplateTagsWithResponse(ctx context.Context, body AssignTemplateTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*AssignTemplateTagsResponse, error) { 6167 rsp, err := c.AssignTemplateTags(ctx, body, reqEditors...) 6168 if err != nil { 6169 return nil, err 6170 } 6171 return ParseAssignTemplateTagsResponse(rsp) 6172 } 6173 6174 // DeleteTemplateWithResponse request returning *DeleteTemplateResponse 6175 func (c *ClientWithResponses) DeleteTemplateWithResponse(ctx context.Context, templateID TemplateID, reqEditors ...RequestEditorFn) (*DeleteTemplateResponse, error) { 6176 rsp, err := c.DeleteTemplate(ctx, templateID, reqEditors...) 6177 if err != nil { 6178 return nil, err 6179 } 6180 return ParseDeleteTemplateResponse(rsp) 6181 } 6182 6183 // GetTemplateWithResponse request returning *GetTemplateResponse 6184 func (c *ClientWithResponses) GetTemplateWithResponse(ctx context.Context, templateID TemplateID, params *GetTemplateParams, reqEditors ...RequestEditorFn) (*GetTemplateResponse, error) { 6185 rsp, err := c.GetTemplate(ctx, templateID, params, reqEditors...) 6186 if err != nil { 6187 return nil, err 6188 } 6189 return ParseGetTemplateResponse(rsp) 6190 } 6191 6192 // UpdateTemplateWithBodyWithResponse request with arbitrary body returning *UpdateTemplateResponse 6193 func (c *ClientWithResponses) UpdateTemplateWithBodyWithResponse(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTemplateResponse, error) { 6194 rsp, err := c.UpdateTemplateWithBody(ctx, templateID, contentType, body, reqEditors...) 6195 if err != nil { 6196 return nil, err 6197 } 6198 return ParseUpdateTemplateResponse(rsp) 6199 } 6200 6201 func (c *ClientWithResponses) UpdateTemplateWithResponse(ctx context.Context, templateID TemplateID, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTemplateResponse, error) { 6202 rsp, err := c.UpdateTemplate(ctx, templateID, body, reqEditors...) 6203 if err != nil { 6204 return nil, err 6205 } 6206 return ParseUpdateTemplateResponse(rsp) 6207 } 6208 6209 // RebuildTemplateWithBodyWithResponse request with arbitrary body returning *RebuildTemplateResponse 6210 func (c *ClientWithResponses) RebuildTemplateWithBodyWithResponse(ctx context.Context, templateID TemplateID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RebuildTemplateResponse, error) { 6211 rsp, err := c.RebuildTemplateWithBody(ctx, templateID, contentType, body, reqEditors...) 6212 if err != nil { 6213 return nil, err 6214 } 6215 return ParseRebuildTemplateResponse(rsp) 6216 } 6217 6218 func (c *ClientWithResponses) RebuildTemplateWithResponse(ctx context.Context, templateID TemplateID, body RebuildTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*RebuildTemplateResponse, error) { 6219 rsp, err := c.RebuildTemplate(ctx, templateID, body, reqEditors...) 6220 if err != nil { 6221 return nil, err 6222 } 6223 return ParseRebuildTemplateResponse(rsp) 6224 } 6225 6226 // StartTemplateBuildWithResponse request returning *StartTemplateBuildResponse 6227 func (c *ClientWithResponses) StartTemplateBuildWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, reqEditors ...RequestEditorFn) (*StartTemplateBuildResponse, error) { 6228 rsp, err := c.StartTemplateBuild(ctx, templateID, buildID, reqEditors...) 6229 if err != nil { 6230 return nil, err 6231 } 6232 return ParseStartTemplateBuildResponse(rsp) 6233 } 6234 6235 // GetTemplateBuildLogsWithResponse request returning *GetTemplateBuildLogsResponse 6236 func (c *ClientWithResponses) GetTemplateBuildLogsWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildLogsParams, reqEditors ...RequestEditorFn) (*GetTemplateBuildLogsResponse, error) { 6237 rsp, err := c.GetTemplateBuildLogs(ctx, templateID, buildID, params, reqEditors...) 6238 if err != nil { 6239 return nil, err 6240 } 6241 return ParseGetTemplateBuildLogsResponse(rsp) 6242 } 6243 6244 // GetTemplateBuildStatusWithResponse request returning *GetTemplateBuildStatusResponse 6245 func (c *ClientWithResponses) GetTemplateBuildStatusWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, params *GetTemplateBuildStatusParams, reqEditors ...RequestEditorFn) (*GetTemplateBuildStatusResponse, error) { 6246 rsp, err := c.GetTemplateBuildStatus(ctx, templateID, buildID, params, reqEditors...) 6247 if err != nil { 6248 return nil, err 6249 } 6250 return ParseGetTemplateBuildStatusResponse(rsp) 6251 } 6252 6253 // GetTemplateFilesWithResponse request returning *GetTemplateFilesResponse 6254 func (c *ClientWithResponses) GetTemplateFilesWithResponse(ctx context.Context, templateID TemplateID, hash string, reqEditors ...RequestEditorFn) (*GetTemplateFilesResponse, error) { 6255 rsp, err := c.GetTemplateFiles(ctx, templateID, hash, reqEditors...) 6256 if err != nil { 6257 return nil, err 6258 } 6259 return ParseGetTemplateFilesResponse(rsp) 6260 } 6261 6262 // ListSandboxesV2WithResponse request returning *ListSandboxesV2Response 6263 func (c *ClientWithResponses) ListSandboxesV2WithResponse(ctx context.Context, params *ListSandboxesV2Params, reqEditors ...RequestEditorFn) (*ListSandboxesV2Response, error) { 6264 rsp, err := c.ListSandboxesV2(ctx, params, reqEditors...) 6265 if err != nil { 6266 return nil, err 6267 } 6268 return ParseListSandboxesV2Response(rsp) 6269 } 6270 6271 // CreateTemplateV2WithBodyWithResponse request with arbitrary body returning *CreateTemplateV2Response 6272 func (c *ClientWithResponses) CreateTemplateV2WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTemplateV2Response, error) { 6273 rsp, err := c.CreateTemplateV2WithBody(ctx, contentType, body, reqEditors...) 6274 if err != nil { 6275 return nil, err 6276 } 6277 return ParseCreateTemplateV2Response(rsp) 6278 } 6279 6280 func (c *ClientWithResponses) CreateTemplateV2WithResponse(ctx context.Context, body CreateTemplateV2JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTemplateV2Response, error) { 6281 rsp, err := c.CreateTemplateV2(ctx, body, reqEditors...) 6282 if err != nil { 6283 return nil, err 6284 } 6285 return ParseCreateTemplateV2Response(rsp) 6286 } 6287 6288 // StartTemplateBuildV2WithBodyWithResponse request with arbitrary body returning *StartTemplateBuildV2Response 6289 func (c *ClientWithResponses) StartTemplateBuildV2WithBodyWithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartTemplateBuildV2Response, error) { 6290 rsp, err := c.StartTemplateBuildV2WithBody(ctx, templateID, buildID, contentType, body, reqEditors...) 6291 if err != nil { 6292 return nil, err 6293 } 6294 return ParseStartTemplateBuildV2Response(rsp) 6295 } 6296 6297 func (c *ClientWithResponses) StartTemplateBuildV2WithResponse(ctx context.Context, templateID TemplateID, buildID BuildID, body StartTemplateBuildV2JSONRequestBody, reqEditors ...RequestEditorFn) (*StartTemplateBuildV2Response, error) { 6298 rsp, err := c.StartTemplateBuildV2(ctx, templateID, buildID, body, reqEditors...) 6299 if err != nil { 6300 return nil, err 6301 } 6302 return ParseStartTemplateBuildV2Response(rsp) 6303 } 6304 6305 // CreateTemplateV3WithBodyWithResponse request with arbitrary body returning *CreateTemplateV3Response 6306 func (c *ClientWithResponses) CreateTemplateV3WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTemplateV3Response, error) { 6307 rsp, err := c.CreateTemplateV3WithBody(ctx, contentType, body, reqEditors...) 6308 if err != nil { 6309 return nil, err 6310 } 6311 return ParseCreateTemplateV3Response(rsp) 6312 } 6313 6314 func (c *ClientWithResponses) CreateTemplateV3WithResponse(ctx context.Context, body CreateTemplateV3JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTemplateV3Response, error) { 6315 rsp, err := c.CreateTemplateV3(ctx, body, reqEditors...) 6316 if err != nil { 6317 return nil, err 6318 } 6319 return ParseCreateTemplateV3Response(rsp) 6320 } 6321 6322 // ParseListDefaultTemplatesResponse parses an HTTP response from a ListDefaultTemplatesWithResponse call 6323 func ParseListDefaultTemplatesResponse(rsp *http.Response) (*ListDefaultTemplatesResponse, error) { 6324 bodyBytes, err := io.ReadAll(rsp.Body) 6325 defer func() { _ = rsp.Body.Close() }() 6326 if err != nil { 6327 return nil, err 6328 } 6329 6330 response := &ListDefaultTemplatesResponse{ 6331 Body: bodyBytes, 6332 HTTPResponse: rsp, 6333 } 6334 6335 switch { 6336 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6337 var dest []Template 6338 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6339 return nil, err 6340 } 6341 response.JSON200 = &dest 6342 6343 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6344 var dest N401 6345 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6346 return nil, err 6347 } 6348 response.JSON401 = &dest 6349 6350 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6351 var dest N500 6352 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6353 return nil, err 6354 } 6355 response.JSON500 = &dest 6356 6357 } 6358 6359 return response, nil 6360 } 6361 6362 // ParseGetInjectionRulesResponse parses an HTTP response from a GetInjectionRulesWithResponse call 6363 func ParseGetInjectionRulesResponse(rsp *http.Response) (*GetInjectionRulesResponse, error) { 6364 bodyBytes, err := io.ReadAll(rsp.Body) 6365 defer func() { _ = rsp.Body.Close() }() 6366 if err != nil { 6367 return nil, err 6368 } 6369 6370 response := &GetInjectionRulesResponse{ 6371 Body: bodyBytes, 6372 HTTPResponse: rsp, 6373 } 6374 6375 switch { 6376 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6377 var dest []InjectionRule 6378 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6379 return nil, err 6380 } 6381 response.JSON200 = &dest 6382 6383 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6384 var dest N400 6385 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6386 return nil, err 6387 } 6388 response.JSON400 = &dest 6389 6390 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6391 var dest N401 6392 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6393 return nil, err 6394 } 6395 response.JSON401 = &dest 6396 6397 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6398 var dest N500 6399 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6400 return nil, err 6401 } 6402 response.JSON500 = &dest 6403 6404 } 6405 6406 return response, nil 6407 } 6408 6409 // ParsePostInjectionRulesResponse parses an HTTP response from a PostInjectionRulesWithResponse call 6410 func ParsePostInjectionRulesResponse(rsp *http.Response) (*PostInjectionRulesResponse, error) { 6411 bodyBytes, err := io.ReadAll(rsp.Body) 6412 defer func() { _ = rsp.Body.Close() }() 6413 if err != nil { 6414 return nil, err 6415 } 6416 6417 response := &PostInjectionRulesResponse{ 6418 Body: bodyBytes, 6419 HTTPResponse: rsp, 6420 } 6421 6422 switch { 6423 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 6424 var dest InjectionRule 6425 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6426 return nil, err 6427 } 6428 response.JSON201 = &dest 6429 6430 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6431 var dest N400 6432 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6433 return nil, err 6434 } 6435 response.JSON400 = &dest 6436 6437 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6438 var dest N401 6439 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6440 return nil, err 6441 } 6442 response.JSON401 = &dest 6443 6444 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: 6445 var dest N409 6446 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6447 return nil, err 6448 } 6449 response.JSON409 = &dest 6450 6451 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6452 var dest N500 6453 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6454 return nil, err 6455 } 6456 response.JSON500 = &dest 6457 6458 } 6459 6460 return response, nil 6461 } 6462 6463 // ParseDeleteInjectionRulesRuleIDResponse parses an HTTP response from a DeleteInjectionRulesRuleIDWithResponse call 6464 func ParseDeleteInjectionRulesRuleIDResponse(rsp *http.Response) (*DeleteInjectionRulesRuleIDResponse, error) { 6465 bodyBytes, err := io.ReadAll(rsp.Body) 6466 defer func() { _ = rsp.Body.Close() }() 6467 if err != nil { 6468 return nil, err 6469 } 6470 6471 response := &DeleteInjectionRulesRuleIDResponse{ 6472 Body: bodyBytes, 6473 HTTPResponse: rsp, 6474 } 6475 6476 switch { 6477 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6478 var dest N401 6479 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6480 return nil, err 6481 } 6482 response.JSON401 = &dest 6483 6484 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6485 var dest N404 6486 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6487 return nil, err 6488 } 6489 response.JSON404 = &dest 6490 6491 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6492 var dest N500 6493 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6494 return nil, err 6495 } 6496 response.JSON500 = &dest 6497 6498 } 6499 6500 return response, nil 6501 } 6502 6503 // ParseGetInjectionRulesRuleIDResponse parses an HTTP response from a GetInjectionRulesRuleIDWithResponse call 6504 func ParseGetInjectionRulesRuleIDResponse(rsp *http.Response) (*GetInjectionRulesRuleIDResponse, error) { 6505 bodyBytes, err := io.ReadAll(rsp.Body) 6506 defer func() { _ = rsp.Body.Close() }() 6507 if err != nil { 6508 return nil, err 6509 } 6510 6511 response := &GetInjectionRulesRuleIDResponse{ 6512 Body: bodyBytes, 6513 HTTPResponse: rsp, 6514 } 6515 6516 switch { 6517 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6518 var dest InjectionRule 6519 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6520 return nil, err 6521 } 6522 response.JSON200 = &dest 6523 6524 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6525 var dest N401 6526 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6527 return nil, err 6528 } 6529 response.JSON401 = &dest 6530 6531 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6532 var dest N404 6533 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6534 return nil, err 6535 } 6536 response.JSON404 = &dest 6537 6538 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6539 var dest N500 6540 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6541 return nil, err 6542 } 6543 response.JSON500 = &dest 6544 6545 } 6546 6547 return response, nil 6548 } 6549 6550 // ParsePutInjectionRulesRuleIDResponse parses an HTTP response from a PutInjectionRulesRuleIDWithResponse call 6551 func ParsePutInjectionRulesRuleIDResponse(rsp *http.Response) (*PutInjectionRulesRuleIDResponse, error) { 6552 bodyBytes, err := io.ReadAll(rsp.Body) 6553 defer func() { _ = rsp.Body.Close() }() 6554 if err != nil { 6555 return nil, err 6556 } 6557 6558 response := &PutInjectionRulesRuleIDResponse{ 6559 Body: bodyBytes, 6560 HTTPResponse: rsp, 6561 } 6562 6563 switch { 6564 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6565 var dest InjectionRule 6566 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6567 return nil, err 6568 } 6569 response.JSON200 = &dest 6570 6571 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6572 var dest N400 6573 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6574 return nil, err 6575 } 6576 response.JSON400 = &dest 6577 6578 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6579 var dest N404 6580 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6581 return nil, err 6582 } 6583 response.JSON404 = &dest 6584 6585 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: 6586 var dest N409 6587 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6588 return nil, err 6589 } 6590 response.JSON409 = &dest 6591 6592 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6593 var dest N500 6594 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6595 return nil, err 6596 } 6597 response.JSON500 = &dest 6598 6599 } 6600 6601 return response, nil 6602 } 6603 6604 // ParseListSandboxesResponse parses an HTTP response from a ListSandboxesWithResponse call 6605 func ParseListSandboxesResponse(rsp *http.Response) (*ListSandboxesResponse, error) { 6606 bodyBytes, err := io.ReadAll(rsp.Body) 6607 defer func() { _ = rsp.Body.Close() }() 6608 if err != nil { 6609 return nil, err 6610 } 6611 6612 response := &ListSandboxesResponse{ 6613 Body: bodyBytes, 6614 HTTPResponse: rsp, 6615 } 6616 6617 switch { 6618 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6619 var dest []ListedSandbox 6620 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6621 return nil, err 6622 } 6623 response.JSON200 = &dest 6624 6625 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6626 var dest N400 6627 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6628 return nil, err 6629 } 6630 response.JSON400 = &dest 6631 6632 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6633 var dest N401 6634 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6635 return nil, err 6636 } 6637 response.JSON401 = &dest 6638 6639 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6640 var dest N500 6641 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6642 return nil, err 6643 } 6644 response.JSON500 = &dest 6645 6646 } 6647 6648 return response, nil 6649 } 6650 6651 // ParseCreateSandboxResponse parses an HTTP response from a CreateSandboxWithResponse call 6652 func ParseCreateSandboxResponse(rsp *http.Response) (*CreateSandboxResponse, error) { 6653 bodyBytes, err := io.ReadAll(rsp.Body) 6654 defer func() { _ = rsp.Body.Close() }() 6655 if err != nil { 6656 return nil, err 6657 } 6658 6659 response := &CreateSandboxResponse{ 6660 Body: bodyBytes, 6661 HTTPResponse: rsp, 6662 } 6663 6664 switch { 6665 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 6666 var dest Sandbox 6667 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6668 return nil, err 6669 } 6670 response.JSON201 = &dest 6671 6672 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6673 var dest N400 6674 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6675 return nil, err 6676 } 6677 response.JSON400 = &dest 6678 6679 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6680 var dest N401 6681 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6682 return nil, err 6683 } 6684 response.JSON401 = &dest 6685 6686 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 408: 6687 var dest Error 6688 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6689 return nil, err 6690 } 6691 response.JSON408 = &dest 6692 6693 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: 6694 var dest Error 6695 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6696 return nil, err 6697 } 6698 response.JSON409 = &dest 6699 6700 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6701 var dest N500 6702 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6703 return nil, err 6704 } 6705 response.JSON500 = &dest 6706 6707 } 6708 6709 return response, nil 6710 } 6711 6712 // ParseGetSandboxesMetricsResponse parses an HTTP response from a GetSandboxesMetricsWithResponse call 6713 func ParseGetSandboxesMetricsResponse(rsp *http.Response) (*GetSandboxesMetricsResponse, error) { 6714 bodyBytes, err := io.ReadAll(rsp.Body) 6715 defer func() { _ = rsp.Body.Close() }() 6716 if err != nil { 6717 return nil, err 6718 } 6719 6720 response := &GetSandboxesMetricsResponse{ 6721 Body: bodyBytes, 6722 HTTPResponse: rsp, 6723 } 6724 6725 switch { 6726 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6727 var dest SandboxesWithMetrics 6728 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6729 return nil, err 6730 } 6731 response.JSON200 = &dest 6732 6733 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6734 var dest N400 6735 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6736 return nil, err 6737 } 6738 response.JSON400 = &dest 6739 6740 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6741 var dest N401 6742 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6743 return nil, err 6744 } 6745 response.JSON401 = &dest 6746 6747 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6748 var dest N500 6749 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6750 return nil, err 6751 } 6752 response.JSON500 = &dest 6753 6754 } 6755 6756 return response, nil 6757 } 6758 6759 // ParseDeleteSandboxResponse parses an HTTP response from a DeleteSandboxWithResponse call 6760 func ParseDeleteSandboxResponse(rsp *http.Response) (*DeleteSandboxResponse, error) { 6761 bodyBytes, err := io.ReadAll(rsp.Body) 6762 defer func() { _ = rsp.Body.Close() }() 6763 if err != nil { 6764 return nil, err 6765 } 6766 6767 response := &DeleteSandboxResponse{ 6768 Body: bodyBytes, 6769 HTTPResponse: rsp, 6770 } 6771 6772 switch { 6773 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6774 var dest N401 6775 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6776 return nil, err 6777 } 6778 response.JSON401 = &dest 6779 6780 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6781 var dest N404 6782 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6783 return nil, err 6784 } 6785 response.JSON404 = &dest 6786 6787 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6788 var dest N500 6789 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6790 return nil, err 6791 } 6792 response.JSON500 = &dest 6793 6794 } 6795 6796 return response, nil 6797 } 6798 6799 // ParseGetSandboxResponse parses an HTTP response from a GetSandboxWithResponse call 6800 func ParseGetSandboxResponse(rsp *http.Response) (*GetSandboxResponse, error) { 6801 bodyBytes, err := io.ReadAll(rsp.Body) 6802 defer func() { _ = rsp.Body.Close() }() 6803 if err != nil { 6804 return nil, err 6805 } 6806 6807 response := &GetSandboxResponse{ 6808 Body: bodyBytes, 6809 HTTPResponse: rsp, 6810 } 6811 6812 switch { 6813 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6814 var dest SandboxDetail 6815 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6816 return nil, err 6817 } 6818 response.JSON200 = &dest 6819 6820 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6821 var dest N401 6822 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6823 return nil, err 6824 } 6825 response.JSON401 = &dest 6826 6827 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6828 var dest N404 6829 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6830 return nil, err 6831 } 6832 response.JSON404 = &dest 6833 6834 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6835 var dest N500 6836 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6837 return nil, err 6838 } 6839 response.JSON500 = &dest 6840 6841 } 6842 6843 return response, nil 6844 } 6845 6846 // ParseConnectSandboxResponse parses an HTTP response from a ConnectSandboxWithResponse call 6847 func ParseConnectSandboxResponse(rsp *http.Response) (*ConnectSandboxResponse, error) { 6848 bodyBytes, err := io.ReadAll(rsp.Body) 6849 defer func() { _ = rsp.Body.Close() }() 6850 if err != nil { 6851 return nil, err 6852 } 6853 6854 response := &ConnectSandboxResponse{ 6855 Body: bodyBytes, 6856 HTTPResponse: rsp, 6857 } 6858 6859 switch { 6860 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6861 var dest Sandbox 6862 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6863 return nil, err 6864 } 6865 response.JSON200 = &dest 6866 6867 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 6868 var dest Sandbox 6869 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6870 return nil, err 6871 } 6872 response.JSON201 = &dest 6873 6874 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6875 var dest N400 6876 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6877 return nil, err 6878 } 6879 response.JSON400 = &dest 6880 6881 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6882 var dest N401 6883 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6884 return nil, err 6885 } 6886 response.JSON401 = &dest 6887 6888 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6889 var dest N404 6890 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6891 return nil, err 6892 } 6893 response.JSON404 = &dest 6894 6895 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6896 var dest N500 6897 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6898 return nil, err 6899 } 6900 response.JSON500 = &dest 6901 6902 } 6903 6904 return response, nil 6905 } 6906 6907 // ParseUpdateSandboxGithubTokenResponse parses an HTTP response from a UpdateSandboxGithubTokenWithResponse call 6908 func ParseUpdateSandboxGithubTokenResponse(rsp *http.Response) (*UpdateSandboxGithubTokenResponse, error) { 6909 bodyBytes, err := io.ReadAll(rsp.Body) 6910 defer func() { _ = rsp.Body.Close() }() 6911 if err != nil { 6912 return nil, err 6913 } 6914 6915 response := &UpdateSandboxGithubTokenResponse{ 6916 Body: bodyBytes, 6917 HTTPResponse: rsp, 6918 } 6919 6920 switch { 6921 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 6922 var dest N400 6923 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6924 return nil, err 6925 } 6926 response.JSON400 = &dest 6927 6928 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6929 var dest N401 6930 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6931 return nil, err 6932 } 6933 response.JSON401 = &dest 6934 6935 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6936 var dest N404 6937 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6938 return nil, err 6939 } 6940 response.JSON404 = &dest 6941 6942 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6943 var dest N500 6944 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6945 return nil, err 6946 } 6947 response.JSON500 = &dest 6948 6949 } 6950 6951 return response, nil 6952 } 6953 6954 // ParseGetSandboxInjectionsResponse parses an HTTP response from a GetSandboxInjectionsWithResponse call 6955 func ParseGetSandboxInjectionsResponse(rsp *http.Response) (*GetSandboxInjectionsResponse, error) { 6956 bodyBytes, err := io.ReadAll(rsp.Body) 6957 defer func() { _ = rsp.Body.Close() }() 6958 if err != nil { 6959 return nil, err 6960 } 6961 6962 response := &GetSandboxInjectionsResponse{ 6963 Body: bodyBytes, 6964 HTTPResponse: rsp, 6965 } 6966 6967 switch { 6968 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 6969 var dest struct { 6970 Injections []SandboxInjection `json:"injections"` 6971 } 6972 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6973 return nil, err 6974 } 6975 response.JSON200 = &dest 6976 6977 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 6978 var dest N401 6979 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6980 return nil, err 6981 } 6982 response.JSON401 = &dest 6983 6984 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 6985 var dest N404 6986 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6987 return nil, err 6988 } 6989 response.JSON404 = &dest 6990 6991 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 6992 var dest N500 6993 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 6994 return nil, err 6995 } 6996 response.JSON500 = &dest 6997 6998 } 6999 7000 return response, nil 7001 } 7002 7003 // ParseUpdateSandboxInjectionsResponse parses an HTTP response from a UpdateSandboxInjectionsWithResponse call 7004 func ParseUpdateSandboxInjectionsResponse(rsp *http.Response) (*UpdateSandboxInjectionsResponse, error) { 7005 bodyBytes, err := io.ReadAll(rsp.Body) 7006 defer func() { _ = rsp.Body.Close() }() 7007 if err != nil { 7008 return nil, err 7009 } 7010 7011 response := &UpdateSandboxInjectionsResponse{ 7012 Body: bodyBytes, 7013 HTTPResponse: rsp, 7014 } 7015 7016 switch { 7017 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7018 var dest N400 7019 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7020 return nil, err 7021 } 7022 response.JSON400 = &dest 7023 7024 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7025 var dest N401 7026 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7027 return nil, err 7028 } 7029 response.JSON401 = &dest 7030 7031 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7032 var dest N404 7033 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7034 return nil, err 7035 } 7036 response.JSON404 = &dest 7037 7038 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7039 var dest N500 7040 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7041 return nil, err 7042 } 7043 response.JSON500 = &dest 7044 7045 } 7046 7047 return response, nil 7048 } 7049 7050 // ParseGetSandboxLogsResponse parses an HTTP response from a GetSandboxLogsWithResponse call 7051 func ParseGetSandboxLogsResponse(rsp *http.Response) (*GetSandboxLogsResponse, error) { 7052 bodyBytes, err := io.ReadAll(rsp.Body) 7053 defer func() { _ = rsp.Body.Close() }() 7054 if err != nil { 7055 return nil, err 7056 } 7057 7058 response := &GetSandboxLogsResponse{ 7059 Body: bodyBytes, 7060 HTTPResponse: rsp, 7061 } 7062 7063 switch { 7064 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7065 var dest SandboxLogs 7066 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7067 return nil, err 7068 } 7069 response.JSON200 = &dest 7070 7071 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7072 var dest N401 7073 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7074 return nil, err 7075 } 7076 response.JSON401 = &dest 7077 7078 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7079 var dest N404 7080 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7081 return nil, err 7082 } 7083 response.JSON404 = &dest 7084 7085 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7086 var dest N500 7087 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7088 return nil, err 7089 } 7090 response.JSON500 = &dest 7091 7092 } 7093 7094 return response, nil 7095 } 7096 7097 // ParseGetSandboxMetricsResponse parses an HTTP response from a GetSandboxMetricsWithResponse call 7098 func ParseGetSandboxMetricsResponse(rsp *http.Response) (*GetSandboxMetricsResponse, error) { 7099 bodyBytes, err := io.ReadAll(rsp.Body) 7100 defer func() { _ = rsp.Body.Close() }() 7101 if err != nil { 7102 return nil, err 7103 } 7104 7105 response := &GetSandboxMetricsResponse{ 7106 Body: bodyBytes, 7107 HTTPResponse: rsp, 7108 } 7109 7110 switch { 7111 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7112 var dest []SandboxMetric 7113 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7114 return nil, err 7115 } 7116 response.JSON200 = &dest 7117 7118 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7119 var dest N400 7120 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7121 return nil, err 7122 } 7123 response.JSON400 = &dest 7124 7125 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7126 var dest N401 7127 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7128 return nil, err 7129 } 7130 response.JSON401 = &dest 7131 7132 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7133 var dest N404 7134 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7135 return nil, err 7136 } 7137 response.JSON404 = &dest 7138 7139 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7140 var dest N500 7141 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7142 return nil, err 7143 } 7144 response.JSON500 = &dest 7145 7146 } 7147 7148 return response, nil 7149 } 7150 7151 // ParsePauseSandboxResponse parses an HTTP response from a PauseSandboxWithResponse call 7152 func ParsePauseSandboxResponse(rsp *http.Response) (*PauseSandboxResponse, error) { 7153 bodyBytes, err := io.ReadAll(rsp.Body) 7154 defer func() { _ = rsp.Body.Close() }() 7155 if err != nil { 7156 return nil, err 7157 } 7158 7159 response := &PauseSandboxResponse{ 7160 Body: bodyBytes, 7161 HTTPResponse: rsp, 7162 } 7163 7164 switch { 7165 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7166 var dest N401 7167 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7168 return nil, err 7169 } 7170 response.JSON401 = &dest 7171 7172 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7173 var dest N404 7174 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7175 return nil, err 7176 } 7177 response.JSON404 = &dest 7178 7179 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: 7180 var dest N409 7181 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7182 return nil, err 7183 } 7184 response.JSON409 = &dest 7185 7186 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7187 var dest N500 7188 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7189 return nil, err 7190 } 7191 response.JSON500 = &dest 7192 7193 } 7194 7195 return response, nil 7196 } 7197 7198 // ParseRefreshSandboxResponse parses an HTTP response from a RefreshSandboxWithResponse call 7199 func ParseRefreshSandboxResponse(rsp *http.Response) (*RefreshSandboxResponse, error) { 7200 bodyBytes, err := io.ReadAll(rsp.Body) 7201 defer func() { _ = rsp.Body.Close() }() 7202 if err != nil { 7203 return nil, err 7204 } 7205 7206 response := &RefreshSandboxResponse{ 7207 Body: bodyBytes, 7208 HTTPResponse: rsp, 7209 } 7210 7211 switch { 7212 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7213 var dest N401 7214 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7215 return nil, err 7216 } 7217 response.JSON401 = &dest 7218 7219 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7220 var dest N404 7221 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7222 return nil, err 7223 } 7224 response.JSON404 = &dest 7225 7226 } 7227 7228 return response, nil 7229 } 7230 7231 // ParseResumeSandboxResponse parses an HTTP response from a ResumeSandboxWithResponse call 7232 func ParseResumeSandboxResponse(rsp *http.Response) (*ResumeSandboxResponse, error) { 7233 bodyBytes, err := io.ReadAll(rsp.Body) 7234 defer func() { _ = rsp.Body.Close() }() 7235 if err != nil { 7236 return nil, err 7237 } 7238 7239 response := &ResumeSandboxResponse{ 7240 Body: bodyBytes, 7241 HTTPResponse: rsp, 7242 } 7243 7244 switch { 7245 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 7246 var dest Sandbox 7247 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7248 return nil, err 7249 } 7250 response.JSON201 = &dest 7251 7252 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7253 var dest N401 7254 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7255 return nil, err 7256 } 7257 response.JSON401 = &dest 7258 7259 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7260 var dest N404 7261 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7262 return nil, err 7263 } 7264 response.JSON404 = &dest 7265 7266 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: 7267 var dest N409 7268 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7269 return nil, err 7270 } 7271 response.JSON409 = &dest 7272 7273 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7274 var dest N500 7275 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7276 return nil, err 7277 } 7278 response.JSON500 = &dest 7279 7280 } 7281 7282 return response, nil 7283 } 7284 7285 // ParseUpdateSandboxTimeoutResponse parses an HTTP response from a UpdateSandboxTimeoutWithResponse call 7286 func ParseUpdateSandboxTimeoutResponse(rsp *http.Response) (*UpdateSandboxTimeoutResponse, error) { 7287 bodyBytes, err := io.ReadAll(rsp.Body) 7288 defer func() { _ = rsp.Body.Close() }() 7289 if err != nil { 7290 return nil, err 7291 } 7292 7293 response := &UpdateSandboxTimeoutResponse{ 7294 Body: bodyBytes, 7295 HTTPResponse: rsp, 7296 } 7297 7298 switch { 7299 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7300 var dest N401 7301 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7302 return nil, err 7303 } 7304 response.JSON401 = &dest 7305 7306 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7307 var dest N404 7308 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7309 return nil, err 7310 } 7311 response.JSON404 = &dest 7312 7313 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7314 var dest N500 7315 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7316 return nil, err 7317 } 7318 response.JSON500 = &dest 7319 7320 } 7321 7322 return response, nil 7323 } 7324 7325 // ParseListTemplatesResponse parses an HTTP response from a ListTemplatesWithResponse call 7326 func ParseListTemplatesResponse(rsp *http.Response) (*ListTemplatesResponse, error) { 7327 bodyBytes, err := io.ReadAll(rsp.Body) 7328 defer func() { _ = rsp.Body.Close() }() 7329 if err != nil { 7330 return nil, err 7331 } 7332 7333 response := &ListTemplatesResponse{ 7334 Body: bodyBytes, 7335 HTTPResponse: rsp, 7336 } 7337 7338 switch { 7339 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7340 var dest []Template 7341 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7342 return nil, err 7343 } 7344 response.JSON200 = &dest 7345 7346 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7347 var dest N401 7348 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7349 return nil, err 7350 } 7351 response.JSON401 = &dest 7352 7353 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7354 var dest N500 7355 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7356 return nil, err 7357 } 7358 response.JSON500 = &dest 7359 7360 } 7361 7362 return response, nil 7363 } 7364 7365 // ParseCreateTemplateResponse parses an HTTP response from a CreateTemplateWithResponse call 7366 func ParseCreateTemplateResponse(rsp *http.Response) (*CreateTemplateResponse, error) { 7367 bodyBytes, err := io.ReadAll(rsp.Body) 7368 defer func() { _ = rsp.Body.Close() }() 7369 if err != nil { 7370 return nil, err 7371 } 7372 7373 response := &CreateTemplateResponse{ 7374 Body: bodyBytes, 7375 HTTPResponse: rsp, 7376 } 7377 7378 switch { 7379 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: 7380 var dest TemplateLegacy 7381 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7382 return nil, err 7383 } 7384 response.JSON202 = &dest 7385 7386 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7387 var dest N400 7388 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7389 return nil, err 7390 } 7391 response.JSON400 = &dest 7392 7393 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7394 var dest N401 7395 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7396 return nil, err 7397 } 7398 response.JSON401 = &dest 7399 7400 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7401 var dest N500 7402 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7403 return nil, err 7404 } 7405 response.JSON500 = &dest 7406 7407 } 7408 7409 return response, nil 7410 } 7411 7412 // ParseGetTemplateByAliasResponse parses an HTTP response from a GetTemplateByAliasWithResponse call 7413 func ParseGetTemplateByAliasResponse(rsp *http.Response) (*GetTemplateByAliasResponse, error) { 7414 bodyBytes, err := io.ReadAll(rsp.Body) 7415 defer func() { _ = rsp.Body.Close() }() 7416 if err != nil { 7417 return nil, err 7418 } 7419 7420 response := &GetTemplateByAliasResponse{ 7421 Body: bodyBytes, 7422 HTTPResponse: rsp, 7423 } 7424 7425 switch { 7426 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7427 var dest TemplateAliasResponse 7428 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7429 return nil, err 7430 } 7431 response.JSON200 = &dest 7432 7433 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7434 var dest N400 7435 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7436 return nil, err 7437 } 7438 response.JSON400 = &dest 7439 7440 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: 7441 var dest N403 7442 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7443 return nil, err 7444 } 7445 response.JSON403 = &dest 7446 7447 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7448 var dest N404 7449 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7450 return nil, err 7451 } 7452 response.JSON404 = &dest 7453 7454 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7455 var dest N500 7456 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7457 return nil, err 7458 } 7459 response.JSON500 = &dest 7460 7461 } 7462 7463 return response, nil 7464 } 7465 7466 // ParseDeleteTemplateTagsResponse parses an HTTP response from a DeleteTemplateTagsWithResponse call 7467 func ParseDeleteTemplateTagsResponse(rsp *http.Response) (*DeleteTemplateTagsResponse, error) { 7468 bodyBytes, err := io.ReadAll(rsp.Body) 7469 defer func() { _ = rsp.Body.Close() }() 7470 if err != nil { 7471 return nil, err 7472 } 7473 7474 response := &DeleteTemplateTagsResponse{ 7475 Body: bodyBytes, 7476 HTTPResponse: rsp, 7477 } 7478 7479 switch { 7480 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7481 var dest N400 7482 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7483 return nil, err 7484 } 7485 response.JSON400 = &dest 7486 7487 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7488 var dest N401 7489 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7490 return nil, err 7491 } 7492 response.JSON401 = &dest 7493 7494 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7495 var dest N404 7496 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7497 return nil, err 7498 } 7499 response.JSON404 = &dest 7500 7501 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7502 var dest N500 7503 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7504 return nil, err 7505 } 7506 response.JSON500 = &dest 7507 7508 } 7509 7510 return response, nil 7511 } 7512 7513 // ParseAssignTemplateTagsResponse parses an HTTP response from a AssignTemplateTagsWithResponse call 7514 func ParseAssignTemplateTagsResponse(rsp *http.Response) (*AssignTemplateTagsResponse, error) { 7515 bodyBytes, err := io.ReadAll(rsp.Body) 7516 defer func() { _ = rsp.Body.Close() }() 7517 if err != nil { 7518 return nil, err 7519 } 7520 7521 response := &AssignTemplateTagsResponse{ 7522 Body: bodyBytes, 7523 HTTPResponse: rsp, 7524 } 7525 7526 switch { 7527 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 7528 var dest AssignedTemplateTags 7529 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7530 return nil, err 7531 } 7532 response.JSON201 = &dest 7533 7534 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7535 var dest N400 7536 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7537 return nil, err 7538 } 7539 response.JSON400 = &dest 7540 7541 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7542 var dest N401 7543 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7544 return nil, err 7545 } 7546 response.JSON401 = &dest 7547 7548 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7549 var dest N404 7550 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7551 return nil, err 7552 } 7553 response.JSON404 = &dest 7554 7555 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7556 var dest N500 7557 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7558 return nil, err 7559 } 7560 response.JSON500 = &dest 7561 7562 } 7563 7564 return response, nil 7565 } 7566 7567 // ParseDeleteTemplateResponse parses an HTTP response from a DeleteTemplateWithResponse call 7568 func ParseDeleteTemplateResponse(rsp *http.Response) (*DeleteTemplateResponse, error) { 7569 bodyBytes, err := io.ReadAll(rsp.Body) 7570 defer func() { _ = rsp.Body.Close() }() 7571 if err != nil { 7572 return nil, err 7573 } 7574 7575 response := &DeleteTemplateResponse{ 7576 Body: bodyBytes, 7577 HTTPResponse: rsp, 7578 } 7579 7580 switch { 7581 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7582 var dest N401 7583 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7584 return nil, err 7585 } 7586 response.JSON401 = &dest 7587 7588 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7589 var dest N500 7590 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7591 return nil, err 7592 } 7593 response.JSON500 = &dest 7594 7595 } 7596 7597 return response, nil 7598 } 7599 7600 // ParseGetTemplateResponse parses an HTTP response from a GetTemplateWithResponse call 7601 func ParseGetTemplateResponse(rsp *http.Response) (*GetTemplateResponse, error) { 7602 bodyBytes, err := io.ReadAll(rsp.Body) 7603 defer func() { _ = rsp.Body.Close() }() 7604 if err != nil { 7605 return nil, err 7606 } 7607 7608 response := &GetTemplateResponse{ 7609 Body: bodyBytes, 7610 HTTPResponse: rsp, 7611 } 7612 7613 switch { 7614 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7615 var dest TemplateWithBuilds 7616 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7617 return nil, err 7618 } 7619 response.JSON200 = &dest 7620 7621 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7622 var dest N401 7623 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7624 return nil, err 7625 } 7626 response.JSON401 = &dest 7627 7628 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7629 var dest N500 7630 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7631 return nil, err 7632 } 7633 response.JSON500 = &dest 7634 7635 } 7636 7637 return response, nil 7638 } 7639 7640 // ParseUpdateTemplateResponse parses an HTTP response from a UpdateTemplateWithResponse call 7641 func ParseUpdateTemplateResponse(rsp *http.Response) (*UpdateTemplateResponse, error) { 7642 bodyBytes, err := io.ReadAll(rsp.Body) 7643 defer func() { _ = rsp.Body.Close() }() 7644 if err != nil { 7645 return nil, err 7646 } 7647 7648 response := &UpdateTemplateResponse{ 7649 Body: bodyBytes, 7650 HTTPResponse: rsp, 7651 } 7652 7653 switch { 7654 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7655 var dest N400 7656 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7657 return nil, err 7658 } 7659 response.JSON400 = &dest 7660 7661 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7662 var dest N401 7663 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7664 return nil, err 7665 } 7666 response.JSON401 = &dest 7667 7668 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7669 var dest N500 7670 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7671 return nil, err 7672 } 7673 response.JSON500 = &dest 7674 7675 } 7676 7677 return response, nil 7678 } 7679 7680 // ParseRebuildTemplateResponse parses an HTTP response from a RebuildTemplateWithResponse call 7681 func ParseRebuildTemplateResponse(rsp *http.Response) (*RebuildTemplateResponse, error) { 7682 bodyBytes, err := io.ReadAll(rsp.Body) 7683 defer func() { _ = rsp.Body.Close() }() 7684 if err != nil { 7685 return nil, err 7686 } 7687 7688 response := &RebuildTemplateResponse{ 7689 Body: bodyBytes, 7690 HTTPResponse: rsp, 7691 } 7692 7693 switch { 7694 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: 7695 var dest TemplateLegacy 7696 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7697 return nil, err 7698 } 7699 response.JSON202 = &dest 7700 7701 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7702 var dest N401 7703 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7704 return nil, err 7705 } 7706 response.JSON401 = &dest 7707 7708 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7709 var dest N500 7710 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7711 return nil, err 7712 } 7713 response.JSON500 = &dest 7714 7715 } 7716 7717 return response, nil 7718 } 7719 7720 // ParseStartTemplateBuildResponse parses an HTTP response from a StartTemplateBuildWithResponse call 7721 func ParseStartTemplateBuildResponse(rsp *http.Response) (*StartTemplateBuildResponse, error) { 7722 bodyBytes, err := io.ReadAll(rsp.Body) 7723 defer func() { _ = rsp.Body.Close() }() 7724 if err != nil { 7725 return nil, err 7726 } 7727 7728 response := &StartTemplateBuildResponse{ 7729 Body: bodyBytes, 7730 HTTPResponse: rsp, 7731 } 7732 7733 switch { 7734 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7735 var dest N401 7736 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7737 return nil, err 7738 } 7739 response.JSON401 = &dest 7740 7741 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7742 var dest N500 7743 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7744 return nil, err 7745 } 7746 response.JSON500 = &dest 7747 7748 } 7749 7750 return response, nil 7751 } 7752 7753 // ParseGetTemplateBuildLogsResponse parses an HTTP response from a GetTemplateBuildLogsWithResponse call 7754 func ParseGetTemplateBuildLogsResponse(rsp *http.Response) (*GetTemplateBuildLogsResponse, error) { 7755 bodyBytes, err := io.ReadAll(rsp.Body) 7756 defer func() { _ = rsp.Body.Close() }() 7757 if err != nil { 7758 return nil, err 7759 } 7760 7761 response := &GetTemplateBuildLogsResponse{ 7762 Body: bodyBytes, 7763 HTTPResponse: rsp, 7764 } 7765 7766 switch { 7767 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7768 var dest TemplateBuildLogsResponse 7769 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7770 return nil, err 7771 } 7772 response.JSON200 = &dest 7773 7774 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7775 var dest N401 7776 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7777 return nil, err 7778 } 7779 response.JSON401 = &dest 7780 7781 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7782 var dest N404 7783 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7784 return nil, err 7785 } 7786 response.JSON404 = &dest 7787 7788 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7789 var dest N500 7790 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7791 return nil, err 7792 } 7793 response.JSON500 = &dest 7794 7795 } 7796 7797 return response, nil 7798 } 7799 7800 // ParseGetTemplateBuildStatusResponse parses an HTTP response from a GetTemplateBuildStatusWithResponse call 7801 func ParseGetTemplateBuildStatusResponse(rsp *http.Response) (*GetTemplateBuildStatusResponse, error) { 7802 bodyBytes, err := io.ReadAll(rsp.Body) 7803 defer func() { _ = rsp.Body.Close() }() 7804 if err != nil { 7805 return nil, err 7806 } 7807 7808 response := &GetTemplateBuildStatusResponse{ 7809 Body: bodyBytes, 7810 HTTPResponse: rsp, 7811 } 7812 7813 switch { 7814 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7815 var dest TemplateBuildInfo 7816 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7817 return nil, err 7818 } 7819 response.JSON200 = &dest 7820 7821 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7822 var dest N401 7823 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7824 return nil, err 7825 } 7826 response.JSON401 = &dest 7827 7828 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7829 var dest N404 7830 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7831 return nil, err 7832 } 7833 response.JSON404 = &dest 7834 7835 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7836 var dest N500 7837 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7838 return nil, err 7839 } 7840 response.JSON500 = &dest 7841 7842 } 7843 7844 return response, nil 7845 } 7846 7847 // ParseGetTemplateFilesResponse parses an HTTP response from a GetTemplateFilesWithResponse call 7848 func ParseGetTemplateFilesResponse(rsp *http.Response) (*GetTemplateFilesResponse, error) { 7849 bodyBytes, err := io.ReadAll(rsp.Body) 7850 defer func() { _ = rsp.Body.Close() }() 7851 if err != nil { 7852 return nil, err 7853 } 7854 7855 response := &GetTemplateFilesResponse{ 7856 Body: bodyBytes, 7857 HTTPResponse: rsp, 7858 } 7859 7860 switch { 7861 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: 7862 var dest TemplateBuildFileUpload 7863 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7864 return nil, err 7865 } 7866 response.JSON201 = &dest 7867 7868 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7869 var dest N400 7870 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7871 return nil, err 7872 } 7873 response.JSON400 = &dest 7874 7875 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7876 var dest N401 7877 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7878 return nil, err 7879 } 7880 response.JSON401 = &dest 7881 7882 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: 7883 var dest N404 7884 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7885 return nil, err 7886 } 7887 response.JSON404 = &dest 7888 7889 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7890 var dest N500 7891 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7892 return nil, err 7893 } 7894 response.JSON500 = &dest 7895 7896 } 7897 7898 return response, nil 7899 } 7900 7901 // ParseListSandboxesV2Response parses an HTTP response from a ListSandboxesV2WithResponse call 7902 func ParseListSandboxesV2Response(rsp *http.Response) (*ListSandboxesV2Response, error) { 7903 bodyBytes, err := io.ReadAll(rsp.Body) 7904 defer func() { _ = rsp.Body.Close() }() 7905 if err != nil { 7906 return nil, err 7907 } 7908 7909 response := &ListSandboxesV2Response{ 7910 Body: bodyBytes, 7911 HTTPResponse: rsp, 7912 } 7913 7914 switch { 7915 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: 7916 var dest []ListedSandbox 7917 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7918 return nil, err 7919 } 7920 response.JSON200 = &dest 7921 7922 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7923 var dest N400 7924 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7925 return nil, err 7926 } 7927 response.JSON400 = &dest 7928 7929 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7930 var dest N401 7931 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7932 return nil, err 7933 } 7934 response.JSON401 = &dest 7935 7936 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7937 var dest N500 7938 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7939 return nil, err 7940 } 7941 response.JSON500 = &dest 7942 7943 } 7944 7945 return response, nil 7946 } 7947 7948 // ParseCreateTemplateV2Response parses an HTTP response from a CreateTemplateV2WithResponse call 7949 func ParseCreateTemplateV2Response(rsp *http.Response) (*CreateTemplateV2Response, error) { 7950 bodyBytes, err := io.ReadAll(rsp.Body) 7951 defer func() { _ = rsp.Body.Close() }() 7952 if err != nil { 7953 return nil, err 7954 } 7955 7956 response := &CreateTemplateV2Response{ 7957 Body: bodyBytes, 7958 HTTPResponse: rsp, 7959 } 7960 7961 switch { 7962 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: 7963 var dest TemplateLegacy 7964 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7965 return nil, err 7966 } 7967 response.JSON202 = &dest 7968 7969 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 7970 var dest N400 7971 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7972 return nil, err 7973 } 7974 response.JSON400 = &dest 7975 7976 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 7977 var dest N401 7978 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7979 return nil, err 7980 } 7981 response.JSON401 = &dest 7982 7983 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 7984 var dest N500 7985 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 7986 return nil, err 7987 } 7988 response.JSON500 = &dest 7989 7990 } 7991 7992 return response, nil 7993 } 7994 7995 // ParseStartTemplateBuildV2Response parses an HTTP response from a StartTemplateBuildV2WithResponse call 7996 func ParseStartTemplateBuildV2Response(rsp *http.Response) (*StartTemplateBuildV2Response, error) { 7997 bodyBytes, err := io.ReadAll(rsp.Body) 7998 defer func() { _ = rsp.Body.Close() }() 7999 if err != nil { 8000 return nil, err 8001 } 8002 8003 response := &StartTemplateBuildV2Response{ 8004 Body: bodyBytes, 8005 HTTPResponse: rsp, 8006 } 8007 8008 switch { 8009 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 8010 var dest N401 8011 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 8012 return nil, err 8013 } 8014 response.JSON401 = &dest 8015 8016 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 8017 var dest N500 8018 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 8019 return nil, err 8020 } 8021 response.JSON500 = &dest 8022 8023 } 8024 8025 return response, nil 8026 } 8027 8028 // ParseCreateTemplateV3Response parses an HTTP response from a CreateTemplateV3WithResponse call 8029 func ParseCreateTemplateV3Response(rsp *http.Response) (*CreateTemplateV3Response, error) { 8030 bodyBytes, err := io.ReadAll(rsp.Body) 8031 defer func() { _ = rsp.Body.Close() }() 8032 if err != nil { 8033 return nil, err 8034 } 8035 8036 response := &CreateTemplateV3Response{ 8037 Body: bodyBytes, 8038 HTTPResponse: rsp, 8039 } 8040 8041 switch { 8042 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: 8043 var dest TemplateRequestResponseV3 8044 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 8045 return nil, err 8046 } 8047 response.JSON202 = &dest 8048 8049 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: 8050 var dest N400 8051 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 8052 return nil, err 8053 } 8054 response.JSON400 = &dest 8055 8056 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: 8057 var dest N401 8058 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 8059 return nil, err 8060 } 8061 response.JSON401 = &dest 8062 8063 case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: 8064 var dest N500 8065 if err := json.Unmarshal(bodyBytes, &dest); err != nil { 8066 return nil, err 8067 } 8068 response.JSON500 = &dest 8069 8070 } 8071 8072 return response, nil 8073 }