-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit ffc670cf of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Feb 14, 2024
1 parent
385f52d
commit f26a195
Showing
19 changed files
with
457 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Update a GCP integration cloud run revision filters returns "OK" response | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" | ||
) | ||
|
||
func main() { | ||
body := datadogV1.GCPAccount{ | ||
AuthProviderX509CertUrl: datadog.PtrString("https://www.googleapis.com/oauth2/v1/certs"), | ||
AuthUri: datadog.PtrString("https://accounts.google.com/o/oauth2/auth"), | ||
ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), | ||
ClientId: datadog.PtrString("163662907116366290710"), | ||
ClientX509CertUrl: datadog.PtrString("https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL"), | ||
HostFilters: datadog.PtrString("key:value,filter:example"), | ||
CloudRunRevisionFilters: []string{ | ||
"merp:derp", | ||
}, | ||
IsCspmEnabled: datadog.PtrBool(true), | ||
IsSecurityCommandCenterEnabled: datadog.PtrBool(true), | ||
PrivateKey: datadog.PtrString("private_key"), | ||
PrivateKeyId: datadog.PtrString("123456789abcdefghi123456789abcdefghijklm"), | ||
ProjectId: datadog.PtrString("datadog-apitest"), | ||
ResourceCollectionEnabled: datadog.PtrBool(true), | ||
TokenUri: datadog.PtrString("https://accounts.google.com/o/oauth2/token"), | ||
Type: datadog.PtrString("service_account"), | ||
} | ||
ctx := datadog.NewDefaultContext(context.Background()) | ||
configuration := datadog.NewConfiguration() | ||
apiClient := datadog.NewAPIClient(configuration) | ||
api := datadogV1.NewGCPIntegrationApi(apiClient) | ||
resp, r, err := api.UpdateGCPIntegration(ctx, body) | ||
|
||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPIntegration`: %v\n", err) | ||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) | ||
} | ||
|
||
responseContent, _ := json.MarshalIndent(resp, "", " ") | ||
fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPIntegration`:\n%s\n", responseContent) | ||
} |
41 changes: 41 additions & 0 deletions
41
examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Create a new entry for your service account with cloud run revision filters enabled returns "OK" response | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" | ||
) | ||
|
||
func main() { | ||
body := datadogV2.GCPSTSServiceAccountCreateRequest{ | ||
Data: &datadogV2.GCPSTSServiceAccountData{ | ||
Attributes: &datadogV2.GCPSTSServiceAccountAttributes{ | ||
CloudRunRevisionFilters: []string{ | ||
"meh:bleh", | ||
}, | ||
ClientEmail: datadog.PtrString("252bf553ef04b351@test-project.iam.gserviceaccount.com"), | ||
HostFilters: []string{}, | ||
}, | ||
Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(), | ||
}, | ||
} | ||
ctx := datadog.NewDefaultContext(context.Background()) | ||
configuration := datadog.NewConfiguration() | ||
apiClient := datadog.NewAPIClient(configuration) | ||
api := datadogV2.NewGCPIntegrationApi(apiClient) | ||
resp, r, err := api.CreateGCPSTSAccount(ctx, body) | ||
|
||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n", err) | ||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) | ||
} | ||
|
||
responseContent, _ := json.MarshalIndent(resp, "", " ") | ||
fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n", responseContent) | ||
} |
44 changes: 44 additions & 0 deletions
44
examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Update STS Service Account returns "OK" response with cloud run revision filters | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" | ||
) | ||
|
||
func main() { | ||
// there is a valid "gcp_sts_account" in the system | ||
GcpStsAccountDataID := os.Getenv("GCP_STS_ACCOUNT_DATA_ID") | ||
|
||
body := datadogV2.GCPSTSServiceAccountUpdateRequest{ | ||
Data: &datadogV2.GCPSTSServiceAccountUpdateRequestData{ | ||
Attributes: &datadogV2.GCPSTSServiceAccountAttributes{ | ||
ClientEmail: datadog.PtrString("252bf553ef04b351@example.com"), | ||
CloudRunRevisionFilters: []string{ | ||
"merp:derp", | ||
}, | ||
}, | ||
Id: datadog.PtrString(GcpStsAccountDataID), | ||
Type: datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(), | ||
}, | ||
} | ||
ctx := datadog.NewDefaultContext(context.Background()) | ||
configuration := datadog.NewConfiguration() | ||
apiClient := datadog.NewAPIClient(configuration) | ||
api := datadogV2.NewGCPIntegrationApi(apiClient) | ||
resp, r, err := api.UpdateGCPSTSAccount(ctx, GcpStsAccountDataID, body) | ||
|
||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n", err) | ||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) | ||
} | ||
|
||
responseContent, _ := json.MarshalIndent(resp, "", " ") | ||
fmt.Fprintf(os.Stdout, "Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n", responseContent) | ||
} |
2 changes: 1 addition & 1 deletion
2
...s/v1/Feature_GCP_Integration/Scenario_Create_a_GCP_integration_returns_OK_response.freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2023-12-20T13:18:07.717Z | ||
2024-01-31T21:16:03.254Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...n/Scenario_Update_a_GCP_integration_cloud_run_revision_filters_returns_OK_response.freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2024-01-31T21:16:03.829Z |
Oops, something went wrong.