From d8a8a6f983d8b0274bbafaff515ea1d75aff38d8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 1 Jun 2023 07:28:08 +0000 Subject: [PATCH] CodeGen from PR 24253 in Azure/azure-rest-api-specs Merge acd65a177796043ff21da422e45fbce73cd7bc90 into 367e149d8144804865f9123da4990bf76ee14a2f --- .../dynatrace/armdynatrace/CHANGELOG.md | 19 + .../dynatrace/armdynatrace/autorest.md | 6 +- .../dynatrace/armdynatrace/constants.go | 2 +- .../dynatrace/armdynatrace/go.mod | 16 +- .../dynatrace/armdynatrace/go.sum | 22 +- .../dynatrace/armdynatrace/models.go | 357 +++--- .../dynatrace/armdynatrace/models_serde.go | 179 +-- .../dynatrace/armdynatrace/monitors_client.go | 141 ++- .../monitors_client_example_test.go | 1105 ----------------- .../armdynatrace/operations_client.go | 4 +- .../operations_client_example_test.go | 85 -- .../dynatrace/armdynatrace/response_types.go | 16 +- .../armdynatrace/singlesignon_client.go | 14 +- .../singlesignon_client_example_test.go | 262 ---- .../dynatrace/armdynatrace/tagrules_client.go | 83 +- .../tagrules_client_example_test.go | 476 ------- 16 files changed, 419 insertions(+), 2368 deletions(-) delete mode 100644 sdk/resourcemanager/dynatrace/armdynatrace/monitors_client_example_test.go delete mode 100644 sdk/resourcemanager/dynatrace/armdynatrace/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client_example_test.go delete mode 100644 sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client_example_test.go diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md b/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md index 69f403945ad7..9e448897c817 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md +++ b/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 2.0.0 (2023-06-01) +### Breaking Changes + +- Function `*MonitorsClient.GetAccountCredentials` has been removed +- Function `*TagRulesClient.Update` has been removed +- Struct `AccountInfoSecure` has been removed +- Struct `TagRuleUpdate` has been removed +- Field `DynatraceEnvironmentProperties`, `MarketplaceSubscriptionStatus`, `MonitoringStatus`, `PlanData`, `UserInfo` of struct `MonitorResourceUpdate` has been removed + +### Features Added + +- New function `*MonitorsClient.GetMarketplaceSaaSResourceDetails(context.Context, MarketplaceSaaSResourceDetailsRequest, *MonitorsClientGetMarketplaceSaaSResourceDetailsOptions) (MonitorsClientGetMarketplaceSaaSResourceDetailsResponse, error)` +- New function `*MonitorsClient.GetMetricStatus(context.Context, string, string, *MonitorsClientGetMetricStatusOptions) (MonitorsClientGetMetricStatusResponse, error)` +- New struct `MarketplaceSaaSResourceDetailsRequest` +- New struct `MarketplaceSaaSResourceDetailsResponse` +- New struct `MetricsStatusResponse` +- New field `SendingMetrics` in struct `MetricRules` + + ## 1.1.0 (2023-03-28) ### Features Added diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md b/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md index 7fb91c2cffec..8efd95bf54cb 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md +++ b/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dynatrace/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dynatrace/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/constants.go b/sdk/resourcemanager/dynatrace/armdynatrace/constants.go index ae21ed7c0d17..749696c950d1 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/constants.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/constants.go @@ -11,7 +11,7 @@ package armdynatrace const ( moduleName = "armdynatrace" - moduleVersion = "v1.1.0" + moduleVersion = "v2.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/go.mod b/sdk/resourcemanager/dynatrace/armdynatrace/go.mod index 172e03a7baff..b9402f63efbc 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/go.mod +++ b/sdk/resourcemanager/dynatrace/armdynatrace/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/go.sum b/sdk/resourcemanager/dynatrace/armdynatrace/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/go.sum +++ b/sdk/resourcemanager/dynatrace/armdynatrace/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/models.go b/sdk/resourcemanager/dynatrace/armdynatrace/models.go index 2e23587ed7fe..5cdce5477446 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/models.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/models.go @@ -14,152 +14,140 @@ import "time" // AccountInfo - Dynatrace Account Information type AccountInfo struct { // Account Id of the account this environment is linked to - AccountID *string `json:"accountId,omitempty"` + AccountID *string // Region in which the account is created - RegionID *string `json:"regionId,omitempty"` -} - -// AccountInfoSecure - Dynatrace account API Key -type AccountInfoSecure struct { - // READ-ONLY; API Key of the user account - APIKey *string `json:"apiKey,omitempty" azure:"ro"` - - // READ-ONLY; Account Id of the account this environment is linked to - AccountID *string `json:"accountId,omitempty" azure:"ro"` - - // READ-ONLY; Region in which the account is created - RegionID *string `json:"regionId,omitempty" azure:"ro"` + RegionID *string } // AppServiceInfo - Details of App Services having Dynatrace OneAgent installed type AppServiceInfo struct { // Update settings of OneAgent. - AutoUpdateSetting *AutoUpdateSetting `json:"autoUpdateSetting,omitempty"` + AutoUpdateSetting *AutoUpdateSetting // The availability state of OneAgent. - AvailabilityState *AvailabilityState `json:"availabilityState,omitempty"` + AvailabilityState *AvailabilityState // The name of the host group - HostGroup *string `json:"hostGroup,omitempty"` + HostGroup *string // The name of the host - HostName *string `json:"hostName,omitempty"` + HostName *string // Tells whether log modules are enabled or not - LogModule *LogModule `json:"logModule,omitempty"` + LogModule *LogModule // The monitoring mode of OneAgent - MonitoringType *MonitoringType `json:"monitoringType,omitempty"` + MonitoringType *MonitoringType // App service resource ID - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string // The current update status of OneAgent. - UpdateStatus *UpdateStatus `json:"updateStatus,omitempty"` + UpdateStatus *UpdateStatus // Version of the Dynatrace agent installed on the App Service. - Version *string `json:"version,omitempty"` + Version *string } // AppServiceListResponse - Response of a list App Services Operation. type AppServiceListResponse struct { // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The items on this page - Value []*AppServiceInfo `json:"value,omitempty"` + Value []*AppServiceInfo } // EnvironmentInfo - Dynatrace Environment Information type EnvironmentInfo struct { // Id of the environment created - EnvironmentID *string `json:"environmentId,omitempty"` + EnvironmentID *string // Ingestion key of the environment - IngestionKey *string `json:"ingestionKey,omitempty"` + IngestionKey *string // Landing URL for Dynatrace environment - LandingURL *string `json:"landingURL,omitempty"` + LandingURL *string // Ingestion endpoint used for sending logs - LogsIngestionEndpoint *string `json:"logsIngestionEndpoint,omitempty"` + LogsIngestionEndpoint *string } // EnvironmentProperties - Properties of the Dynatrace environment. type EnvironmentProperties struct { // Dynatrace Account Information - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AccountInfo *AccountInfo // Dynatrace Environment Information - EnvironmentInfo *EnvironmentInfo `json:"environmentInfo,omitempty"` + EnvironmentInfo *EnvironmentInfo // The details of a Dynatrace single sign-on. - SingleSignOnProperties *SingleSignOnProperties `json:"singleSignOnProperties,omitempty"` + SingleSignOnProperties *SingleSignOnProperties // User id - UserID *string `json:"userId,omitempty"` + UserID *string } // FilteringTag - The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them // from being monitored. type FilteringTag struct { // Valid actions for a filtering tag. Exclusion takes priority over inclusion. - Action *TagAction `json:"action,omitempty"` + Action *TagAction // The name (also known as the key) of the tag. - Name *string `json:"name,omitempty"` + Name *string // The value of the tag. - Value *string `json:"value,omitempty"` + Value *string } // IdentityProperties - The properties of the managed service identities assigned to this resource. type IdentityProperties struct { // REQUIRED; The type of managed identity assigned to this resource. - Type *ManagedIdentityType `json:"type,omitempty"` + Type *ManagedIdentityType // The identities assigned to this resource by the user. - UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The active directory identifier of this principal. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string // READ-ONLY; The Active Directory tenant id of the principal. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + TenantID *string } // LinkableEnvironmentListResponse - Response for getting all the linkable environments type LinkableEnvironmentListResponse struct { // Link to the next set of results, if any. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // List of environments for which user is an admin - Value []*LinkableEnvironmentResponse `json:"value,omitempty"` + Value []*LinkableEnvironmentResponse } // LinkableEnvironmentRequest - Request for getting all the linkable environments for a user type LinkableEnvironmentRequest struct { - // Azure region in which we want to link the environment - Region *string `json:"region,omitempty"` + // REQUIRED; Azure region in which we want to link the environment + Region *string - // Tenant Id of the user in which they want to link the environment - TenantID *string `json:"tenantId,omitempty"` + // REQUIRED; Tenant Id of the user in which they want to link the environment + TenantID *string - // user principal id of the user - UserPrincipal *string `json:"userPrincipal,omitempty"` + // REQUIRED; user principal id of the user + UserPrincipal *string } // LinkableEnvironmentResponse - Response for getting all the linkable environments type LinkableEnvironmentResponse struct { // environment id for which user is an admin - EnvironmentID *string `json:"environmentId,omitempty"` + EnvironmentID *string // Name of the environment - EnvironmentName *string `json:"environmentName,omitempty"` + EnvironmentName *string // Billing plan information. - PlanData *PlanData `json:"planData,omitempty"` + PlanData *PlanData } // LogRules - Set of rules for sending logs for the Monitor resource. @@ -168,16 +156,34 @@ type LogRules struct { // all resources will be captured. If only Exclude action is specified, the // rules will apply to the list of all available resources. If Include actions are specified, the rules will only include // resources with the associated tags. - FilteringTags []*FilteringTag `json:"filteringTags,omitempty"` + FilteringTags []*FilteringTag // Flag specifying if AAD logs should be sent for the Monitor resource. - SendAADLogs *SendAADLogsStatus `json:"sendAadLogs,omitempty"` + SendAADLogs *SendAADLogsStatus // Flag specifying if activity logs from Azure resources should be sent for the Monitor resource. - SendActivityLogs *SendActivityLogsStatus `json:"sendActivityLogs,omitempty"` + SendActivityLogs *SendActivityLogsStatus // Flag specifying if subscription logs should be sent for the Monitor resource. - SendSubscriptionLogs *SendSubscriptionLogsStatus `json:"sendSubscriptionLogs,omitempty"` + SendSubscriptionLogs *SendSubscriptionLogsStatus +} + +// MarketplaceSaaSResourceDetailsRequest - Request for getting Marketplace SaaS resource details for a tenant Id +type MarketplaceSaaSResourceDetailsRequest struct { + // REQUIRED; Tenant Id + TenantID *string +} + +// MarketplaceSaaSResourceDetailsResponse - Marketplace SaaS resource details linked to the given tenant Id +type MarketplaceSaaSResourceDetailsResponse struct { + // Id of the Marketplace SaaS Resource + MarketplaceSaaSResourceID *string + + // Marketplace subscription status + MarketplaceSubscriptionStatus *MarketplaceSubscriptionStatus + + // Id of the plan + PlanID *string } // MetricRules - Set of rules for sending metrics for the Monitor resource. @@ -185,130 +191,124 @@ type MetricRules struct { // List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action // is specified, the rules will apply to the list of all available resources. If // Include actions are specified, the rules will only include resources with the associated tags. - FilteringTags []*FilteringTag `json:"filteringTags,omitempty"` + FilteringTags []*FilteringTag + + // Flag specifying if metrics from Azure resources should be sent for the Monitor resource. + SendingMetrics *SendingMetricsStatus +} + +// MetricsStatusResponse - Response of get metrics status operation +type MetricsStatusResponse struct { + // Azure resource IDs + AzureResourceIDs []*string } // MonitorProperties - Properties specific to the monitor resource. type MonitorProperties struct { // Properties of the Dynatrace environment. - DynatraceEnvironmentProperties *EnvironmentProperties `json:"dynatraceEnvironmentProperties,omitempty"` + DynatraceEnvironmentProperties *EnvironmentProperties // Marketplace subscription status. - MarketplaceSubscriptionStatus *MarketplaceSubscriptionStatus `json:"marketplaceSubscriptionStatus,omitempty"` + MarketplaceSubscriptionStatus *MarketplaceSubscriptionStatus // Status of the monitor. - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty"` + MonitoringStatus *MonitoringStatus // Billing plan information. - PlanData *PlanData `json:"planData,omitempty"` + PlanData *PlanData // User info. - UserInfo *UserInfo `json:"userInfo,omitempty"` + UserInfo *UserInfo // READ-ONLY; Liftr Resource category. - LiftrResourceCategory *LiftrResourceCategories `json:"liftrResourceCategory,omitempty" azure:"ro"` + LiftrResourceCategory *LiftrResourceCategories // READ-ONLY; The priority of the resource. - LiftrResourcePreference *int32 `json:"liftrResourcePreference,omitempty" azure:"ro"` + LiftrResourcePreference *int32 // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // MonitorResource - Dynatrace Monitor Resource type MonitorResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // REQUIRED; The resource-specific properties for this resource. - Properties *MonitorProperties `json:"properties,omitempty"` + Properties *MonitorProperties // The managed service identities assigned to this resource. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; System metadata for this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // MonitorResourceListResult - The response of a MonitorResource list operation. type MonitorResourceListResult struct { // REQUIRED; The items on this page - Value []*MonitorResource `json:"value,omitempty"` + Value []*MonitorResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // MonitorResourceUpdate - The updatable properties of the MonitorResource. type MonitorResourceUpdate struct { - // Properties of the Dynatrace environment. - DynatraceEnvironmentProperties *EnvironmentProperties `json:"dynatraceEnvironmentProperties,omitempty"` - - // Marketplace subscription status. - MarketplaceSubscriptionStatus *MarketplaceSubscriptionStatus `json:"marketplaceSubscriptionStatus,omitempty"` - - // Status of the monitor. - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty"` - - // Billing plan information. - PlanData *PlanData `json:"planData,omitempty"` - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // User info. - UserInfo *UserInfo `json:"userInfo,omitempty"` + Tags map[string]*string } // MonitoredResource - Details of resource being monitored by Dynatrace monitor resource type MonitoredResource struct { // The ARM id of the resource. - ID *string `json:"id,omitempty"` + ID *string // Reason for why the resource is sending logs (or why it is not sending). - ReasonForLogsStatus *string `json:"reasonForLogsStatus,omitempty"` + ReasonForLogsStatus *string // Reason for why the resource is sending metrics (or why it is not sending). - ReasonForMetricsStatus *string `json:"reasonForMetricsStatus,omitempty"` + ReasonForMetricsStatus *string // Flag indicating if resource is sending logs to Dynatrace. - SendingLogs *SendingLogsStatus `json:"sendingLogs,omitempty"` + SendingLogs *SendingLogsStatus // Flag indicating if resource is sending metrics to Dynatrace. - SendingMetrics *SendingMetricsStatus `json:"sendingMetrics,omitempty"` + SendingMetrics *SendingMetricsStatus } // MonitoredResourceListResponse - List of all the resources being monitored by Dynatrace monitor resource type MonitoredResourceListResponse struct { // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The items on this page - Value []*MonitoredResource `json:"value,omitempty"` + Value []*MonitoredResource } // MonitoringTagRulesProperties - Properties for the Tag rules resource of a Monitor account. type MonitoringTagRulesProperties struct { // Set of rules for sending logs for the Monitor resource. - LogRules *LogRules `json:"logRules,omitempty"` + LogRules *LogRules // Set of rules for sending metrics for the Monitor resource. - MetricRules *MetricRules `json:"metricRules,omitempty"` + MetricRules *MetricRules // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // MonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitorsClient.BeginCreateOrUpdate method. @@ -323,9 +323,14 @@ type MonitorsClientBeginDeleteOptions struct { ResumeToken string } -// MonitorsClientGetAccountCredentialsOptions contains the optional parameters for the MonitorsClient.GetAccountCredentials +// MonitorsClientGetMarketplaceSaaSResourceDetailsOptions contains the optional parameters for the MonitorsClient.GetMarketplaceSaaSResourceDetails // method. -type MonitorsClientGetAccountCredentialsOptions struct { +type MonitorsClientGetMarketplaceSaaSResourceDetailsOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientGetMetricStatusOptions contains the optional parameters for the MonitorsClient.GetMetricStatus method. +type MonitorsClientGetMetricStatusOptions struct { // placeholder for future optional parameters } @@ -387,50 +392,50 @@ type MonitorsClientUpdateOptions struct { // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + ActionType *ActionType // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. - IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" - Origin *Origin `json:"origin,omitempty" azure:"ro"` + Origin *Origin } // OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to // get the next set of results. type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; List of operations supported by the resource provider - Value []*Operation `json:"value,omitempty" azure:"ro"` + Value []*Operation } // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. @@ -441,40 +446,40 @@ type OperationsClientListOptions struct { // PlanData - Billing plan information. type PlanData struct { // different billing cycles like MONTHLY/WEEKLY. this could be enum - BillingCycle *string `json:"billingCycle,omitempty"` + BillingCycle *string // date when plan was applied - EffectiveDate *time.Time `json:"effectiveDate,omitempty"` + EffectiveDate *time.Time // plan id as published by Dynatrace - PlanDetails *string `json:"planDetails,omitempty"` + PlanDetails *string // different usage type like PAYG/COMMITTED. this could be enum - UsageType *string `json:"usageType,omitempty"` + UsageType *string } // SSODetailsRequest - Request for getting sso details for a user type SSODetailsRequest struct { - // user principal id of the user - UserPrincipal *string `json:"userPrincipal,omitempty"` + // REQUIRED; user principal id of the user + UserPrincipal *string } // SSODetailsResponse - SSO details from the Dynatrace partner type SSODetailsResponse struct { // array of Aad(azure active directory) domains - AADDomains []*string `json:"aadDomains,omitempty"` + AADDomains []*string // Array of admin user emails. - AdminUsers []*string `json:"adminUsers,omitempty"` + AdminUsers []*string // Whether the SSO is enabled for this resource or not. - IsSsoEnabled *SSOStatus `json:"isSsoEnabled,omitempty"` + IsSsoEnabled *SSOStatus // URL for Azure AD metadata - MetadataURL *string `json:"metadataUrl,omitempty"` + MetadataURL *string // The login URL specific to this Dynatrace Environment - SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string } // SingleSignOnClientBeginCreateOrUpdateOptions contains the optional parameters for the SingleSignOnClient.BeginCreateOrUpdate @@ -497,103 +502,94 @@ type SingleSignOnClientListOptions struct { // SingleSignOnProperties - The details of a Dynatrace single sign-on. type SingleSignOnProperties struct { // array of Aad(azure active directory) domains - AADDomains []*string `json:"aadDomains,omitempty"` + AADDomains []*string // Version of the Dynatrace agent installed on the VM. - EnterpriseAppID *string `json:"enterpriseAppId,omitempty"` + EnterpriseAppID *string // State of Single Sign On - SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` + SingleSignOnState *SingleSignOnStates // The login URL specific to this Dynatrace Environment - SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // SingleSignOnResource - Single sign-on configurations for a given monitor resource. type SingleSignOnResource struct { // REQUIRED; The resource-specific properties for this resource. - Properties *SingleSignOnProperties `json:"properties,omitempty"` + Properties *SingleSignOnProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; System metadata for this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SingleSignOnResourceListResult - The response of a DynatraceSingleSignOnResource list operation. type SingleSignOnResourceListResult struct { // REQUIRED; The items on this page - Value []*SingleSignOnResource `json:"value,omitempty"` + Value []*SingleSignOnResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TagRule - Tag rules for a monitor resource type TagRule struct { // REQUIRED; The resource-specific properties for this resource. - Properties *MonitoringTagRulesProperties `json:"properties,omitempty"` + Properties *MonitoringTagRulesProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; System metadata for this resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TagRuleListResult - The response of a TagRule list operation. type TagRuleListResult struct { // REQUIRED; The items on this page - Value []*TagRule `json:"value,omitempty"` + Value []*TagRule // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` -} - -// TagRuleUpdate - The updatable properties of the TagRule. -type TagRuleUpdate struct { - // Set of rules for sending logs for the Monitor resource. - LogRules *LogRules `json:"logRules,omitempty"` - - // Set of rules for sending metrics for the Monitor resource. - MetricRules *MetricRules `json:"metricRules,omitempty"` + NextLink *string } // TagRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.BeginCreateOrUpdate method. @@ -618,82 +614,77 @@ type TagRulesClientListOptions struct { // placeholder for future optional parameters } -// TagRulesClientUpdateOptions contains the optional parameters for the TagRulesClient.Update method. -type TagRulesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // UserAssignedIdentity - A managed identity assigned by the user. type UserAssignedIdentity struct { // REQUIRED; The active directory client identifier for this principal. - ClientID *string `json:"clientId,omitempty"` + ClientID *string // REQUIRED; The active directory identifier for this principal. - PrincipalID *string `json:"principalId,omitempty"` + PrincipalID *string } // UserInfo - User info. type UserInfo struct { // Country of the user - Country *string `json:"country,omitempty"` + Country *string // Email of the user used by Dynatrace for contacting them if needed - EmailAddress *string `json:"emailAddress,omitempty"` + EmailAddress *string // First Name of the user - FirstName *string `json:"firstName,omitempty"` + FirstName *string // Last Name of the user - LastName *string `json:"lastName,omitempty"` + LastName *string // Phone number of the user used by Dynatrace for contacting them if needed - PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumber *string } // VMExtensionPayload - Response of payload to be passed while installing VM agent. type VMExtensionPayload struct { // Id of the environment created - EnvironmentID *string `json:"environmentId,omitempty"` + EnvironmentID *string // Ingestion key of the environment - IngestionKey *string `json:"ingestionKey,omitempty"` + IngestionKey *string } // VMHostsListResponse - Response of a list VM Host Operation. type VMHostsListResponse struct { // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The items on this page - Value []*VMInfo `json:"value,omitempty"` + Value []*VMInfo } // VMInfo - Details of VM Resource having Dynatrace OneAgent installed type VMInfo struct { // Update settings of OneAgent. - AutoUpdateSetting *AutoUpdateSetting `json:"autoUpdateSetting,omitempty"` + AutoUpdateSetting *AutoUpdateSetting // The availability state of OneAgent. - AvailabilityState *AvailabilityState `json:"availabilityState,omitempty"` + AvailabilityState *AvailabilityState // The name of the host group - HostGroup *string `json:"hostGroup,omitempty"` + HostGroup *string // The name of the host - HostName *string `json:"hostName,omitempty"` + HostName *string // Tells whether log modules are enabled or not - LogModule *LogModule `json:"logModule,omitempty"` + LogModule *LogModule // The monitoring mode of OneAgent - MonitoringType *MonitoringType `json:"monitoringType,omitempty"` + MonitoringType *MonitoringType // Azure VM resource ID - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string // The current update status of OneAgent. - UpdateStatus *UpdateStatus `json:"updateStatus,omitempty"` + UpdateStatus *UpdateStatus // Version of the Dynatrace agent installed on the VM. - Version *string `json:"version,omitempty"` + Version *string } diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go b/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go index f88b589f6108..5a66548cc3ec 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go @@ -47,41 +47,6 @@ func (a *AccountInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AccountInfoSecure. -func (a AccountInfoSecure) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "apiKey", a.APIKey) - populate(objectMap, "accountId", a.AccountID) - populate(objectMap, "regionId", a.RegionID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccountInfoSecure. -func (a *AccountInfoSecure) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiKey": - err = unpopulate(val, "APIKey", &a.APIKey) - delete(rawMsg, key) - case "accountId": - err = unpopulate(val, "AccountID", &a.AccountID) - delete(rawMsg, key) - case "regionId": - err = unpopulate(val, "RegionID", &a.RegionID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AppServiceInfo. func (a AppServiceInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -464,10 +429,73 @@ func (l *LogRules) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MarketplaceSaaSResourceDetailsRequest. +func (m MarketplaceSaaSResourceDetailsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tenantId", m.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceSaaSResourceDetailsRequest. +func (m *MarketplaceSaaSResourceDetailsRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MarketplaceSaaSResourceDetailsResponse. +func (m MarketplaceSaaSResourceDetailsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "marketplaceSaaSResourceId", m.MarketplaceSaaSResourceID) + populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) + populate(objectMap, "planId", m.PlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceSaaSResourceDetailsResponse. +func (m *MarketplaceSaaSResourceDetailsResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "marketplaceSaaSResourceId": + err = unpopulate(val, "MarketplaceSaaSResourceID", &m.MarketplaceSaaSResourceID) + delete(rawMsg, key) + case "marketplaceSubscriptionStatus": + err = unpopulate(val, "MarketplaceSubscriptionStatus", &m.MarketplaceSubscriptionStatus) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &m.PlanID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MetricRules. func (m MetricRules) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "filteringTags", m.FilteringTags) + populate(objectMap, "sendingMetrics", m.SendingMetrics) return json.Marshal(objectMap) } @@ -483,6 +511,36 @@ func (m *MetricRules) UnmarshalJSON(data []byte) error { case "filteringTags": err = unpopulate(val, "FilteringTags", &m.FilteringTags) delete(rawMsg, key) + case "sendingMetrics": + err = unpopulate(val, "SendingMetrics", &m.SendingMetrics) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricsStatusResponse. +func (m MetricsStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureResourceIds", m.AzureResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricsStatusResponse. +func (m *MetricsStatusResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureResourceIds": + err = unpopulate(val, "AzureResourceIDs", &m.AzureResourceIDs) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -635,12 +693,7 @@ func (m *MonitorResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorResourceUpdate. func (m MonitorResourceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dynatraceEnvironmentProperties", m.DynatraceEnvironmentProperties) - populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) - populate(objectMap, "monitoringStatus", m.MonitoringStatus) - populate(objectMap, "planData", m.PlanData) populate(objectMap, "tags", m.Tags) - populate(objectMap, "userInfo", m.UserInfo) return json.Marshal(objectMap) } @@ -653,24 +706,9 @@ func (m *MonitorResourceUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dynatraceEnvironmentProperties": - err = unpopulate(val, "DynatraceEnvironmentProperties", &m.DynatraceEnvironmentProperties) - delete(rawMsg, key) - case "marketplaceSubscriptionStatus": - err = unpopulate(val, "MarketplaceSubscriptionStatus", &m.MarketplaceSubscriptionStatus) - delete(rawMsg, key) - case "monitoringStatus": - err = unpopulate(val, "MonitoringStatus", &m.MonitoringStatus) - delete(rawMsg, key) - case "planData": - err = unpopulate(val, "PlanData", &m.PlanData) - delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) - case "userInfo": - err = unpopulate(val, "UserInfo", &m.UserInfo) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1248,37 +1286,6 @@ func (t *TagRuleListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TagRuleUpdate. -func (t TagRuleUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "logRules", t.LogRules) - populate(objectMap, "metricRules", t.MetricRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TagRuleUpdate. -func (t *TagRuleUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "logRules": - err = unpopulate(val, "LogRules", &t.LogRules) - delete(rawMsg, key) - case "metricRules": - err = unpopulate(val, "MetricRules", &t.MetricRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client.go index bff9d22149da..3b2a0c62b389 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client.go @@ -47,7 +47,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - resource - Resource create parameters. @@ -70,7 +70,7 @@ func (client *MonitorsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 func (client *MonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, resource MonitorResource, options *MonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, resource, options) if err != nil { @@ -106,7 +106,7 @@ func (client *MonitorsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -115,7 +115,7 @@ func (client *MonitorsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. @@ -136,7 +136,7 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -172,7 +172,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. @@ -220,7 +220,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,32 +235,81 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl return result, nil } -// GetAccountCredentials - Gets the user account credentials for a Monitor +// GetMarketplaceSaaSResourceDetails - Get Marketplace SaaS resource details of a tenant under a specific subscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 +// - request - Tenant Id +// - options - MonitorsClientGetMarketplaceSaaSResourceDetailsOptions contains the optional parameters for the MonitorsClient.GetMarketplaceSaaSResourceDetails +// method. +func (client *MonitorsClient) GetMarketplaceSaaSResourceDetails(ctx context.Context, request MarketplaceSaaSResourceDetailsRequest, options *MonitorsClientGetMarketplaceSaaSResourceDetailsOptions) (MonitorsClientGetMarketplaceSaaSResourceDetailsResponse, error) { + req, err := client.getMarketplaceSaaSResourceDetailsCreateRequest(ctx, request, options) + if err != nil { + return MonitorsClientGetMarketplaceSaaSResourceDetailsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MonitorsClientGetMarketplaceSaaSResourceDetailsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MonitorsClientGetMarketplaceSaaSResourceDetailsResponse{}, runtime.NewResponseError(resp) + } + return client.getMarketplaceSaaSResourceDetailsHandleResponse(resp) +} + +// getMarketplaceSaaSResourceDetailsCreateRequest creates the GetMarketplaceSaaSResourceDetails request. +func (client *MonitorsClient) getMarketplaceSaaSResourceDetailsCreateRequest(ctx context.Context, request MarketplaceSaaSResourceDetailsRequest, options *MonitorsClientGetMarketplaceSaaSResourceDetailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/getMarketplaceSaaSResourceDetails" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-04-27") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, request) +} + +// getMarketplaceSaaSResourceDetailsHandleResponse handles the GetMarketplaceSaaSResourceDetails response. +func (client *MonitorsClient) getMarketplaceSaaSResourceDetailsHandleResponse(resp *http.Response) (MonitorsClientGetMarketplaceSaaSResourceDetailsResponse, error) { + result := MonitorsClientGetMarketplaceSaaSResourceDetailsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MarketplaceSaaSResourceDetailsResponse); err != nil { + return MonitorsClientGetMarketplaceSaaSResourceDetailsResponse{}, err + } + return result, nil +} + +// GetMetricStatus - Get metric status +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - monitorName - Monitor resource name -// - options - MonitorsClientGetAccountCredentialsOptions contains the optional parameters for the MonitorsClient.GetAccountCredentials +// - monitorName - Name of the Monitor resource +// - options - MonitorsClientGetMetricStatusOptions contains the optional parameters for the MonitorsClient.GetMetricStatus // method. -func (client *MonitorsClient) GetAccountCredentials(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetAccountCredentialsOptions) (MonitorsClientGetAccountCredentialsResponse, error) { - req, err := client.getAccountCredentialsCreateRequest(ctx, resourceGroupName, monitorName, options) +func (client *MonitorsClient) GetMetricStatus(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetMetricStatusOptions) (MonitorsClientGetMetricStatusResponse, error) { + req, err := client.getMetricStatusCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { - return MonitorsClientGetAccountCredentialsResponse{}, err + return MonitorsClientGetMetricStatusResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return MonitorsClientGetAccountCredentialsResponse{}, err + return MonitorsClientGetMetricStatusResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientGetAccountCredentialsResponse{}, runtime.NewResponseError(resp) + return MonitorsClientGetMetricStatusResponse{}, runtime.NewResponseError(resp) } - return client.getAccountCredentialsHandleResponse(resp) + return client.getMetricStatusHandleResponse(resp) } -// getAccountCredentialsCreateRequest creates the GetAccountCredentials request. -func (client *MonitorsClient) getAccountCredentialsCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetAccountCredentialsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials" +// getMetricStatusCreateRequest creates the GetMetricStatus request. +func (client *MonitorsClient) getMetricStatusCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetMetricStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getMetricStatus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -278,17 +327,17 @@ func (client *MonitorsClient) getAccountCredentialsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// getAccountCredentialsHandleResponse handles the GetAccountCredentials response. -func (client *MonitorsClient) getAccountCredentialsHandleResponse(resp *http.Response) (MonitorsClientGetAccountCredentialsResponse, error) { - result := MonitorsClientGetAccountCredentialsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AccountInfoSecure); err != nil { - return MonitorsClientGetAccountCredentialsResponse{}, err +// getMetricStatusHandleResponse handles the GetMetricStatus response. +func (client *MonitorsClient) getMetricStatusHandleResponse(resp *http.Response) (MonitorsClientGetMetricStatusResponse, error) { + result := MonitorsClientGetMetricStatusResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MetricsStatusResponse); err != nil { + return MonitorsClientGetMetricStatusResponse{}, err } return result, nil } @@ -296,7 +345,7 @@ func (client *MonitorsClient) getAccountCredentialsHandleResponse(resp *http.Res // GetSSODetails - Gets the SSO configuration details from the partner. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientGetSSODetailsOptions contains the optional parameters for the MonitorsClient.GetSSODetails method. @@ -335,7 +384,7 @@ func (client *MonitorsClient) getSSODetailsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Request != nil { @@ -357,7 +406,7 @@ func (client *MonitorsClient) getSSODetailsHandleResponse(resp *http.Response) ( // VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientGetVMHostPayloadOptions contains the optional parameters for the MonitorsClient.GetVMHostPayload @@ -397,7 +446,7 @@ func (client *MonitorsClient) getVMHostPayloadCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -414,7 +463,7 @@ func (client *MonitorsClient) getVMHostPayloadHandleResponse(resp *http.Response // NewListAppServicesPager - Gets list of App Services with Dynatrace PaaS OneAgent enabled // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientListAppServicesOptions contains the optional parameters for the MonitorsClient.NewListAppServicesPager @@ -467,7 +516,7 @@ func (client *MonitorsClient) listAppServicesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -484,7 +533,7 @@ func (client *MonitorsClient) listAppServicesHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List MonitorResource resources by resource group // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager // method. @@ -532,7 +581,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -549,7 +598,7 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionIDPager - List all MonitorResource by subscriptionId // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - options - MonitorsClientListBySubscriptionIDOptions contains the optional parameters for the MonitorsClient.NewListBySubscriptionIDPager // method. func (client *MonitorsClient) NewListBySubscriptionIDPager(options *MonitorsClientListBySubscriptionIDOptions) *runtime.Pager[MonitorsClientListBySubscriptionIDResponse] { @@ -592,7 +641,7 @@ func (client *MonitorsClient) listBySubscriptionIDCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -607,9 +656,9 @@ func (client *MonitorsClient) listBySubscriptionIDHandleResponse(resp *http.Resp return result, nil } -// NewListHostsPager - List the compute resources currently being monitored by the Dynatrace resource. +// NewListHostsPager - List the VM/VMSS resources currently being monitored by the Dynatrace resource. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientListHostsOptions contains the optional parameters for the MonitorsClient.NewListHostsPager method. @@ -661,7 +710,7 @@ func (client *MonitorsClient) listHostsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -678,7 +727,7 @@ func (client *MonitorsClient) listHostsHandleResponse(resp *http.Response) (Moni // NewListLinkableEnvironmentsPager - Gets all the Dynatrace environments that a user can link a azure resource to // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - request - The details of the linkable environment request. @@ -732,7 +781,7 @@ func (client *MonitorsClient) listLinkableEnvironmentsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, request) @@ -749,7 +798,7 @@ func (client *MonitorsClient) listLinkableEnvironmentsHandleResponse(resp *http. // NewListMonitoredResourcesPager - List the resources currently being monitored by the Dynatrace monitor resource. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.NewListMonitoredResourcesPager @@ -802,7 +851,7 @@ func (client *MonitorsClient) listMonitoredResourcesCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -820,7 +869,7 @@ func (client *MonitorsClient) listMonitoredResourcesHandleResponse(resp *http.Re // Update - Update a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - resource - The resource properties to be updated. @@ -860,7 +909,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client_example_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client_example_test.go deleted file mode 100644 index 8f1b67ede005..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client_example_test.go +++ /dev/null @@ -1,1105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdynatrace_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetAccountCredentials_MaximumSet_Gen.json -func ExampleMonitorsClient_GetAccountCredentials_monitorsGetAccountCredentialsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetAccountCredentials(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccountInfoSecure = armdynatrace.AccountInfoSecure{ - // AccountID: to.Ptr("1234567890"), - // RegionID: to.Ptr("wus2"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetAccountCredentials_MinimumSet_Gen.json -func ExampleMonitorsClient_GetAccountCredentials_monitorsGetAccountCredentialsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetAccountCredentials(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccountInfoSecure = armdynatrace.AccountInfoSecure{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListMonitoredResourcesPager_monitorsListMonitoredResourcesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListMonitoredResourcesPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitoredResourceListResponse = armdynatrace.MonitoredResourceListResponse{ - // Value: []*armdynatrace.MonitoredResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor/listMonitoredResources"), - // ReasonForLogsStatus: to.Ptr("CapturedByRules"), - // ReasonForMetricsStatus: to.Ptr("CapturedByRules"), - // SendingLogs: to.Ptr(armdynatrace.SendingLogsStatusEnabled), - // SendingMetrics: to.Ptr(armdynatrace.SendingMetricsStatusEnabled), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListMonitoredResourcesPager_monitorsListMonitoredResourcesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListMonitoredResourcesPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitoredResourceListResponse = armdynatrace.MonitoredResourceListResponse{ - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetVMHostPayload_MaximumSet_Gen.json -func ExampleMonitorsClient_GetVMHostPayload_monitorsGetVmHostPayloadMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetVMHostPayload(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VMExtensionPayload = armdynatrace.VMExtensionPayload{ - // EnvironmentID: to.Ptr("abc123lsjlsfjlfjgd"), - // IngestionKey: to.Ptr("abcd.efg"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetVMHostPayload_MinimumSet_Gen.json -func ExampleMonitorsClient_GetVMHostPayload_monitorsGetVmHostPayloadMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetVMHostPayload(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VMExtensionPayload = armdynatrace.VMExtensionPayload{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Get_MaximumSet_Gen.json -func ExampleMonitorsClient_Get_monitorsGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Get(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdynatrace.MonitorResource{ - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // Identity: &armdynatrace.IdentityProperties{ - // Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("4534676867978"), - // TenantID: to.Ptr("23456789001"), - // }, - // Properties: &armdynatrace.MonitorProperties{ - // DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - // AccountInfo: &armdynatrace.AccountInfo{ - // AccountID: to.Ptr("1234567890"), - // RegionID: to.Ptr("wus2"), - // }, - // EnvironmentInfo: &armdynatrace.EnvironmentInfo{ - // EnvironmentID: to.Ptr("a23xcv456"), - // IngestionKey: to.Ptr("1234567890"), - // LandingURL: to.Ptr("https://a23xcv456.dynatrace.com"), - // LogsIngestionEndpoint: to.Ptr("https://dynatrace.com"), - // }, - // SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // UserID: to.Ptr("alice123"), - // }, - // LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](28), - // MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - // PlanData: &armdynatrace.PlanData{ - // BillingCycle: to.Ptr("Monthly"), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t}()), - // PlanDetails: to.Ptr("dynatraceapitestplan"), - // UsageType: to.Ptr("Committed"), - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // UserInfo: &armdynatrace.UserInfo{ - // Country: to.Ptr("westus2"), - // EmailAddress: to.Ptr("alice@microsoft.com"), - // FirstName: to.Ptr("Alice"), - // LastName: to.Ptr("Bobab"), - // PhoneNumber: to.Ptr("123456"), - // }, - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Get_MinimumSet_Gen.json -func ExampleMonitorsClient_Get_monitorsGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Get(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdynatrace.MonitorResource{ - // Location: to.Ptr("West US 2"), - // Properties: &armdynatrace.MonitorProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json -func ExampleMonitorsClient_BeginCreateOrUpdate_monitorsCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", armdynatrace.MonitorResource{ - Location: to.Ptr("West US 2"), - Tags: map[string]*string{ - "Environment": to.Ptr("Dev"), - }, - Identity: &armdynatrace.IdentityProperties{ - Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - }, - Properties: &armdynatrace.MonitorProperties{ - DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - AccountInfo: &armdynatrace.AccountInfo{}, - EnvironmentInfo: &armdynatrace.EnvironmentInfo{}, - SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{}, - }, - LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - PlanData: &armdynatrace.PlanData{ - BillingCycle: to.Ptr("Monthly"), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t }()), - PlanDetails: to.Ptr("dynatraceapitestplan"), - UsageType: to.Ptr("Committed"), - }, - ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateAccepted), - UserInfo: &armdynatrace.UserInfo{ - Country: to.Ptr("westus2"), - EmailAddress: to.Ptr("alice@microsoft.com"), - FirstName: to.Ptr("Alice"), - LastName: to.Ptr("Bobab"), - PhoneNumber: to.Ptr("123456"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdynatrace.MonitorResource{ - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // Identity: &armdynatrace.IdentityProperties{ - // Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("4534676867978"), - // TenantID: to.Ptr("23456789001"), - // }, - // Properties: &armdynatrace.MonitorProperties{ - // DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - // AccountInfo: &armdynatrace.AccountInfo{ - // AccountID: to.Ptr("1234567890"), - // RegionID: to.Ptr("wus2"), - // }, - // EnvironmentInfo: &armdynatrace.EnvironmentInfo{ - // EnvironmentID: to.Ptr("a23xcv456"), - // IngestionKey: to.Ptr("1234567890"), - // LogsIngestionEndpoint: to.Ptr("https://dynatrace.com"), - // }, - // SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // UserID: to.Ptr("alice123"), - // }, - // LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](28), - // MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - // PlanData: &armdynatrace.PlanData{ - // BillingCycle: to.Ptr("Monthly"), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t}()), - // PlanDetails: to.Ptr("dynatraceapitestplan"), - // UsageType: to.Ptr("Committed"), - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // UserInfo: &armdynatrace.UserInfo{ - // Country: to.Ptr("westus2"), - // EmailAddress: to.Ptr("alice@microsoft.com"), - // FirstName: to.Ptr("Alice"), - // LastName: to.Ptr("Bobab"), - // PhoneNumber: to.Ptr("123456"), - // }, - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_CreateOrUpdate_MinimumSet_Gen.json -func ExampleMonitorsClient_BeginCreateOrUpdate_monitorsCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", armdynatrace.MonitorResource{ - Location: to.Ptr("West US 2"), - Properties: &armdynatrace.MonitorProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdynatrace.MonitorResource{ - // Location: to.Ptr("West US 2"), - // Properties: &armdynatrace.MonitorProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Update_MaximumSet_Gen.json -func ExampleMonitorsClient_Update_monitorsUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Update(ctx, "myResourceGroup", "myMonitor", armdynatrace.MonitorResourceUpdate{ - DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - AccountInfo: &armdynatrace.AccountInfo{}, - EnvironmentInfo: &armdynatrace.EnvironmentInfo{}, - SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{}, - }, - MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - PlanData: &armdynatrace.PlanData{ - BillingCycle: to.Ptr("Monthly"), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t }()), - PlanDetails: to.Ptr("dynatraceapitestplan"), - UsageType: to.Ptr("Committed"), - }, - Tags: map[string]*string{ - "Environment": to.Ptr("Dev"), - }, - UserInfo: &armdynatrace.UserInfo{ - Country: to.Ptr("westus2"), - EmailAddress: to.Ptr("alice@microsoft.com"), - FirstName: to.Ptr("Alice"), - LastName: to.Ptr("Bobab"), - PhoneNumber: to.Ptr("123456"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdynatrace.MonitorResource{ - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // Identity: &armdynatrace.IdentityProperties{ - // Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("4534676867978"), - // TenantID: to.Ptr("23456789001"), - // }, - // Properties: &armdynatrace.MonitorProperties{ - // DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - // AccountInfo: &armdynatrace.AccountInfo{ - // AccountID: to.Ptr("1234567890"), - // RegionID: to.Ptr("wus2"), - // }, - // EnvironmentInfo: &armdynatrace.EnvironmentInfo{ - // EnvironmentID: to.Ptr("a23xcv456"), - // IngestionKey: to.Ptr("1234567890"), - // LandingURL: to.Ptr("https://a23xcv456.dynatrace.com"), - // LogsIngestionEndpoint: to.Ptr("https://dynatrace.com"), - // }, - // SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // UserID: to.Ptr("alice123"), - // }, - // LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](28), - // MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - // PlanData: &armdynatrace.PlanData{ - // BillingCycle: to.Ptr("Monthly"), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t}()), - // PlanDetails: to.Ptr("dynatraceapitestplan"), - // UsageType: to.Ptr("Committed"), - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // UserInfo: &armdynatrace.UserInfo{ - // Country: to.Ptr("westus2"), - // EmailAddress: to.Ptr("alice@microsoft.com"), - // FirstName: to.Ptr("Alice"), - // LastName: to.Ptr("Bobab"), - // PhoneNumber: to.Ptr("123456"), - // }, - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Update_MinimumSet_Gen.json -func ExampleMonitorsClient_Update_monitorsUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Update(ctx, "myResourceGroup", "myMonitor", armdynatrace.MonitorResourceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdynatrace.MonitorResource{ - // Location: to.Ptr("West US 2"), - // Properties: &armdynatrace.MonitorProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Delete_MaximumSet_Gen.json -func ExampleMonitorsClient_BeginDelete_monitorsDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginDelete(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_Delete_MinimumSet_Gen.json -func ExampleMonitorsClient_BeginDelete_monitorsDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginDelete(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListBySubscriptionId_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListBySubscriptionIDPager_monitorsListBySubscriptionIdMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListBySubscriptionIDPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorResourceListResult = armdynatrace.MonitorResourceListResult{ - // Value: []*armdynatrace.MonitorResource{ - // { - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // Identity: &armdynatrace.IdentityProperties{ - // Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("4534676867978"), - // TenantID: to.Ptr("23456789001"), - // }, - // Properties: &armdynatrace.MonitorProperties{ - // DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - // AccountInfo: &armdynatrace.AccountInfo{ - // AccountID: to.Ptr("1234567890"), - // RegionID: to.Ptr("wus2"), - // }, - // EnvironmentInfo: &armdynatrace.EnvironmentInfo{ - // EnvironmentID: to.Ptr("a23xcv456"), - // IngestionKey: to.Ptr("1234567890"), - // LandingURL: to.Ptr("https://a23xcv456.dynatrace.com"), - // LogsIngestionEndpoint: to.Ptr("https://dynatrace.com"), - // }, - // SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // UserID: to.Ptr("alice123"), - // }, - // LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](28), - // MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - // PlanData: &armdynatrace.PlanData{ - // BillingCycle: to.Ptr("Monthly"), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t}()), - // PlanDetails: to.Ptr("dynatraceapitestplan"), - // UsageType: to.Ptr("Committed"), - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // UserInfo: &armdynatrace.UserInfo{ - // Country: to.Ptr("westus2"), - // EmailAddress: to.Ptr("alice@microsoft.com"), - // FirstName: to.Ptr("Alice"), - // LastName: to.Ptr("Bobab"), - // PhoneNumber: to.Ptr("123456"), - // }, - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListBySubscriptionId_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListBySubscriptionIDPager_monitorsListBySubscriptionIdMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListBySubscriptionIDPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorResourceListResult = armdynatrace.MonitorResourceListResult{ - // Value: []*armdynatrace.MonitorResource{ - // { - // Location: to.Ptr("West US 2"), - // Properties: &armdynatrace.MonitorProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListByResourceGroupPager_monitorsListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorResourceListResult = armdynatrace.MonitorResourceListResult{ - // Value: []*armdynatrace.MonitorResource{ - // { - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // Identity: &armdynatrace.IdentityProperties{ - // Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("4534676867978"), - // TenantID: to.Ptr("23456789001"), - // }, - // Properties: &armdynatrace.MonitorProperties{ - // DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - // AccountInfo: &armdynatrace.AccountInfo{ - // AccountID: to.Ptr("1234567890"), - // RegionID: to.Ptr("wus2"), - // }, - // EnvironmentInfo: &armdynatrace.EnvironmentInfo{ - // EnvironmentID: to.Ptr("a23xcv456"), - // IngestionKey: to.Ptr("1234567890"), - // LandingURL: to.Ptr("https://a23xcv456.dynatrace.com"), - // LogsIngestionEndpoint: to.Ptr("https://dynatrace.com"), - // }, - // SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // UserID: to.Ptr("alice123"), - // }, - // LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](28), - // MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - // PlanData: &armdynatrace.PlanData{ - // BillingCycle: to.Ptr("Monthly"), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t}()), - // PlanDetails: to.Ptr("dynatraceapitestplan"), - // UsageType: to.Ptr("Committed"), - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // UserInfo: &armdynatrace.UserInfo{ - // Country: to.Ptr("westus2"), - // EmailAddress: to.Ptr("alice@microsoft.com"), - // FirstName: to.Ptr("Alice"), - // LastName: to.Ptr("Bobab"), - // PhoneNumber: to.Ptr("123456"), - // }, - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListByResourceGroup_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListByResourceGroupPager_monitorsListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorResourceListResult = armdynatrace.MonitorResourceListResult{ - // Value: []*armdynatrace.MonitorResource{ - // { - // Location: to.Ptr("West US 2"), - // Properties: &armdynatrace.MonitorProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListHosts_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListHostsPager_monitorsListHostsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListHostsPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VMHostsListResponse = armdynatrace.VMHostsListResponse{ - // Value: []*armdynatrace.VMInfo{ - // { - // AutoUpdateSetting: to.Ptr(armdynatrace.AutoUpdateSettingENABLED), - // AvailabilityState: to.Ptr(armdynatrace.AvailabilityStateCRASHED), - // HostGroup: to.Ptr("myGroup"), - // HostName: to.Ptr("myName"), - // LogModule: to.Ptr(armdynatrace.LogModuleENABLED), - // MonitoringType: to.Ptr(armdynatrace.MonitoringTypeCLOUDINFRASTRUCTURE), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtual1"), - // UpdateStatus: to.Ptr(armdynatrace.UpdateStatusINCOMPATIBLE), - // Version: to.Ptr("1.2.0"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListHosts_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListHostsPager_monitorsListHostsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListHostsPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VMHostsListResponse = armdynatrace.VMHostsListResponse{ - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListAppServicesPager_monitorsListAppServicesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListAppServicesPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AppServiceListResponse = armdynatrace.AppServiceListResponse{ - // Value: []*armdynatrace.AppServiceInfo{ - // { - // AutoUpdateSetting: to.Ptr(armdynatrace.AutoUpdateSettingENABLED), - // AvailabilityState: to.Ptr(armdynatrace.AvailabilityStateCRASHED), - // HostGroup: to.Ptr("myGroup"), - // HostName: to.Ptr("myName"), - // LogModule: to.Ptr(armdynatrace.LogModuleENABLED), - // MonitoringType: to.Ptr(armdynatrace.MonitoringTypeCLOUDINFRASTRUCTURE), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtual1"), - // UpdateStatus: to.Ptr(armdynatrace.UpdateStatusINCOMPATIBLE), - // Version: to.Ptr("1.2.0"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListAppServicesPager_monitorsListAppServicesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListAppServicesPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AppServiceListResponse = armdynatrace.AppServiceListResponse{ - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetSSODetails_MaximumSet_Gen.json -func ExampleMonitorsClient_GetSSODetails_monitorsGetSsoDetailsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetSSODetails(ctx, "myResourceGroup", "myMonitor", &armdynatrace.MonitorsClientGetSSODetailsOptions{Request: &armdynatrace.SSODetailsRequest{ - UserPrincipal: to.Ptr("alice@microsoft.com"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSODetailsResponse = armdynatrace.SSODetailsResponse{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // AdminUsers: []*string{ - // to.Ptr("alice@microsoft.com")}, - // IsSsoEnabled: to.Ptr(armdynatrace.SSOStatusEnabled), - // MetadataURL: to.Ptr("https://someuri"), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_GetSSODetails_MinimumSet_Gen.json -func ExampleMonitorsClient_GetSSODetails_monitorsGetSsoDetailsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetSSODetails(ctx, "myResourceGroup", "myMonitor", &armdynatrace.MonitorsClientGetSSODetailsOptions{Request: &armdynatrace.SSODetailsRequest{}}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSODetailsResponse = armdynatrace.SSODetailsResponse{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListLinkableEnvironments_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListLinkableEnvironmentsPager_monitorsListLinkableEnvironmentsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListLinkableEnvironmentsPager("myResourceGroup", "myMonitor", armdynatrace.LinkableEnvironmentRequest{ - Region: to.Ptr("East US"), - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - UserPrincipal: to.Ptr("alice@microsoft.com"), - }, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LinkableEnvironmentListResponse = armdynatrace.LinkableEnvironmentListResponse{ - // Value: []*armdynatrace.LinkableEnvironmentResponse{ - // { - // EnvironmentID: to.Ptr("abc.123"), - // EnvironmentName: to.Ptr("myEnv"), - // PlanData: &armdynatrace.PlanData{ - // BillingCycle: to.Ptr("Monthly"), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t}()), - // PlanDetails: to.Ptr("dynatraceapitestplan"), - // UsageType: to.Ptr("Committed"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Monitors_ListLinkableEnvironments_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListLinkableEnvironmentsPager_monitorsListLinkableEnvironmentsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListLinkableEnvironmentsPager("myResourceGroup", "myMonitor", armdynatrace.LinkableEnvironmentRequest{}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LinkableEnvironmentListResponse = armdynatrace.LinkableEnvironmentListResponse{ - // } - } -} diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/operations_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/operations_client.go index bc50df35ca9c..eae7da55af50 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/operations_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for Dynatrace.Observability // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/operations_client_example_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/operations_client_example_test.go deleted file mode 100644 index b9f92907218f..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/operations_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdynatrace_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armdynatrace.OperationListResult{ - // Value: []*armdynatrace.Operation{ - // { - // Name: to.Ptr("Dynatrace.Observability/monitors/write"), - // ActionType: to.Ptr(armdynatrace.ActionTypeInternal), - // Display: &armdynatrace.OperationDisplay{ - // Description: to.Ptr("Write monitors resource"), - // Operation: to.Ptr("write"), - // Provider: to.Ptr("Dynatrace.Observability"), - // Resource: to.Ptr("monitors"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armdynatrace.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armdynatrace.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/response_types.go b/sdk/resourcemanager/dynatrace/armdynatrace/response_types.go index f8d27e7038ce..8ae01c90fe5f 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/response_types.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/response_types.go @@ -19,9 +19,14 @@ type MonitorsClientDeleteResponse struct { // placeholder for future response values } -// MonitorsClientGetAccountCredentialsResponse contains the response from method MonitorsClient.GetAccountCredentials. -type MonitorsClientGetAccountCredentialsResponse struct { - AccountInfoSecure +// MonitorsClientGetMarketplaceSaaSResourceDetailsResponse contains the response from method MonitorsClient.GetMarketplaceSaaSResourceDetails. +type MonitorsClientGetMarketplaceSaaSResourceDetailsResponse struct { + MarketplaceSaaSResourceDetailsResponse +} + +// MonitorsClientGetMetricStatusResponse contains the response from method MonitorsClient.GetMetricStatus. +type MonitorsClientGetMetricStatusResponse struct { + MetricsStatusResponse } // MonitorsClientGetResponse contains the response from method MonitorsClient.Get. @@ -113,8 +118,3 @@ type TagRulesClientGetResponse struct { type TagRulesClientListResponse struct { TagRuleListResult } - -// TagRulesClientUpdateResponse contains the response from method TagRulesClient.Update. -type TagRulesClientUpdateResponse struct { - TagRule -} diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client.go index 44c1389e0419..eb3c20f88a57 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client.go @@ -47,7 +47,7 @@ func NewSingleSignOnClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create a DynatraceSingleSignOnResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - configurationName - Single Sign On Configuration Name @@ -71,7 +71,7 @@ func (client *SingleSignOnClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create a DynatraceSingleSignOnResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 func (client *SingleSignOnClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, resource SingleSignOnResource, options *SingleSignOnClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, configurationName, resource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *SingleSignOnClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -120,7 +120,7 @@ func (client *SingleSignOnClient) createOrUpdateCreateRequest(ctx context.Contex // Get - Get a DynatraceSingleSignOnResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - configurationName - Single Sign On Configuration Name @@ -164,7 +164,7 @@ func (client *SingleSignOnClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *SingleSignOnClient) getHandleResponse(resp *http.Response) (Single // NewListPager - List all DynatraceSingleSignOnResource by monitorName // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - SingleSignOnClientListOptions contains the optional parameters for the SingleSignOnClient.NewListPager method. @@ -233,7 +233,7 @@ func (client *SingleSignOnClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client_example_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client_example_test.go deleted file mode 100644 index 858606ad4812..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdynatrace_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_CreateOrUpdate_MaximumSet_Gen.json -func ExampleSingleSignOnClient_BeginCreateOrUpdate_singleSignOnCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSingleSignOnClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", armdynatrace.SingleSignOnResource{ - Properties: &armdynatrace.SingleSignOnProperties{ - AADDomains: []*string{ - to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateAccepted), - SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - SingleSignOnURL: to.Ptr("https://www.dynatrace.io"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SingleSignOnResource = armdynatrace.SingleSignOnResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/singleSignOnConfigurations/default"), - // Properties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_CreateOrUpdate_MinimumSet_Gen.json -func ExampleSingleSignOnClient_BeginCreateOrUpdate_singleSignOnCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSingleSignOnClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", armdynatrace.SingleSignOnResource{ - Properties: &armdynatrace.SingleSignOnProperties{ - AADDomains: []*string{ - to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - SingleSignOnURL: to.Ptr("https://www.dynatrace.io"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SingleSignOnResource = armdynatrace.SingleSignOnResource{ - // Properties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_Get_MaximumSet_Gen.json -func ExampleSingleSignOnClient_Get_singleSignOnGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSingleSignOnClient().Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SingleSignOnResource = armdynatrace.SingleSignOnResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/singleSignOnConfigurations/default"), - // Properties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_Get_MinimumSet_Gen.json -func ExampleSingleSignOnClient_Get_singleSignOnGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSingleSignOnClient().Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SingleSignOnResource = armdynatrace.SingleSignOnResource{ - // Properties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_List_MaximumSet_Gen.json -func ExampleSingleSignOnClient_NewListPager_singleSignOnListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSingleSignOnClient().NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SingleSignOnResourceListResult = armdynatrace.SingleSignOnResourceListResult{ - // Value: []*armdynatrace.SingleSignOnResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/singleSignOnConfigurations/default"), - // Properties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/SingleSignOn_List_MinimumSet_Gen.json -func ExampleSingleSignOnClient_NewListPager_singleSignOnListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSingleSignOnClient().NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SingleSignOnResourceListResult = armdynatrace.SingleSignOnResourceListResult{ - // Value: []*armdynatrace.SingleSignOnResource{ - // { - // Properties: &armdynatrace.SingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - // SingleSignOnURL: to.Ptr("https://www.dynatrace.io/IAmSomeHash"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client.go index 412633743421..8c877cb59d9e 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client.go @@ -47,7 +47,7 @@ func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Monitor resource name @@ -71,7 +71,7 @@ func (client *TagRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 func (client *TagRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, resource TagRule, options *TagRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, resource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -120,7 +120,7 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Monitor resource name @@ -142,7 +142,7 @@ func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 func (client *TagRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Monitor resource name @@ -235,7 +235,7 @@ func (client *TagRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *TagRulesClient) getHandleResponse(resp *http.Response) (TagRulesCl // NewListPager - List all TagRule by monitorName // -// Generated from API version 2021-09-01 +// Generated from API version 2023-04-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - TagRulesClientListOptions contains the optional parameters for the TagRulesClient.NewListPager method. @@ -304,7 +304,7 @@ func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2023-04-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,66 +318,3 @@ func (client *TagRulesClient) listHandleResponse(resp *http.Response) (TagRulesC } return result, nil } - -// Update - Update a TagRule -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-09-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - monitorName - Monitor resource name -// - ruleSetName - Monitor resource name -// - resource - The resource properties to be updated. -// - options - TagRulesClientUpdateOptions contains the optional parameters for the TagRulesClient.Update method. -func (client *TagRulesClient) Update(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, resource TagRuleUpdate, options *TagRulesClientUpdateOptions) (TagRulesClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, resource, options) - if err != nil { - return TagRulesClientUpdateResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TagRulesClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagRulesClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *TagRulesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, resource TagRuleUpdate, options *TagRulesClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if monitorName == "" { - return nil, errors.New("parameter monitorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) - if ruleSetName == "" { - return nil, errors.New("parameter ruleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleSetName}", url.PathEscape(ruleSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) -} - -// updateHandleResponse handles the Update response. -func (client *TagRulesClient) updateHandleResponse(resp *http.Response) (TagRulesClientUpdateResponse, error) { - result := TagRulesClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TagRule); err != nil { - return TagRulesClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client_example_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client_example_test.go deleted file mode 100644 index a62178e2eada..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client_example_test.go +++ /dev/null @@ -1,476 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdynatrace_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Get_MaximumSet_Gen.json -func ExampleTagRulesClient_Get_tagRulesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TagRule = armdynatrace.TagRule{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default"), - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // LogRules: &armdynatrace.LogRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armdynatrace.MetricRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }}, - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Get_MinimumSet_Gen.json -func ExampleTagRulesClient_Get_tagRulesGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TagRule = armdynatrace.TagRule{ - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json -func ExampleTagRulesClient_BeginCreateOrUpdate_tagRulesCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", armdynatrace.TagRule{ - Properties: &armdynatrace.MonitoringTagRulesProperties{ - LogRules: &armdynatrace.LogRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }, - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionExclude), - Value: to.Ptr("Dev"), - }}, - SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - }, - MetricRules: &armdynatrace.MetricRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }}, - }, - ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TagRule = armdynatrace.TagRule{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default"), - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // LogRules: &armdynatrace.LogRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armdynatrace.MetricRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }}, - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json -func ExampleTagRulesClient_BeginCreateOrUpdate_tagRulesCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", armdynatrace.TagRule{ - Properties: &armdynatrace.MonitoringTagRulesProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TagRule = armdynatrace.TagRule{ - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Update_MaximumSet_Gen.json -func ExampleTagRulesClient_Update_tagRulesUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Update(ctx, "myResourceGroup", "myMonitor", "default", armdynatrace.TagRuleUpdate{ - LogRules: &armdynatrace.LogRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }, - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionExclude), - Value: to.Ptr("Dev"), - }}, - SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - }, - MetricRules: &armdynatrace.MetricRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TagRule = armdynatrace.TagRule{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default"), - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // LogRules: &armdynatrace.LogRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armdynatrace.MetricRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }}, - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Update_MinimumSet_Gen.json -func ExampleTagRulesClient_Update_tagRulesUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Update(ctx, "myResourceGroup", "myMonitor", "default", armdynatrace.TagRuleUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TagRule = armdynatrace.TagRule{ - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Delete_MaximumSet_Gen.json -func ExampleTagRulesClient_BeginDelete_tagRulesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginDelete(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_Delete_MinimumSet_Gen.json -func ExampleTagRulesClient_BeginDelete_tagRulesDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginDelete(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_List_MaximumSet_Gen.json -func ExampleTagRulesClient_NewListPager_tagRulesListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTagRulesClient().NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TagRuleListResult = armdynatrace.TagRuleListResult{ - // Value: []*armdynatrace.TagRule{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Dynatrace.Observability/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Dynatrace.Observability/monitors/myMonitor/tagRules/default"), - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // LogRules: &armdynatrace.LogRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armdynatrace.MetricRules{ - // FilteringTags: []*armdynatrace.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdynatrace.TagActionInclude), - // Value: to.Ptr("Prod"), - // }}, - // }, - // ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateSucceeded), - // }, - // SystemData: &armdynatrace.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // CreatedBy: to.Ptr("alice@microsoft.com"), - // CreatedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-16T04:25:21.040Z"); return t}()), - // LastModifiedBy: to.Ptr("alice@microsoft.com"), - // LastModifiedByType: to.Ptr(armdynatrace.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/TagRules_List_MinimumSet_Gen.json -func ExampleTagRulesClient_NewListPager_tagRulesListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdynatrace.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTagRulesClient().NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TagRuleListResult = armdynatrace.TagRuleListResult{ - // Value: []*armdynatrace.TagRule{ - // { - // Properties: &armdynatrace.MonitoringTagRulesProperties{ - // }, - // }}, - // } - } -}