diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md b/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md index e8021004c053..f449c7687c52 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/CHANGELOG.md @@ -1,5 +1,25 @@ # Release History +## 2.0.0 (2024-09-05) +### Breaking Changes + +- Type of `OutputProperties.SizeWindow` has been changed from `*float32` to `*int32` + +### Features Added + +- New function `*FileReferenceInputDataSource.GetReferenceInputDataSource() *ReferenceInputDataSource` +- New function `*GatewayMessageBusOutputDataSource.GetOutputDataSource() *OutputDataSource` +- New function `*GatewayMessageBusStreamInputDataSource.GetStreamInputDataSource() *StreamInputDataSource` +- New struct `FileReferenceInputDataSource` +- New struct `FileReferenceInputDataSourceProperties` +- New struct `GatewayMessageBusOutputDataSource` +- New struct `GatewayMessageBusOutputDataSourceProperties` +- New struct `GatewayMessageBusSourceProperties` +- New struct `GatewayMessageBusStreamInputDataSource` +- New struct `GatewayMessageBusStreamInputDataSourceProperties` +- New field `BlobPathPrefix` in struct `BlobOutputDataSourceProperties` + + ## 2.0.0-beta.1 (2024-01-26) ### Breaking Changes diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md b/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md index 9b204ba4c462..c9bd29c0bc63 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 -tag: package-2021-10-preview +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/client_factory.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/client_factory.go index e8badf6de4e6..c21336c76aeb 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/client_factory.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,72 +26,83 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewClustersClient creates a new instance of ClustersClient. func (c *ClientFactory) NewClustersClient() *ClustersClient { - subClient, _ := NewClustersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ClustersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewFunctionsClient creates a new instance of FunctionsClient. func (c *ClientFactory) NewFunctionsClient() *FunctionsClient { - subClient, _ := NewFunctionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FunctionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewInputsClient creates a new instance of InputsClient. func (c *ClientFactory) NewInputsClient() *InputsClient { - subClient, _ := NewInputsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &InputsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewOutputsClient creates a new instance of OutputsClient. func (c *ClientFactory) NewOutputsClient() *OutputsClient { - subClient, _ := NewOutputsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &OutputsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateEndpointsClient creates a new instance of PrivateEndpointsClient. func (c *ClientFactory) NewPrivateEndpointsClient() *PrivateEndpointsClient { - subClient, _ := NewPrivateEndpointsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -// NewSKUClient creates a new instance of SKUClient. -func (c *ClientFactory) NewSKUClient() *SKUClient { - subClient, _ := NewSKUClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewStreamingJobsClient creates a new instance of StreamingJobsClient. func (c *ClientFactory) NewStreamingJobsClient() *StreamingJobsClient { - subClient, _ := NewStreamingJobsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &StreamingJobsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSubscriptionsClient creates a new instance of SubscriptionsClient. func (c *ClientFactory) NewSubscriptionsClient() *SubscriptionsClient { - subClient, _ := NewSubscriptionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SubscriptionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewTransformationsClient creates a new instance of TransformationsClient. func (c *ClientFactory) NewTransformationsClient() *TransformationsClient { - subClient, _ := NewTransformationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &TransformationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client.go index cc887b189563..de954438d013 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client.go @@ -46,7 +46,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates a Stream Analytics Cluster or replaces an already existing cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - cluster - The definition of the cluster that will be used to create a new cluster or replace the existing one. @@ -72,7 +72,7 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates a Stream Analytics Cluster or replaces an already existing cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginCreateOrUpdate" @@ -114,15 +114,15 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cluster); err != nil { return nil, err } @@ -132,7 +132,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -156,7 +156,7 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginDelete" @@ -198,7 +198,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +207,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets information about the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. @@ -253,7 +253,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // NewListByResourceGroupPager - Lists all of the clusters in the given resource group. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists all of the clusters in the given subscription. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - options - ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.NewListBySubscriptionPager // method. func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClientListBySubscriptionOptions) *runtime.Pager[ClustersClientListBySubscriptionResponse] { @@ -368,7 +368,7 @@ func (client *ClustersClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *ClustersClient) listBySubscriptionHandleResponse(resp *http.Respon // NewListStreamingJobsPager - Lists all of the streaming jobs in the given cluster. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientListStreamingJobsOptions contains the optional parameters for the ClustersClient.NewListStreamingJobsPager @@ -433,7 +433,7 @@ func (client *ClustersClient) listStreamingJobsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -452,7 +452,7 @@ func (client *ClustersClient) listStreamingJobsHandleResponse(resp *http.Respons // without affecting the rest of the cluster definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - cluster - The properties specified here will overwrite the corresponding properties in the existing cluster (ie. Those @@ -479,7 +479,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // without affecting the rest of the cluster definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginUpdate" @@ -521,12 +521,12 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cluster); err != nil { return nil, err } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client_example_test.go deleted file mode 100644 index 0c7d34724508..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/clusters_client_example_test.go +++ /dev/null @@ -1,365 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_Create.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateOrUpdate(ctx, "sjrg", "An Example Cluster", armstreamanalytics.Cluster{ - Location: to.Ptr("North US"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - SKU: &armstreamanalytics.ClusterSKU{ - Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - Capacity: to.Ptr[int32](48), - }, - }, &armstreamanalytics.ClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: 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.Cluster = armstreamanalytics.Cluster{ - // Name: to.Ptr("An Example Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/AnExampleStreamingCluster"), - // Location: to.Ptr("North US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](0), - // CapacityAssigned: to.Ptr[int32](0), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](48), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_Update.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "sjrg", "testcluster", armstreamanalytics.Cluster{ - Location: to.Ptr("Central US"), - SKU: &armstreamanalytics.ClusterSKU{ - Capacity: to.Ptr[int32](96), - }, - }, &armstreamanalytics.ClustersClientBeginUpdateOptions{IfMatch: 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.Cluster = armstreamanalytics.Cluster{ - // Name: to.Ptr("An Example Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/AnExampleStreamingCluster"), - // Location: to.Ptr("Central US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](36), - // CapacityAssigned: to.Ptr[int32](48), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](96), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_Get.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "sjrg", "testcluster", 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.Cluster = armstreamanalytics.Cluster{ - // Name: to.Ptr("An Example Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/AnExampleStreamingCluster"), - // Location: to.Ptr("Central US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](48), - // CapacityAssigned: to.Ptr[int32](96), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](96), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_Delete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "sjrg", "testcluster", 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_ListBySubscription.json -func ExampleClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListBySubscriptionPager(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.ClusterListResult = armstreamanalytics.ClusterListResult{ - // Value: []*armstreamanalytics.Cluster{ - // { - // Name: to.Ptr("An Example Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/AnExampleStreamingCluster"), - // Location: to.Ptr("Central US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](48), - // CapacityAssigned: to.Ptr[int32](96), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](96), - // }, - // }, - // { - // Name: to.Ptr("A Different Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/ADifferentStreamingCluster"), - // Location: to.Ptr("Central US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("G97C0C81-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](48), - // CapacityAssigned: to.Ptr[int32](96), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](96), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_ListByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("sjrg", 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.ClusterListResult = armstreamanalytics.ClusterListResult{ - // Value: []*armstreamanalytics.Cluster{ - // { - // Name: to.Ptr("An Example Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/AnExampleStreamingCluster"), - // Location: to.Ptr("Central US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](48), - // CapacityAssigned: to.Ptr[int32](96), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](96), - // }, - // }, - // { - // Name: to.Ptr("A Different Cluster"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/ADifferentStreamingCluster"), - // Location: to.Ptr("Central US"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Etag: to.Ptr("G97C0C81-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.ClusterProperties{ - // CapacityAllocated: to.Ptr[int32](48), - // CapacityAssigned: to.Ptr[int32](96), - // ClusterID: to.Ptr("B01C67EF-4739-4DDD-9FB2-427EB43DE839"), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-25T01:00:00.000Z"); return t}()), - // ProvisioningState: to.Ptr(armstreamanalytics.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armstreamanalytics.ClusterSKU{ - // Name: to.Ptr(armstreamanalytics.ClusterSKUNameDefault), - // Capacity: to.Ptr[int32](96), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/Cluster_ListStreamingJobs.json -func ExampleClustersClient_NewListStreamingJobsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListStreamingJobsPager("sjrg", "testcluster", 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.ClusterJobListResult = armstreamanalytics.ClusterJobListResult{ - // Value: []*armstreamanalytics.ClusterJob{ - // { - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/microsoft.streamAnalytics/streamingjobs/AFilterSample"), - // JobState: to.Ptr(armstreamanalytics.JobStateRunning), - // StreamingUnits: to.Ptr[int32](6), - // }, - // { - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/microsoft.streamAnalytics/streamingjobs/AnotherFilterSample"), - // JobState: to.Ptr(armstreamanalytics.JobStateStopped), - // StreamingUnits: to.Ptr[int32](1), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/constants.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/constants.go index d77fd7538bc4..bbc193df828e 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/constants.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/constants.go @@ -10,7 +10,7 @@ package armstreamanalytics const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0" ) // AuthenticationMode - Authentication Mode. Valid modes are ConnectionString, Msi and 'UserToken'. @@ -31,22 +31,6 @@ func PossibleAuthenticationModeValues() []AuthenticationMode { } } -// BlobWriteMode - Determines whether blob blocks are either committed automatically or appended. -type BlobWriteMode string - -const ( - BlobWriteModeAppend BlobWriteMode = "Append" - BlobWriteModeOnce BlobWriteMode = "Once" -) - -// PossibleBlobWriteModeValues returns the possible values for the BlobWriteMode const type. -func PossibleBlobWriteModeValues() []BlobWriteMode { - return []BlobWriteMode{ - BlobWriteModeAppend, - BlobWriteModeOnce, - } -} - // ClusterProvisioningState - The status of the cluster provisioning. The three terminal states are: Succeeded, Failed and // Canceled type ClusterProvisioningState string @@ -153,33 +137,15 @@ func PossibleEncodingValues() []Encoding { } } -// EventGridEventSchemaType - Supported Event Grid schema types. -type EventGridEventSchemaType string - -const ( - EventGridEventSchemaTypeCloudEventSchema EventGridEventSchemaType = "CloudEventSchema" - EventGridEventSchemaTypeEventGridEventSchema EventGridEventSchemaType = "EventGridEventSchema" -) - -// PossibleEventGridEventSchemaTypeValues returns the possible values for the EventGridEventSchemaType const type. -func PossibleEventGridEventSchemaTypeValues() []EventGridEventSchemaType { - return []EventGridEventSchemaType{ - EventGridEventSchemaTypeCloudEventSchema, - EventGridEventSchemaTypeEventGridEventSchema, - } -} - // EventSerializationType - Indicates the type of serialization that the input or output uses. Required on PUT (CreateOrReplace) // requests. type EventSerializationType string const ( - EventSerializationTypeAvro EventSerializationType = "Avro" - EventSerializationTypeCSV EventSerializationType = "Csv" - EventSerializationTypeCustomClr EventSerializationType = "CustomClr" - EventSerializationTypeDelta EventSerializationType = "Delta" - EventSerializationTypeJSON EventSerializationType = "Json" - EventSerializationTypeParquet EventSerializationType = "Parquet" + EventSerializationTypeAvro EventSerializationType = "Avro" + EventSerializationTypeCSV EventSerializationType = "Csv" + EventSerializationTypeJSON EventSerializationType = "Json" + EventSerializationTypeParquet EventSerializationType = "Parquet" ) // PossibleEventSerializationTypeValues returns the possible values for the EventSerializationType const type. @@ -187,8 +153,6 @@ func PossibleEventSerializationTypeValues() []EventSerializationType { return []EventSerializationType{ EventSerializationTypeAvro, EventSerializationTypeCSV, - EventSerializationTypeCustomClr, - EventSerializationTypeDelta, EventSerializationTypeJSON, EventSerializationTypeParquet, } @@ -210,22 +174,6 @@ func PossibleEventsOutOfOrderPolicyValues() []EventsOutOfOrderPolicy { } } -// InputWatermarkMode - The input watermark mode. -type InputWatermarkMode string - -const ( - InputWatermarkModeNone InputWatermarkMode = "None" - InputWatermarkModeReadWatermark InputWatermarkMode = "ReadWatermark" -) - -// PossibleInputWatermarkModeValues returns the possible values for the InputWatermarkMode const type. -func PossibleInputWatermarkModeValues() []InputWatermarkMode { - return []InputWatermarkMode{ - InputWatermarkModeNone, - InputWatermarkModeReadWatermark, - } -} - // JSONOutputSerializationFormat - Specifies the format of the JSON the output will be written in. The currently supported // values are 'lineSeparated' indicating the output will be formatted by having each JSON object separated by a new // line and 'array' indicating the output will be formatted as an array of JSON objects. @@ -339,54 +287,6 @@ func PossibleOutputStartModeValues() []OutputStartMode { } } -// OutputWatermarkMode - The output watermark mode. -type OutputWatermarkMode string - -const ( - OutputWatermarkModeNone OutputWatermarkMode = "None" - OutputWatermarkModeSendCurrentPartitionWatermark OutputWatermarkMode = "SendCurrentPartitionWatermark" - OutputWatermarkModeSendLowestWatermarkAcrossPartitions OutputWatermarkMode = "SendLowestWatermarkAcrossPartitions" -) - -// PossibleOutputWatermarkModeValues returns the possible values for the OutputWatermarkMode const type. -func PossibleOutputWatermarkModeValues() []OutputWatermarkMode { - return []OutputWatermarkMode{ - OutputWatermarkModeNone, - OutputWatermarkModeSendCurrentPartitionWatermark, - OutputWatermarkModeSendLowestWatermarkAcrossPartitions, - } -} - -// QueryTestingResultStatus - The status of the query testing request. -type QueryTestingResultStatus string - -const ( - // QueryTestingResultStatusCompilerError - The query testing operation failed due to a compiler error. - QueryTestingResultStatusCompilerError QueryTestingResultStatus = "CompilerError" - // QueryTestingResultStatusRuntimeError - The query testing operation failed due to a runtime error. - QueryTestingResultStatusRuntimeError QueryTestingResultStatus = "RuntimeError" - // QueryTestingResultStatusStarted - The query testing operation was initiated. - QueryTestingResultStatusStarted QueryTestingResultStatus = "Started" - // QueryTestingResultStatusSuccess - The query testing operation succeeded. - QueryTestingResultStatusSuccess QueryTestingResultStatus = "Success" - // QueryTestingResultStatusTimeout - The query testing operation failed due to a timeout. - QueryTestingResultStatusTimeout QueryTestingResultStatus = "Timeout" - // QueryTestingResultStatusUnknownError - The query testing operation failed due to an unknown error . - QueryTestingResultStatusUnknownError QueryTestingResultStatus = "UnknownError" -) - -// PossibleQueryTestingResultStatusValues returns the possible values for the QueryTestingResultStatus const type. -func PossibleQueryTestingResultStatusValues() []QueryTestingResultStatus { - return []QueryTestingResultStatus{ - QueryTestingResultStatusCompilerError, - QueryTestingResultStatusRuntimeError, - QueryTestingResultStatusStarted, - QueryTestingResultStatusSuccess, - QueryTestingResultStatusTimeout, - QueryTestingResultStatusUnknownError, - } -} - // RefreshType - Indicates the type of data refresh option. type RefreshType string @@ -405,41 +305,6 @@ func PossibleRefreshTypeValues() []RefreshType { } } -// ResourceType - The type of resource the SKU applies to. -type ResourceType string - -const ( - ResourceTypeMicrosoftStreamAnalyticsStreamingjobs ResourceType = "Microsoft.StreamAnalytics/streamingjobs" -) - -// PossibleResourceTypeValues returns the possible values for the ResourceType const type. -func PossibleResourceTypeValues() []ResourceType { - return []ResourceType{ - ResourceTypeMicrosoftStreamAnalyticsStreamingjobs, - } -} - -// SKUCapacityScaleType - The scale type applicable to the SKU. -type SKUCapacityScaleType string - -const ( - // SKUCapacityScaleTypeAutomatic - Supported scale type automatic. - SKUCapacityScaleTypeAutomatic SKUCapacityScaleType = "automatic" - // SKUCapacityScaleTypeManual - Supported scale type manual. - SKUCapacityScaleTypeManual SKUCapacityScaleType = "manual" - // SKUCapacityScaleTypeNone - Scaling not supported. - SKUCapacityScaleTypeNone SKUCapacityScaleType = "none" -) - -// PossibleSKUCapacityScaleTypeValues returns the possible values for the SKUCapacityScaleType const type. -func PossibleSKUCapacityScaleTypeValues() []SKUCapacityScaleType { - return []SKUCapacityScaleType{ - SKUCapacityScaleTypeAutomatic, - SKUCapacityScaleTypeManual, - SKUCapacityScaleTypeNone, - } -} - // SKUName - The name of the SKU. Required on PUT (CreateOrReplace) requests. type SKUName string @@ -453,74 +318,3 @@ func PossibleSKUNameValues() []SKUName { SKUNameStandard, } } - -// SampleInputResultStatus - The status of the sample input request. -type SampleInputResultStatus string - -const ( - // SampleInputResultStatusErrorConnectingToInput - The sample input operation failed to connect to the input. - SampleInputResultStatusErrorConnectingToInput SampleInputResultStatus = "ErrorConnectingToInput" - // SampleInputResultStatusNoEventsFoundInRange - The sample input operation found no events in the range. - SampleInputResultStatusNoEventsFoundInRange SampleInputResultStatus = "NoEventsFoundInRange" - // SampleInputResultStatusReadAllEventsInRange - The sample input operation successfully read all the events in the range. - SampleInputResultStatusReadAllEventsInRange SampleInputResultStatus = "ReadAllEventsInRange" -) - -// PossibleSampleInputResultStatusValues returns the possible values for the SampleInputResultStatus const type. -func PossibleSampleInputResultStatusValues() []SampleInputResultStatus { - return []SampleInputResultStatus{ - SampleInputResultStatusErrorConnectingToInput, - SampleInputResultStatusNoEventsFoundInRange, - SampleInputResultStatusReadAllEventsInRange, - } -} - -// TestDatasourceResultStatus - The status of the test input or output request. -type TestDatasourceResultStatus string - -const ( - // TestDatasourceResultStatusTestFailed - The test datasource operation failed. - TestDatasourceResultStatusTestFailed TestDatasourceResultStatus = "TestFailed" - // TestDatasourceResultStatusTestSucceeded - The test datasource operation succeeded. - TestDatasourceResultStatusTestSucceeded TestDatasourceResultStatus = "TestSucceeded" -) - -// PossibleTestDatasourceResultStatusValues returns the possible values for the TestDatasourceResultStatus const type. -func PossibleTestDatasourceResultStatusValues() []TestDatasourceResultStatus { - return []TestDatasourceResultStatus{ - TestDatasourceResultStatusTestFailed, - TestDatasourceResultStatusTestSucceeded, - } -} - -// UpdatableUdfRefreshType - This property indicates which data refresh option to use, Blocking or Nonblocking. -type UpdatableUdfRefreshType string - -const ( - UpdatableUdfRefreshTypeBlocking UpdatableUdfRefreshType = "Blocking" - UpdatableUdfRefreshTypeNonblocking UpdatableUdfRefreshType = "Nonblocking" -) - -// PossibleUpdatableUdfRefreshTypeValues returns the possible values for the UpdatableUdfRefreshType const type. -func PossibleUpdatableUdfRefreshTypeValues() []UpdatableUdfRefreshType { - return []UpdatableUdfRefreshType{ - UpdatableUdfRefreshTypeBlocking, - UpdatableUdfRefreshTypeNonblocking, - } -} - -// UpdateMode - Refresh modes for Stream Analytics functions. -type UpdateMode string - -const ( - UpdateModeRefreshable UpdateMode = "Refreshable" - UpdateModeStatic UpdateMode = "Static" -) - -// PossibleUpdateModeValues returns the possible values for the UpdateMode const type. -func PossibleUpdateModeValues() []UpdateMode { - return []UpdateMode{ - UpdateModeRefreshable, - UpdateModeStatic, - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/polymorphic_helpers.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/polymorphic_helpers.go index 4256115057ec..8edf5f417bf0 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/polymorphic_helpers.go @@ -14,7 +14,7 @@ import ( ) func unmarshalFunctionRetrieveDefaultDefinitionParametersClassification(rawMsg json.RawMessage) (armstreamanalytics.FunctionRetrieveDefaultDefinitionParametersClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -24,11 +24,7 @@ func unmarshalFunctionRetrieveDefaultDefinitionParametersClassification(rawMsg j var b armstreamanalytics.FunctionRetrieveDefaultDefinitionParametersClassification switch m["bindingType"] { case "Microsoft.MachineLearning/WebService": - b = &armstreamanalytics.AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters{} - case "Microsoft.MachineLearningServices": - b = &armstreamanalytics.AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters{} - case "Microsoft.StreamAnalytics/CLRUdf": - b = &armstreamanalytics.CSharpFunctionRetrieveDefaultDefinitionParameters{} + b = &armstreamanalytics.AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters{} case "Microsoft.StreamAnalytics/JavascriptUdf": b = &armstreamanalytics.JavaScriptFunctionRetrieveDefaultDefinitionParameters{} default: diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/server_factory.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/server_factory.go index 9e139ddd0243..9440af05117b 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/server_factory.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/server_factory.go @@ -25,7 +25,6 @@ type ServerFactory struct { OperationsServer OperationsServer OutputsServer OutputsServer PrivateEndpointsServer PrivateEndpointsServer - SKUServer SKUServer StreamingJobsServer StreamingJobsServer SubscriptionsServer SubscriptionsServer TransformationsServer TransformationsServer @@ -51,7 +50,6 @@ type ServerFactoryTransport struct { trOperationsServer *OperationsServerTransport trOutputsServer *OutputsServerTransport trPrivateEndpointsServer *PrivateEndpointsServerTransport - trSKUServer *SKUServerTransport trStreamingJobsServer *StreamingJobsServerTransport trSubscriptionsServer *SubscriptionsServerTransport trTransformationsServer *TransformationsServerTransport @@ -90,9 +88,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPrivateEndpointsServerTransport(&s.srv.PrivateEndpointsServer) }) resp, err = s.trPrivateEndpointsServer.Do(req) - case "SKUClient": - initServer(s, &s.trSKUServer, func() *SKUServerTransport { return NewSKUServerTransport(&s.srv.SKUServer) }) - resp, err = s.trSKUServer.Do(req) case "StreamingJobsClient": initServer(s, &s.trStreamingJobsServer, func() *StreamingJobsServerTransport { return NewStreamingJobsServerTransport(&s.srv.StreamingJobsServer) diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/sku_server.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/sku_server.go deleted file mode 100644 index 52c0c9053034..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/sku_server.go +++ /dev/null @@ -1,112 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics/v2" - "net/http" - "net/url" - "regexp" -) - -// SKUServer is a fake server for instances of the armstreamanalytics.SKUClient type. -type SKUServer struct { - // NewListPager is the fake for method SKUClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, jobName string, options *armstreamanalytics.SKUClientListOptions) (resp azfake.PagerResponder[armstreamanalytics.SKUClientListResponse]) -} - -// NewSKUServerTransport creates a new instance of SKUServerTransport with the provided implementation. -// The returned SKUServerTransport instance is connected to an instance of armstreamanalytics.SKUClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewSKUServerTransport(srv *SKUServer) *SKUServerTransport { - return &SKUServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armstreamanalytics.SKUClientListResponse]](), - } -} - -// SKUServerTransport connects instances of armstreamanalytics.SKUClient to instances of SKUServer. -// Don't use this type directly, use NewSKUServerTransport instead. -type SKUServerTransport struct { - srv *SKUServer - newListPager *tracker[azfake.PagerResponder[armstreamanalytics.SKUClientListResponse]] -} - -// Do implements the policy.Transporter interface for SKUServerTransport. -func (s *SKUServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "SKUClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *SKUServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := s.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StreamAnalytics/streamingjobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - resp := s.srv.NewListPager(resourceGroupNameParam, jobNameParam, nil) - newListPager = &resp - s.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armstreamanalytics.SKUClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - s.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - s.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/subscriptions_server.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/subscriptions_server.go index 72038ab92951..cefd2ab5f9b1 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/subscriptions_server.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/subscriptions_server.go @@ -23,52 +23,22 @@ import ( // SubscriptionsServer is a fake server for instances of the armstreamanalytics.SubscriptionsClient type. type SubscriptionsServer struct { - // CompileQuery is the fake for method SubscriptionsClient.CompileQuery - // HTTP status codes to indicate success: http.StatusOK - CompileQuery func(ctx context.Context, location string, compileQuery armstreamanalytics.CompileQuery, options *armstreamanalytics.SubscriptionsClientCompileQueryOptions) (resp azfake.Responder[armstreamanalytics.SubscriptionsClientCompileQueryResponse], errResp azfake.ErrorResponder) - // ListQuotas is the fake for method SubscriptionsClient.ListQuotas // HTTP status codes to indicate success: http.StatusOK ListQuotas func(ctx context.Context, location string, options *armstreamanalytics.SubscriptionsClientListQuotasOptions) (resp azfake.Responder[armstreamanalytics.SubscriptionsClientListQuotasResponse], errResp azfake.ErrorResponder) - - // BeginSampleInput is the fake for method SubscriptionsClient.BeginSampleInput - // HTTP status codes to indicate success: http.StatusAccepted - BeginSampleInput func(ctx context.Context, location string, sampleInput armstreamanalytics.SampleInput, options *armstreamanalytics.SubscriptionsClientBeginSampleInputOptions) (resp azfake.PollerResponder[armstreamanalytics.SubscriptionsClientSampleInputResponse], errResp azfake.ErrorResponder) - - // BeginTestInput is the fake for method SubscriptionsClient.BeginTestInput - // HTTP status codes to indicate success: http.StatusAccepted - BeginTestInput func(ctx context.Context, location string, testInput armstreamanalytics.TestInput, options *armstreamanalytics.SubscriptionsClientBeginTestInputOptions) (resp azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestInputResponse], errResp azfake.ErrorResponder) - - // BeginTestOutput is the fake for method SubscriptionsClient.BeginTestOutput - // HTTP status codes to indicate success: http.StatusAccepted - BeginTestOutput func(ctx context.Context, location string, testOutput armstreamanalytics.TestOutput, options *armstreamanalytics.SubscriptionsClientBeginTestOutputOptions) (resp azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestOutputResponse], errResp azfake.ErrorResponder) - - // BeginTestQuery is the fake for method SubscriptionsClient.BeginTestQuery - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestQuery func(ctx context.Context, location string, testQuery armstreamanalytics.TestQuery, options *armstreamanalytics.SubscriptionsClientBeginTestQueryOptions) (resp azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestQueryResponse], errResp azfake.ErrorResponder) } // NewSubscriptionsServerTransport creates a new instance of SubscriptionsServerTransport with the provided implementation. // The returned SubscriptionsServerTransport instance is connected to an instance of armstreamanalytics.SubscriptionsClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSubscriptionsServerTransport(srv *SubscriptionsServer) *SubscriptionsServerTransport { - return &SubscriptionsServerTransport{ - srv: srv, - beginSampleInput: newTracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientSampleInputResponse]](), - beginTestInput: newTracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestInputResponse]](), - beginTestOutput: newTracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestOutputResponse]](), - beginTestQuery: newTracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestQueryResponse]](), - } + return &SubscriptionsServerTransport{srv: srv} } // SubscriptionsServerTransport connects instances of armstreamanalytics.SubscriptionsClient to instances of SubscriptionsServer. // Don't use this type directly, use NewSubscriptionsServerTransport instead. type SubscriptionsServerTransport struct { - srv *SubscriptionsServer - beginSampleInput *tracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientSampleInputResponse]] - beginTestInput *tracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestInputResponse]] - beginTestOutput *tracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestOutputResponse]] - beginTestQuery *tracker[azfake.PollerResponder[armstreamanalytics.SubscriptionsClientTestQueryResponse]] + srv *SubscriptionsServer } // Do implements the policy.Transporter interface for SubscriptionsServerTransport. @@ -83,18 +53,8 @@ func (s *SubscriptionsServerTransport) Do(req *http.Request) (*http.Response, er var err error switch method { - case "SubscriptionsClient.CompileQuery": - resp, err = s.dispatchCompileQuery(req) case "SubscriptionsClient.ListQuotas": resp, err = s.dispatchListQuotas(req) - case "SubscriptionsClient.BeginSampleInput": - resp, err = s.dispatchBeginSampleInput(req) - case "SubscriptionsClient.BeginTestInput": - resp, err = s.dispatchBeginTestInput(req) - case "SubscriptionsClient.BeginTestOutput": - resp, err = s.dispatchBeginTestOutput(req) - case "SubscriptionsClient.BeginTestQuery": - resp, err = s.dispatchBeginTestQuery(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -106,39 +66,6 @@ func (s *SubscriptionsServerTransport) Do(req *http.Request) (*http.Response, er return resp, nil } -func (s *SubscriptionsServerTransport) dispatchCompileQuery(req *http.Request) (*http.Response, error) { - if s.srv.CompileQuery == nil { - return nil, &nonRetriableError{errors.New("fake for method CompileQuery not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StreamAnalytics/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/compileQuery` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armstreamanalytics.CompileQuery](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.CompileQuery(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).QueryCompilationResult, req) - if err != nil { - return nil, err - } - return resp, nil -} - func (s *SubscriptionsServerTransport) dispatchListQuotas(req *http.Request) (*http.Response, error) { if s.srv.ListQuotas == nil { return nil, &nonRetriableError{errors.New("fake for method ListQuotas not implemented")} @@ -167,179 +94,3 @@ func (s *SubscriptionsServerTransport) dispatchListQuotas(req *http.Request) (*h } return resp, nil } - -func (s *SubscriptionsServerTransport) dispatchBeginSampleInput(req *http.Request) (*http.Response, error) { - if s.srv.BeginSampleInput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSampleInput not implemented")} - } - beginSampleInput := s.beginSampleInput.get(req) - if beginSampleInput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StreamAnalytics/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sampleInput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armstreamanalytics.SampleInput](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginSampleInput(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSampleInput = &respr - s.beginSampleInput.add(req, beginSampleInput) - } - - resp, err := server.PollerResponderNext(beginSampleInput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - s.beginSampleInput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSampleInput) { - s.beginSampleInput.remove(req) - } - - return resp, nil -} - -func (s *SubscriptionsServerTransport) dispatchBeginTestInput(req *http.Request) (*http.Response, error) { - if s.srv.BeginTestInput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginTestInput not implemented")} - } - beginTestInput := s.beginTestInput.get(req) - if beginTestInput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StreamAnalytics/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testInput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armstreamanalytics.TestInput](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginTestInput(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginTestInput = &respr - s.beginTestInput.add(req, beginTestInput) - } - - resp, err := server.PollerResponderNext(beginTestInput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - s.beginTestInput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginTestInput) { - s.beginTestInput.remove(req) - } - - return resp, nil -} - -func (s *SubscriptionsServerTransport) dispatchBeginTestOutput(req *http.Request) (*http.Response, error) { - if s.srv.BeginTestOutput == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginTestOutput not implemented")} - } - beginTestOutput := s.beginTestOutput.get(req) - if beginTestOutput == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StreamAnalytics/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testOutput` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armstreamanalytics.TestOutput](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginTestOutput(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginTestOutput = &respr - s.beginTestOutput.add(req, beginTestOutput) - } - - resp, err := server.PollerResponderNext(beginTestOutput, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - s.beginTestOutput.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginTestOutput) { - s.beginTestOutput.remove(req) - } - - return resp, nil -} - -func (s *SubscriptionsServerTransport) dispatchBeginTestQuery(req *http.Request) (*http.Response, error) { - if s.srv.BeginTestQuery == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginTestQuery not implemented")} - } - beginTestQuery := s.beginTestQuery.get(req) - if beginTestQuery == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StreamAnalytics/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testQuery` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armstreamanalytics.TestQuery](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginTestQuery(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginTestQuery = &respr - s.beginTestQuery.add(req, beginTestQuery) - } - - resp, err := server.PollerResponderNext(beginTestQuery, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - s.beginTestQuery.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginTestQuery) { - s.beginTestQuery.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/time_rfc3339.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/time_rfc3339.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client.go index 45fda22af73c..d9acfd5cafc3 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client.go @@ -46,7 +46,7 @@ func NewFunctionsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrReplace - Creates a function or replaces an already existing function under an existing streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - functionName - The name of the function. @@ -100,15 +100,15 @@ func (client *FunctionsClient) createOrReplaceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, function); err != nil { return nil, err } @@ -130,7 +130,7 @@ func (client *FunctionsClient) createOrReplaceHandleResponse(resp *http.Response // Delete - Deletes a function from the streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - functionName - The name of the function. @@ -180,7 +180,7 @@ func (client *FunctionsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *FunctionsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets details about the specified function. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - functionName - The name of the function. @@ -240,7 +240,7 @@ func (client *FunctionsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +260,7 @@ func (client *FunctionsClient) getHandleResponse(resp *http.Response) (Functions // NewListByStreamingJobPager - Lists all of the functions under the specified streaming job. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - FunctionsClientListByStreamingJobOptions contains the optional parameters for the FunctionsClient.NewListByStreamingJobPager @@ -311,7 +311,7 @@ func (client *FunctionsClient) listByStreamingJobCreateRequest(ctx context.Conte if options != nil && options.Select != nil { reqQP.Set("$select", *options.Select) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *FunctionsClient) listByStreamingJobHandleResponse(resp *http.Respo // RetrieveDefaultDefinition - Retrieves the default definition of a function based on the parameters specified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - functionName - The name of the function. @@ -381,7 +381,7 @@ func (client *FunctionsClient) retrieveDefaultDefinitionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.FunctionRetrieveDefaultDefinitionParameters != nil { @@ -407,7 +407,7 @@ func (client *FunctionsClient) retrieveDefaultDefinitionHandleResponse(resp *htt // syntactically correct. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - functionName - The name of the function. @@ -434,7 +434,7 @@ func (client *FunctionsClient) BeginTest(ctx context.Context, resourceGroupName // syntactically correct. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *FunctionsClient) test(ctx context.Context, resourceGroupName string, jobName string, functionName string, options *FunctionsClientBeginTestOptions) (*http.Response, error) { var err error const operationName = "FunctionsClient.BeginTest" @@ -480,7 +480,7 @@ func (client *FunctionsClient) testCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Function != nil { @@ -497,7 +497,7 @@ func (client *FunctionsClient) testCreateRequest(ctx context.Context, resourceGr // definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - functionName - The name of the function. @@ -552,12 +552,12 @@ func (client *FunctionsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, function); err != nil { return nil, err } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client_example_test.go deleted file mode 100644 index c4ec3e87ed2e..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/functions_client_example_test.go +++ /dev/null @@ -1,797 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Create_CSharp.json -func ExampleFunctionsClient_CreateOrReplace_createAClrUdfFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().CreateOrReplace(ctx, "sjrg", "sjName", "function588", armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.CSharpFunctionBinding{ - Type: to.Ptr("Microsoft.StreamAnalytics/CLRUdf"), - Properties: &armstreamanalytics.CSharpFunctionBindingProperties{ - Method: to.Ptr("SquareFunction"), - Class: to.Ptr("ASAEdgeUDFDemo.Class1"), - DllPath: to.Ptr("ASAEdgeApplication2_CodeBehind"), - UpdateMode: to.Ptr(armstreamanalytics.UpdateModeStatic), - }, - }, - Inputs: []*armstreamanalytics.FunctionInput{ - { - DataType: to.Ptr("nvarchar(max)"), - }}, - Output: &armstreamanalytics.FunctionOutput{ - DataType: to.Ptr("nvarchar(max)"), - }, - }, - }, - }, &armstreamanalytics.FunctionsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function588"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/functions/function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.CSharpFunctionBinding{ - // Type: to.Ptr("Microsoft.StreamAnalytics/CLRUdf"), - // Properties: &armstreamanalytics.CSharpFunctionBindingProperties{ - // Method: to.Ptr("SquareFunction"), - // Class: to.Ptr("ASAEdgeUDFDemo.Class1"), - // DllPath: to.Ptr("ASAEdgeApplication2_CodeBehind"), - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Create_JavaScript.json -func ExampleFunctionsClient_CreateOrReplace_createAJavaScriptFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().CreateOrReplace(ctx, "sjrg1637", "sj8653", "function8197", armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - Script: to.Ptr("function (x, y) { return x + y; }"), - }, - }, - Inputs: []*armstreamanalytics.FunctionInput{ - { - DataType: to.Ptr("Any"), - }}, - Output: &armstreamanalytics.FunctionOutput{ - DataType: to.Ptr("Any"), - }, - }, - }, - }, &armstreamanalytics.FunctionsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function8197"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg1637/providers/Microsoft.StreamAnalytics/streamingjobs/sj8653/functions/function8197"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - // Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - // Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - // Script: to.Ptr("function (x, y) { return x + y; }"), - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("Any"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("Any"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Create_AzureMLService.json -func ExampleFunctionsClient_CreateOrReplace_createAnAzureMlServiceFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().CreateOrReplace(ctx, "sjrg", "sjName", "function588", armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.AzureMachineLearningServiceFunctionBinding{ - Type: to.Ptr("Microsoft.MachineLearningServices"), - Properties: &armstreamanalytics.AzureMachineLearningServiceFunctionBindingProperties{ - APIKey: to.Ptr("someApiKey=="), - BatchSize: to.Ptr[int32](1000), - Endpoint: to.Ptr("someAzureMLEndpointURL"), - InputRequestName: to.Ptr("Inputs"), - Inputs: []*armstreamanalytics.AzureMachineLearningServiceInputColumn{ - { - Name: to.Ptr("data"), - DataType: to.Ptr("array"), - MapTo: to.Ptr[int32](0), - }}, - NumberOfParallelRequests: to.Ptr[int32](1), - OutputResponseName: to.Ptr("Results"), - Outputs: []*armstreamanalytics.AzureMachineLearningServiceOutputColumn{ - { - Name: to.Ptr("Sentiment"), - DataType: to.Ptr("string"), - }}, - }, - }, - Inputs: []*armstreamanalytics.FunctionInput{ - { - DataType: to.Ptr("nvarchar(max)"), - }}, - Output: &armstreamanalytics.FunctionOutput{ - DataType: to.Ptr("nvarchar(max)"), - }, - }, - }, - }, &armstreamanalytics.FunctionsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function588"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/functions/function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - // Type: to.Ptr("Microsoft.MachineLearning/WebService"), - // Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - // BatchSize: to.Ptr[int32](1000), - // Endpoint: to.Ptr("someAzureMLEndpointURL"), - // Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - // Name: to.Ptr("input1"), - // ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - // { - // Name: to.Ptr("tweet"), - // DataType: to.Ptr("string"), - // MapTo: to.Ptr[int32](0), - // }}, - // }, - // Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - // { - // Name: to.Ptr("Sentiment"), - // DataType: to.Ptr("string"), - // }}, - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Create_AzureML.json -func ExampleFunctionsClient_CreateOrReplace_createAnAzureMlFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().CreateOrReplace(ctx, "sjrg7", "sj9093", "function588", armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - Type: to.Ptr("Microsoft.MachineLearning/WebService"), - Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - APIKey: to.Ptr("someApiKey=="), - BatchSize: to.Ptr[int32](1000), - Endpoint: to.Ptr("someAzureMLEndpointURL"), - Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - Name: to.Ptr("input1"), - ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - { - Name: to.Ptr("tweet"), - DataType: to.Ptr("string"), - MapTo: to.Ptr[int32](0), - }}, - }, - Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - { - Name: to.Ptr("Sentiment"), - DataType: to.Ptr("string"), - }}, - }, - }, - Inputs: []*armstreamanalytics.FunctionInput{ - { - DataType: to.Ptr("nvarchar(max)"), - }}, - Output: &armstreamanalytics.FunctionOutput{ - DataType: to.Ptr("nvarchar(max)"), - }, - }, - }, - }, &armstreamanalytics.FunctionsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function588"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7/providers/Microsoft.StreamAnalytics/streamingjobs/sj9093/functions/function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - // Type: to.Ptr("Microsoft.MachineLearning/WebService"), - // Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - // BatchSize: to.Ptr[int32](1000), - // Endpoint: to.Ptr("someAzureMLEndpointURL"), - // Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - // Name: to.Ptr("input1"), - // ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - // { - // Name: to.Ptr("tweet"), - // DataType: to.Ptr("string"), - // MapTo: to.Ptr[int32](0), - // }}, - // }, - // Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - // { - // Name: to.Ptr("Sentiment"), - // DataType: to.Ptr("string"), - // }}, - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Update_JavaScript.json -func ExampleFunctionsClient_Update_updateAJavaScriptFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().Update(ctx, "sjrg1637", "sj8653", "function8197", armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - Script: to.Ptr("function (a, b) { return a * b; }"), - }, - }, - }, - }, - }, &armstreamanalytics.FunctionsClientUpdateOptions{IfMatch: 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function8197"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg1637/providers/Microsoft.StreamAnalytics/streamingjobs/sj8653/functions/function8197"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - // Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - // Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - // Script: to.Ptr("function (a, b) { return a * b; }"), - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("Any"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("Any"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Update_AzureML.json -func ExampleFunctionsClient_Update_updateAnAzureMlFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().Update(ctx, "sjrg7", "sj9093", "function588", armstreamanalytics.Function{ - Properties: &armstreamanalytics.ScalarFunctionProperties{ - Type: to.Ptr("Scalar"), - Properties: &armstreamanalytics.FunctionConfiguration{ - Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - Type: to.Ptr("Microsoft.MachineLearning/WebService"), - Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - BatchSize: to.Ptr[int32](5000), - }, - }, - }, - }, - }, &armstreamanalytics.FunctionsClientUpdateOptions{IfMatch: 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function588"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7/providers/Microsoft.StreamAnalytics/streamingjobs/sj9093/functions/function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - // Type: to.Ptr("Microsoft.MachineLearning/WebService"), - // Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - // BatchSize: to.Ptr[int32](5000), - // Endpoint: to.Ptr("someAzureMLEndpointURL"), - // Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - // Name: to.Ptr("input1"), - // ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - // { - // Name: to.Ptr("tweet"), - // DataType: to.Ptr("string"), - // MapTo: to.Ptr[int32](0), - // }}, - // }, - // Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - // { - // Name: to.Ptr("Sentiment"), - // DataType: to.Ptr("string"), - // }}, - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Delete.json -func ExampleFunctionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFunctionsClient().Delete(ctx, "sjrg1637", "sj8653", "function8197", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Get_JavaScript.json -func ExampleFunctionsClient_Get_getAJavaScriptFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().Get(ctx, "sjrg1637", "sj8653", "function8197", 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function8197"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg1637/providers/Microsoft.StreamAnalytics/streamingjobs/sj8653/functions/function8197"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - // Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - // Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - // Script: to.Ptr("function (x, y) { return x + y; }"), - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("Any"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("Any"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Get_AzureML.json -func ExampleFunctionsClient_Get_getAnAzureMlFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().Get(ctx, "sjrg7", "sj9093", "function588", 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function588"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7/providers/Microsoft.StreamAnalytics/streamingjobs/sj9093/functions/function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - // Type: to.Ptr("Microsoft.MachineLearning/WebService"), - // Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - // BatchSize: to.Ptr[int32](1000), - // Endpoint: to.Ptr("someAzureMLEndpointURL"), - // Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - // Name: to.Ptr("input1"), - // ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - // { - // Name: to.Ptr("tweet"), - // DataType: to.Ptr("string"), - // MapTo: to.Ptr[int32](0), - // }}, - // }, - // Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - // { - // Name: to.Ptr("Sentiment"), - // DataType: to.Ptr("string"), - // }}, - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_ListByStreamingJob.json -func ExampleFunctionsClient_NewListByStreamingJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFunctionsClient().NewListByStreamingJobPager("sjrg1637", "sj8653", &armstreamanalytics.FunctionsClientListByStreamingJobOptions{Select: 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.FunctionListResult = armstreamanalytics.FunctionListResult{ - // Value: []*armstreamanalytics.Function{ - // { - // Name: to.Ptr("function588"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg1637/providers/Microsoft.StreamAnalytics/streamingjobs/sj8653/functions/function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Etag: to.Ptr("281cbf11-cd50-4a44-b833-cf170ce74748"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - // Type: to.Ptr("Microsoft.MachineLearning/WebService"), - // Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - // BatchSize: to.Ptr[int32](5000), - // Endpoint: to.Ptr("someAzureMLEndpointURL"), - // Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - // Name: to.Ptr("input1"), - // ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - // { - // Name: to.Ptr("tweet"), - // DataType: to.Ptr("string"), - // MapTo: to.Ptr[int32](0), - // }}, - // }, - // Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - // { - // Name: to.Ptr("Sentiment"), - // DataType: to.Ptr("string"), - // }}, - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("function8197"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg1637/providers/Microsoft.StreamAnalytics/streamingjobs/sj8653/functions/function8197"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Etag: to.Ptr("94a512d5-2f59-4e39-b9c8-bca4abd74b7e"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.JavaScriptFunctionBinding{ - // Type: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - // Properties: &armstreamanalytics.JavaScriptFunctionBindingProperties{ - // Script: to.Ptr("function (a, b) { return a * b; }"), - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("Any"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("Any"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Test_JavaScript.json -func ExampleFunctionsClient_BeginTest_testTheConnectionForAJavaScriptFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFunctionsClient().BeginTest(ctx, "sjrg1637", "sj8653", "function8197", &armstreamanalytics.FunctionsClientBeginTestOptions{Function: 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.ResourceTestStatus = armstreamanalytics.ResourceTestStatus{ - // Error: &armstreamanalytics.ErrorResponse{ - // Code: to.Ptr("BadRequest"), - // Message: to.Ptr("Test operation is not supported for function type: Microsoft.StreamAnalytics/JavascriptUdf"), - // }, - // Status: to.Ptr("TestFailed"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_Test_AzureML.json -func ExampleFunctionsClient_BeginTest_testTheConnectionForAnAzureMlFunction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFunctionsClient().BeginTest(ctx, "sjrg", "sjName", "function588", &armstreamanalytics.FunctionsClientBeginTestOptions{Function: 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.ResourceTestStatus = armstreamanalytics.ResourceTestStatus{ - // Status: to.Ptr("TestSucceeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Function_RetrieveDefaultDefinition_AzureML.json -func ExampleFunctionsClient_RetrieveDefaultDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFunctionsClient().RetrieveDefaultDefinition(ctx, "sjrg7", "sj9093", "function588", &armstreamanalytics.FunctionsClientRetrieveDefaultDefinitionOptions{FunctionRetrieveDefaultDefinitionParameters: &armstreamanalytics.AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters{ - BindingType: to.Ptr("Microsoft.MachineLearning/WebService"), - BindingRetrievalProperties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingRetrievalProperties{ - ExecuteEndpoint: to.Ptr("someAzureMLExecuteEndpointUrl"), - UdfType: to.Ptr("Scalar"), - }, - }, - }) - 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.Function = armstreamanalytics.Function{ - // Name: to.Ptr("function588"), - // Properties: &armstreamanalytics.ScalarFunctionProperties{ - // Type: to.Ptr("Scalar"), - // Properties: &armstreamanalytics.FunctionConfiguration{ - // Binding: &armstreamanalytics.AzureMachineLearningStudioFunctionBinding{ - // Type: to.Ptr("Microsoft.MachineLearning/WebService"), - // Properties: &armstreamanalytics.AzureMachineLearningStudioFunctionBindingProperties{ - // BatchSize: to.Ptr[int32](1000), - // Endpoint: to.Ptr("someAzureMLExecuteEndpointUrl"), - // Inputs: &armstreamanalytics.AzureMachineLearningStudioInputs{ - // Name: to.Ptr("input1"), - // ColumnNames: []*armstreamanalytics.AzureMachineLearningStudioInputColumn{ - // { - // Name: to.Ptr("tweet"), - // DataType: to.Ptr("string"), - // MapTo: to.Ptr[int32](0), - // }}, - // }, - // Outputs: []*armstreamanalytics.AzureMachineLearningStudioOutputColumn{ - // { - // Name: to.Ptr("Sentiment"), - // DataType: to.Ptr("string"), - // }}, - // }, - // }, - // Inputs: []*armstreamanalytics.FunctionInput{ - // { - // DataType: to.Ptr("nvarchar(max)"), - // }}, - // Output: &armstreamanalytics.FunctionOutput{ - // DataType: to.Ptr("nvarchar(max)"), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod b/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod index aa18ab22ded3..71e38c599dd8 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client.go index 94eeec44a88d..4539dbbf5b97 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client.go @@ -46,7 +46,7 @@ func NewInputsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrReplace - Creates an input or replaces an already existing input under an existing streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - inputName - The name of the input. @@ -99,15 +99,15 @@ func (client *InputsClient) createOrReplaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { return nil, err } @@ -129,7 +129,7 @@ func (client *InputsClient) createOrReplaceHandleResponse(resp *http.Response) ( // Delete - Deletes an input from the streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - inputName - The name of the input. @@ -179,7 +179,7 @@ func (client *InputsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *InputsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets details about the specified input. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - inputName - The name of the input. @@ -239,7 +239,7 @@ func (client *InputsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *InputsClient) getHandleResponse(resp *http.Response) (InputsClient // NewListByStreamingJobPager - Lists all of the inputs under the specified streaming job. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - InputsClientListByStreamingJobOptions contains the optional parameters for the InputsClient.NewListByStreamingJobPager @@ -310,7 +310,7 @@ func (client *InputsClient) listByStreamingJobCreateRequest(ctx context.Context, if options != nil && options.Select != nil { reqQP.Set("$select", *options.Select) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *InputsClient) listByStreamingJobHandleResponse(resp *http.Response // BeginTest - Tests whether an input’s datasource is reachable and usable by the Azure Stream Analytics service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - inputName - The name of the input. @@ -353,7 +353,7 @@ func (client *InputsClient) BeginTest(ctx context.Context, resourceGroupName str // Test - Tests whether an input’s datasource is reachable and usable by the Azure Stream Analytics service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *InputsClient) test(ctx context.Context, resourceGroupName string, jobName string, inputName string, options *InputsClientBeginTestOptions) (*http.Response, error) { var err error const operationName = "InputsClient.BeginTest" @@ -399,7 +399,7 @@ func (client *InputsClient) testCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Input != nil { @@ -415,7 +415,7 @@ func (client *InputsClient) testCreateRequest(ctx context.Context, resourceGroup // or two properties) an input without affecting the rest the job or input definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - inputName - The name of the input. @@ -470,12 +470,12 @@ func (client *InputsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { return nil, err } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client_example_test.go deleted file mode 100644 index 6d8690e24121..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/inputs_client_example_test.go +++ /dev/null @@ -1,1151 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_GatewayMessageBus.json -func ExampleInputsClient_CreateOrReplace_createAGatewayMessageBusInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg3467", "sj9742", "input7970", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Datasource: &armstreamanalytics.GatewayMessageBusStreamInputDataSource{ - Type: to.Ptr("GatewayMessageBus"), - Properties: &armstreamanalytics.GatewayMessageBusStreamInputDataSourceProperties{ - Topic: to.Ptr("EdgeTopic1"), - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7970"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3467/providers/Microsoft.StreamAnalytics/streamingjobs/sj9742/inputs/input7970"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Datasource: &armstreamanalytics.GatewayMessageBusStreamInputDataSource{ - // Type: to.Ptr("GatewayMessageBus"), - // Properties: &armstreamanalytics.GatewayMessageBusStreamInputDataSourceProperties{ - // Topic: to.Ptr("EdgeTopic1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_Reference_Blob_CSV.json -func ExampleInputsClient_CreateOrReplace_createAReferenceBlobInputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg8440", "sj9597", "input7225", armstreamanalytics.Input{ - Properties: &armstreamanalytics.ReferenceInputProperties{ - Type: to.Ptr("Reference"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("someAccountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - BlobName: to.Ptr("myblobinput"), - DeltaPathPattern: to.Ptr("/testBlob/{date}/delta/{time}/"), - DeltaSnapshotRefreshRate: to.Ptr("16:14:30"), - FullSnapshotRefreshRate: to.Ptr("16:14:30"), - SourcePartitionCount: to.Ptr[int32](16), - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7225"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7225"), - // Properties: &armstreamanalytics.ReferenceInputProperties{ - // Type: to.Ptr("Reference"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_Reference_File.json -func ExampleInputsClient_CreateOrReplace_createAReferenceFileInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg8440", "sj9597", "input7225", armstreamanalytics.Input{ - Properties: &armstreamanalytics.ReferenceInputProperties{ - Type: to.Ptr("Reference"), - Datasource: &armstreamanalytics.FileReferenceInputDataSource{ - Type: to.Ptr("File"), - Properties: &armstreamanalytics.FileReferenceInputDataSourceProperties{ - Path: to.Ptr("my/path"), - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7225"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7225"), - // Properties: &armstreamanalytics.ReferenceInputProperties{ - // Type: to.Ptr("Reference"), - // Datasource: &armstreamanalytics.FileReferenceInputDataSource{ - // Type: to.Ptr("File"), - // Properties: &armstreamanalytics.FileReferenceInputDataSourceProperties{ - // Path: to.Ptr("my/path"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_Stream_EventHub_JSON.json -func ExampleInputsClient_CreateOrReplace_createAStreamEventHubInputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg3139", "sj197", "input7425", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - WatermarkSettings: &armstreamanalytics.InputWatermarkProperties{ - WatermarkMode: to.Ptr(armstreamanalytics.InputWatermarkModeReadWatermark), - }, - Datasource: &armstreamanalytics.EventHubStreamInputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - ServiceBusNamespace: to.Ptr("sdktest"), - SharedAccessPolicyKey: to.Ptr("someSharedAccessPolicyKey=="), - SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - EventHubName: to.Ptr("sdkeventhub"), - ConsumerGroupName: to.Ptr("sdkconsumergroup"), - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7425"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3139/providers/Microsoft.StreamAnalytics/streamingjobs/sj197/inputs/input7425"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.EventHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_Stream_IoTHub_Avro.json -func ExampleInputsClient_CreateOrReplace_createAStreamIoTHubInputWithAvroSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg3467", "sj9742", "input7970", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.AvroSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - }, - Datasource: &armstreamanalytics.IoTHubStreamInputDataSource{ - Type: to.Ptr("Microsoft.Devices/IotHubs"), - Properties: &armstreamanalytics.IoTHubStreamInputDataSourceProperties{ - ConsumerGroupName: to.Ptr("sdkconsumergroup"), - Endpoint: to.Ptr("messages/events"), - IotHubNamespace: to.Ptr("iothub"), - SharedAccessPolicyKey: to.Ptr("sharedAccessPolicyKey="), - SharedAccessPolicyName: to.Ptr("owner"), - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7970"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3467/providers/Microsoft.StreamAnalytics/streamingjobs/sj9742/inputs/input7970"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.AvroSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - // Properties: map[string]any{ - // }, - // }, - // Datasource: &armstreamanalytics.IoTHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // Properties: &armstreamanalytics.IoTHubStreamInputDataSourceProperties{ - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // Endpoint: to.Ptr("messages/events"), - // IotHubNamespace: to.Ptr("iothub"), - // SharedAccessPolicyName: to.Ptr("owner"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_Stream_Blob_CSV.json -func ExampleInputsClient_CreateOrReplace_createAStreamBlobInputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg8161", "sj6695", "input8899", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("someAccountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - SourcePartitionCount: to.Ptr[int32](16), - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input8899"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8161/providers/Microsoft.StreamAnalytics/streamingjobs/sj6695/inputs/input8899"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // SourcePartitionCount: to.Ptr[int32](16), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_EventGrid.json -func ExampleInputsClient_CreateOrReplace_createAnEventGridInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().CreateOrReplace(ctx, "sjrg3467", "sj9742", "input7970", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Datasource: &armstreamanalytics.EventGridStreamInputDataSource{ - Type: to.Ptr("Microsoft.EventGrid/EventSubscriptions"), - Properties: &armstreamanalytics.EventGridStreamInputDataSourceProperties{ - Schema: to.Ptr(armstreamanalytics.EventGridEventSchemaTypeCloudEventSchema), - EventTypes: []*string{ - to.Ptr("Microsoft.Storage.BlobCreated")}, - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("myaccountkey"), - AccountName: to.Ptr("myaccount"), - AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - }}, - Subscriber: &armstreamanalytics.EventHubV2StreamInputDataSource{ - Type: to.Ptr("Microsoft.EventHub/EventHub"), - Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - ServiceBusNamespace: to.Ptr("sdktest"), - SharedAccessPolicyKey: to.Ptr("someSharedAccessPolicyKey=="), - SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - EventHubName: to.Ptr("sdkeventhub"), - PartitionCount: to.Ptr[int32](16), - ConsumerGroupName: to.Ptr("sdkconsumergroup"), - }, - }, - }, - }, - }, - }, &armstreamanalytics.InputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7970"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3467/providers/Microsoft.StreamAnalytics/streamingjobs/sj9742/inputs/input7970"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Datasource: &armstreamanalytics.EventGridStreamInputDataSource{ - // Type: to.Ptr("Microsoft.EventGrid/EventSubscriptions"), - // Properties: &armstreamanalytics.EventGridStreamInputDataSourceProperties{ - // Schema: to.Ptr(armstreamanalytics.EventGridEventSchemaTypeCloudEventSchema), - // EventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated")}, - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("myaccount"), - // AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - // }}, - // Subscriber: &armstreamanalytics.EventHubV2StreamInputDataSource{ - // Type: to.Ptr("Microsoft.EventHub/EventHub"), - // Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - // AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // PartitionCount: to.Ptr[int32](16), - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Update_Reference_Blob.json -func ExampleInputsClient_Update_updateAReferenceBlobInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Update(ctx, "sjrg8440", "sj9597", "input7225", armstreamanalytics.Input{ - Properties: &armstreamanalytics.ReferenceInputProperties{ - Type: to.Ptr("Reference"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr("|"), - }, - }, - Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - Container: to.Ptr("differentContainer"), - }, - }, - }, - }, &armstreamanalytics.InputsClientUpdateOptions{IfMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7225"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7225"), - // Properties: &armstreamanalytics.ReferenceInputProperties{ - // Type: to.Ptr("Reference"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - // Container: to.Ptr("differentContainer"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Update_Stream_EventHub.json -func ExampleInputsClient_Update_updateAStreamEventHubInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Update(ctx, "sjrg3139", "sj197", "input7425", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.AvroSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - }, - Datasource: &armstreamanalytics.EventHubStreamInputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - ConsumerGroupName: to.Ptr("differentConsumerGroupName"), - }, - }, - }, - }, &armstreamanalytics.InputsClientUpdateOptions{IfMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7425"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3139/providers/Microsoft.StreamAnalytics/streamingjobs/sj197/inputs/input7425"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.AvroSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - // Properties: map[string]any{ - // }, - // }, - // Datasource: &armstreamanalytics.EventHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // ConsumerGroupName: to.Ptr("differentConsumerGroupName"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Update_Stream_IoTHub.json -func ExampleInputsClient_Update_updateAStreamIoTHubInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Update(ctx, "sjrg3467", "sj9742", "input7970", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr("|"), - }, - }, - Datasource: &armstreamanalytics.IoTHubStreamInputDataSource{ - Type: to.Ptr("Microsoft.Devices/IotHubs"), - Properties: &armstreamanalytics.IoTHubStreamInputDataSourceProperties{ - Endpoint: to.Ptr("messages/operationsMonitoringEvents"), - }, - }, - }, - }, &armstreamanalytics.InputsClientUpdateOptions{IfMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7970"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3467/providers/Microsoft.StreamAnalytics/streamingjobs/sj9742/inputs/input7970"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // Datasource: &armstreamanalytics.IoTHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // Properties: &armstreamanalytics.IoTHubStreamInputDataSourceProperties{ - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // Endpoint: to.Ptr("messages/operationsMonitoringEvents"), - // IotHubNamespace: to.Ptr("iothub"), - // SharedAccessPolicyName: to.Ptr("owner"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Update_Stream_Blob.json -func ExampleInputsClient_Update_updateAStreamBlobInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Update(ctx, "sjrg8161", "sj6695", "input8899", armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr("|"), - }, - }, - Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - SourcePartitionCount: to.Ptr[int32](32), - }, - }, - }, - }, &armstreamanalytics.InputsClientUpdateOptions{IfMatch: 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input8899"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8161/providers/Microsoft.StreamAnalytics/streamingjobs/sj6695/inputs/input8899"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // SourcePartitionCount: to.Ptr[int32](32), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Delete.json -func ExampleInputsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInputsClient().Delete(ctx, "sjrg8440", "sj9597", "input7225", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Get_Reference_Blob_CSV.json -func ExampleInputsClient_Get_getAReferenceBlobInputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Get(ctx, "sjrg8440", "sj9597", "input7225", 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7225"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7225"), - // Properties: &armstreamanalytics.ReferenceInputProperties{ - // Type: to.Ptr("Reference"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Get_Stream_EventHub_JSON.json -func ExampleInputsClient_Get_getAStreamEventHubInputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Get(ctx, "sjrg3139", "sj197", "input7425", 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7425"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3139/providers/Microsoft.StreamAnalytics/streamingjobs/sj197/inputs/input7425"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.EventHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Get_Stream_IoTHub_Avro.json -func ExampleInputsClient_Get_getAStreamIoTHubInputWithAvroSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Get(ctx, "sjrg3467", "sj9742", "input7970", 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input7970"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3467/providers/Microsoft.StreamAnalytics/streamingjobs/sj9742/inputs/input7970"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.AvroSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - // Properties: map[string]any{ - // }, - // }, - // Datasource: &armstreamanalytics.IoTHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // Properties: &armstreamanalytics.IoTHubStreamInputDataSourceProperties{ - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // Endpoint: to.Ptr("messages/events"), - // IotHubNamespace: to.Ptr("iothub"), - // SharedAccessPolicyName: to.Ptr("owner"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Get_Stream_Blob_CSV.json -func ExampleInputsClient_Get_getAStreamBlobInputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInputsClient().Get(ctx, "sjrg8161", "sj6695", "input8899", 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.Input = armstreamanalytics.Input{ - // Name: to.Ptr("input8899"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8161/providers/Microsoft.StreamAnalytics/streamingjobs/sj6695/inputs/input8899"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // SourcePartitionCount: to.Ptr[int32](16), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_ListByStreamingJob.json -func ExampleInputsClient_NewListByStreamingJobPager_listAllInputsInAStreamingJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInputsClient().NewListByStreamingJobPager("sjrg8440", "sj9597", &armstreamanalytics.InputsClientListByStreamingJobOptions{Select: 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.InputListResult = armstreamanalytics.InputListResult{ - // Value: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("input7225"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7225"), - // Properties: &armstreamanalytics.ReferenceInputProperties{ - // Type: to.Ptr("Reference"), - // Etag: to.Ptr("a4ceb697-1c8f-40c8-b951-fb5ee4757437"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // Datasource: &armstreamanalytics.BlobReferenceInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobReferenceInputDataSourceProperties{ - // Container: to.Ptr("differentContainer"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("input8899"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input8899"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("3b35d57c-02f4-4b41-8e1d-af02a86c2fa1"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // SourcePartitionCount: to.Ptr[int32](32), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("input7425"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7425"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("7548f259-81b5-4ea7-b896-25c6717d98ba"), - // Serialization: &armstreamanalytics.AvroSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - // Properties: map[string]any{ - // }, - // }, - // Datasource: &armstreamanalytics.EventHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubStreamInputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // ConsumerGroupName: to.Ptr("differentConsumerGroupName"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("input7970"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg8440/providers/Microsoft.StreamAnalytics/streamingjobs/sj9597/inputs/input7970"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("e2d847e0-c95b-48ef-9e14-1afc1f2270cb"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // Datasource: &armstreamanalytics.IoTHubStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Devices/IotHubs"), - // Properties: &armstreamanalytics.IoTHubStreamInputDataSourceProperties{ - // ConsumerGroupName: to.Ptr("sdkconsumergroup"), - // Endpoint: to.Ptr("messages/operationsMonitoringEvents"), - // IotHubNamespace: to.Ptr("iothub"), - // SharedAccessPolicyName: to.Ptr("owner"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_ListByStreamingJob_Diagnostics.json -func ExampleInputsClient_NewListByStreamingJobPager_listAllInputsInAStreamingJobAndIncludeDiagnosticInformationUsingTheSelectODataQueryParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInputsClient().NewListByStreamingJobPager("sjrg3276", "sj7804", &armstreamanalytics.InputsClientListByStreamingJobOptions{Select: to.Ptr("*")}) - 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.InputListResult = armstreamanalytics.InputListResult{ - // Value: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Diagnostics: &armstreamanalytics.Diagnostics{ - // Conditions: []*armstreamanalytics.DiagnosticCondition{ - // { - // Code: to.Ptr("INP-3"), - // Message: to.Ptr("Could not deserialize the input event as Json. Some possible reasons: 1) Malformed events 2) Input source configured with incorrect serialization format"), - // Since: to.Ptr("2017-05-11T04:38:42.4938687Z"), - // }}, - // }, - // Etag: to.Ptr("ca88f8fa-605b-4c7f-8695-46f5faa60cd0"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("state"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Test.json -func ExampleInputsClient_BeginTest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInputsClient().BeginTest(ctx, "sjrg8440", "sj9597", "input7225", &armstreamanalytics.InputsClientBeginTestOptions{Input: 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.ResourceTestStatus = armstreamanalytics.ResourceTestStatus{ - // Status: to.Ptr("TestSucceeded"), - // } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/interfaces.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/interfaces.go index 62bc55f9ae07..92a722cc95d6 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/interfaces.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/interfaces.go @@ -11,8 +11,7 @@ package armstreamanalytics // FunctionBindingClassification provides polymorphic access to related types. // Call the interface's GetFunctionBinding() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureMachineLearningServiceFunctionBinding, *AzureMachineLearningStudioFunctionBinding, *CSharpFunctionBinding, *FunctionBinding, -// - *JavaScriptFunctionBinding +// - *AzureMachineLearningWebServiceFunctionBinding, *FunctionBinding, *JavaScriptFunctionBinding type FunctionBindingClassification interface { // GetFunctionBinding returns the FunctionBinding content of the underlying type. GetFunctionBinding() *FunctionBinding @@ -30,8 +29,8 @@ type FunctionPropertiesClassification interface { // FunctionRetrieveDefaultDefinitionParametersClassification provides polymorphic access to related types. // Call the interface's GetFunctionRetrieveDefaultDefinitionParameters() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters, *AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters, -// - *CSharpFunctionRetrieveDefaultDefinitionParameters, *FunctionRetrieveDefaultDefinitionParameters, *JavaScriptFunctionRetrieveDefaultDefinitionParameters +// - *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters, *FunctionRetrieveDefaultDefinitionParameters, +// - *JavaScriptFunctionRetrieveDefaultDefinitionParameters type FunctionRetrieveDefaultDefinitionParametersClassification interface { // GetFunctionRetrieveDefaultDefinitionParameters returns the FunctionRetrieveDefaultDefinitionParameters content of the underlying type. GetFunctionRetrieveDefaultDefinitionParameters() *FunctionRetrieveDefaultDefinitionParameters @@ -49,10 +48,9 @@ type InputPropertiesClassification interface { // OutputDataSourceClassification provides polymorphic access to related types. // Call the interface's GetOutputDataSource() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureDataExplorerOutputDataSource, *AzureDataLakeStoreOutputDataSource, *AzureFunctionOutputDataSource, *AzureSQLDatabaseOutputDataSource, -// - *AzureSynapseOutputDataSource, *AzureTableOutputDataSource, *BlobOutputDataSource, *DocumentDbOutputDataSource, *EventHubOutputDataSource, -// - *EventHubV2OutputDataSource, *GatewayMessageBusOutputDataSource, *OutputDataSource, *PostgreSQLOutputDataSource, *PowerBIOutputDataSource, -// - *RawOutputDatasource, *ServiceBusQueueOutputDataSource, *ServiceBusTopicOutputDataSource +// - *AzureDataLakeStoreOutputDataSource, *AzureFunctionOutputDataSource, *AzureSQLDatabaseOutputDataSource, *AzureSynapseOutputDataSource, +// - *AzureTableOutputDataSource, *BlobOutputDataSource, *DocumentDbOutputDataSource, *EventHubOutputDataSource, *EventHubV2OutputDataSource, +// - *GatewayMessageBusOutputDataSource, *OutputDataSource, *PowerBIOutputDataSource, *ServiceBusQueueOutputDataSource, *ServiceBusTopicOutputDataSource type OutputDataSourceClassification interface { // GetOutputDataSource returns the OutputDataSource content of the underlying type. GetOutputDataSource() *OutputDataSource @@ -61,8 +59,7 @@ type OutputDataSourceClassification interface { // ReferenceInputDataSourceClassification provides polymorphic access to related types. // Call the interface's GetReferenceInputDataSource() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureSQLReferenceInputDataSource, *BlobReferenceInputDataSource, *FileReferenceInputDataSource, *RawReferenceInputDataSource, -// - *ReferenceInputDataSource +// - *AzureSQLReferenceInputDataSource, *BlobReferenceInputDataSource, *FileReferenceInputDataSource, *ReferenceInputDataSource type ReferenceInputDataSourceClassification interface { // GetReferenceInputDataSource returns the ReferenceInputDataSource content of the underlying type. GetReferenceInputDataSource() *ReferenceInputDataSource @@ -71,8 +68,7 @@ type ReferenceInputDataSourceClassification interface { // SerializationClassification provides polymorphic access to related types. // Call the interface's GetSerialization() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AvroSerialization, *CSVSerialization, *CustomClrSerialization, *DeltaSerialization, *JSONSerialization, *ParquetSerialization, -// - *Serialization +// - *AvroSerialization, *CSVSerialization, *JSONSerialization, *ParquetSerialization, *Serialization type SerializationClassification interface { // GetSerialization returns the Serialization content of the underlying type. GetSerialization() *Serialization @@ -81,8 +77,8 @@ type SerializationClassification interface { // StreamInputDataSourceClassification provides polymorphic access to related types. // Call the interface's GetStreamInputDataSource() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *BlobStreamInputDataSource, *EventGridStreamInputDataSource, *EventHubStreamInputDataSource, *EventHubV2StreamInputDataSource, -// - *GatewayMessageBusStreamInputDataSource, *IoTHubStreamInputDataSource, *RawStreamInputDataSource, *StreamInputDataSource +// - *BlobStreamInputDataSource, *EventHubStreamInputDataSource, *EventHubV2StreamInputDataSource, *GatewayMessageBusStreamInputDataSource, +// - *IoTHubStreamInputDataSource, *StreamInputDataSource type StreamInputDataSourceClassification interface { // GetStreamInputDataSource returns the StreamInputDataSource content of the underlying type. GetStreamInputDataSource() *StreamInputDataSource diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/models.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models.go index 7f689a5680f2..71bb89768eec 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/models.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models.go @@ -48,37 +48,6 @@ func (a *AvroSerialization) GetSerialization() *Serialization { } } -// AzureDataExplorerOutputDataSource - Describes an Azure Data Explorer output data source. -type AzureDataExplorerOutputDataSource struct { - // REQUIRED; Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. - Type *string - - // The properties that are associated with an Azure Data Explorer output. Required on PUT (CreateOrReplace) requests. - Properties *AzureDataExplorerOutputDataSourceProperties -} - -// GetOutputDataSource implements the OutputDataSourceClassification interface for type AzureDataExplorerOutputDataSource. -func (a *AzureDataExplorerOutputDataSource) GetOutputDataSource() *OutputDataSource { - return &OutputDataSource{ - Type: a.Type, - } -} - -// AzureDataExplorerOutputDataSourceProperties - The properties that are associated with an Azure Data Explorer output. -type AzureDataExplorerOutputDataSourceProperties struct { - // Authentication Mode. - AuthenticationMode *AuthenticationMode - - // The name of the Azure Data Explorer cluster. Required on PUT (CreateOrReplace) requests. - Cluster *string - - // The name of the Azure Data Explorer database. Required on PUT (CreateOrReplace) requests. - Database *string - - // The name of the Azure Table. Required on PUT (CreateOrReplace) requests. - Table *string -} - // AzureDataLakeStoreOutputDataSource - Describes an Azure Data Lake Store output data source. type AzureDataLakeStoreOutputDataSource struct { // REQUIRED; Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. @@ -167,179 +136,73 @@ type AzureFunctionOutputDataSourceProperties struct { MaxBatchSize *float32 } -// AzureMachineLearningServiceFunctionBinding - The binding to an Azure Machine Learning web service. -type AzureMachineLearningServiceFunctionBinding struct { +// AzureMachineLearningWebServiceFunctionBinding - The binding to an Azure Machine Learning web service. +type AzureMachineLearningWebServiceFunctionBinding struct { // REQUIRED; Indicates the function binding type. Type *string // The binding properties associated with an Azure Machine learning web service. - Properties *AzureMachineLearningServiceFunctionBindingProperties + Properties *AzureMachineLearningWebServiceFunctionBindingProperties } -// GetFunctionBinding implements the FunctionBindingClassification interface for type AzureMachineLearningServiceFunctionBinding. -func (a *AzureMachineLearningServiceFunctionBinding) GetFunctionBinding() *FunctionBinding { +// GetFunctionBinding implements the FunctionBindingClassification interface for type AzureMachineLearningWebServiceFunctionBinding. +func (a *AzureMachineLearningWebServiceFunctionBinding) GetFunctionBinding() *FunctionBinding { return &FunctionBinding{ Type: a.Type, } } -// AzureMachineLearningServiceFunctionBindingProperties - The binding properties associated with an Azure Machine learning +// AzureMachineLearningWebServiceFunctionBindingProperties - The binding properties associated with an Azure Machine learning // web service. -type AzureMachineLearningServiceFunctionBindingProperties struct { +type AzureMachineLearningWebServiceFunctionBindingProperties struct { // The API key used to authenticate with Request-Response endpoint. APIKey *string // Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS execute request. Default is 1000. BatchSize *int32 - // The Request-Response execute endpoint of the Azure Machine Learning web service. + // The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: + // https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs Endpoint *string - // Label for the input request object. - InputRequestName *string - // The inputs for the Azure Machine Learning web service endpoint. - Inputs []*AzureMachineLearningServiceInputColumn - - // The number of parallel requests that will be sent per partition of your job to the machine learning service. Default is - // 1. - NumberOfParallelRequests *int32 - - // Label for the output request object. - OutputResponseName *string + Inputs *AzureMachineLearningWebServiceInputs // A list of outputs from the Azure Machine Learning web service endpoint execution. - Outputs []*AzureMachineLearningServiceOutputColumn + Outputs []*AzureMachineLearningWebServiceOutputColumn } -// AzureMachineLearningServiceFunctionBindingRetrievalProperties - The binding retrieval properties associated with an Azure -// Machine learning web service. -type AzureMachineLearningServiceFunctionBindingRetrievalProperties struct { - // The Request-Response execute endpoint of the Azure Machine Learning web service. +// AzureMachineLearningWebServiceFunctionBindingRetrievalProperties - The binding retrieval properties associated with an +// Azure Machine learning web service. +type AzureMachineLearningWebServiceFunctionBindingRetrievalProperties struct { + // The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: + // https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs ExecuteEndpoint *string // The function type. UdfType *string } -// AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters - The parameters needed to retrieve the default +// AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters - The parameters needed to retrieve the default // function definition for an Azure Machine Learning web service function. -type AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters struct { +type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters struct { // REQUIRED; Indicates the function binding type. BindingType *string // The binding retrieval properties associated with an Azure Machine learning web service. - BindingRetrievalProperties *AzureMachineLearningServiceFunctionBindingRetrievalProperties -} - -// GetFunctionRetrieveDefaultDefinitionParameters implements the FunctionRetrieveDefaultDefinitionParametersClassification -// interface for type AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters. -func (a *AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters) GetFunctionRetrieveDefaultDefinitionParameters() *FunctionRetrieveDefaultDefinitionParameters { - return &FunctionRetrieveDefaultDefinitionParameters{ - BindingType: a.BindingType, - } -} - -// AzureMachineLearningServiceInputColumn - Describes an input column for the Azure Machine Learning web service endpoint. -type AzureMachineLearningServiceInputColumn struct { - // The (Azure Machine Learning supported) data type of the input column. - DataType *string - - // The zero based index of the function parameter this input maps to. - MapTo *int32 - - // The name of the input column. - Name *string -} - -// AzureMachineLearningServiceInputs - The inputs for the Azure Machine Learning web service endpoint. -type AzureMachineLearningServiceInputs struct { - // A list of input columns for the Azure Machine Learning web service endpoint. - ColumnNames []*AzureMachineLearningServiceInputColumn - - // The name of the input. This is the name provided while authoring the endpoint. - Name *string -} - -// AzureMachineLearningServiceOutputColumn - Describes an output column for the Azure Machine Learning web service endpoint. -type AzureMachineLearningServiceOutputColumn struct { - // The (Azure Machine Learning supported) data type of the output column. - DataType *string - - // The zero based index of the function parameter this input maps to. - MapTo *int32 - - // The name of the output column. - Name *string -} - -// AzureMachineLearningStudioFunctionBinding - The binding to an Azure Machine Learning Studio. -type AzureMachineLearningStudioFunctionBinding struct { - // REQUIRED; Indicates the function binding type. - Type *string - - // The binding properties associated with an Azure Machine learning Studio. - Properties *AzureMachineLearningStudioFunctionBindingProperties -} - -// GetFunctionBinding implements the FunctionBindingClassification interface for type AzureMachineLearningStudioFunctionBinding. -func (a *AzureMachineLearningStudioFunctionBinding) GetFunctionBinding() *FunctionBinding { - return &FunctionBinding{ - Type: a.Type, - } -} - -// AzureMachineLearningStudioFunctionBindingProperties - The binding properties associated with an Azure Machine learning -// Studio. -type AzureMachineLearningStudioFunctionBindingProperties struct { - // The API key used to authenticate with Request-Response endpoint. - APIKey *string - - // Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS execute request. Default is 1000. - BatchSize *int32 - - // The Request-Response execute endpoint of the Azure Machine Learning Studio. Find out more here: - // https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs - Endpoint *string - - // The inputs for the Azure Machine Learning Studio endpoint. - Inputs *AzureMachineLearningStudioInputs - - // A list of outputs from the Azure Machine Learning Studio endpoint execution. - Outputs []*AzureMachineLearningStudioOutputColumn -} - -// AzureMachineLearningStudioFunctionBindingRetrievalProperties - The binding retrieval properties associated with an Azure -// Machine learning Studio. -type AzureMachineLearningStudioFunctionBindingRetrievalProperties struct { - // The Request-Response execute endpoint of the Azure Machine Learning Studio. Find out more here: - // https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs - ExecuteEndpoint *string - - // The function type. - UdfType *string -} - -// AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters - The parameters needed to retrieve the default function -// definition for an Azure Machine Learning Studio function. -type AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters struct { - // REQUIRED; Indicates the function binding type. - BindingType *string - - // The binding retrieval properties associated with an Azure Machine learning Studio. - BindingRetrievalProperties *AzureMachineLearningStudioFunctionBindingRetrievalProperties + BindingRetrievalProperties *AzureMachineLearningWebServiceFunctionBindingRetrievalProperties } // GetFunctionRetrieveDefaultDefinitionParameters implements the FunctionRetrieveDefaultDefinitionParametersClassification -// interface for type AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters. -func (a *AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters) GetFunctionRetrieveDefaultDefinitionParameters() *FunctionRetrieveDefaultDefinitionParameters { +// interface for type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. +func (a *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) GetFunctionRetrieveDefaultDefinitionParameters() *FunctionRetrieveDefaultDefinitionParameters { return &FunctionRetrieveDefaultDefinitionParameters{ BindingType: a.BindingType, } } -// AzureMachineLearningStudioInputColumn - Describes an input column for the Azure Machine Learning Studio endpoint. -type AzureMachineLearningStudioInputColumn struct { +// AzureMachineLearningWebServiceInputColumn - Describes an input column for the Azure Machine Learning web service endpoint. +type AzureMachineLearningWebServiceInputColumn struct { // The (Azure Machine Learning supported) data type of the input column. A list of valid Azure Machine Learning data types // are described at https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx . DataType *string @@ -351,17 +214,17 @@ type AzureMachineLearningStudioInputColumn struct { Name *string } -// AzureMachineLearningStudioInputs - The inputs for the Azure Machine Learning Studio endpoint. -type AzureMachineLearningStudioInputs struct { - // A list of input columns for the Azure Machine Learning Studio endpoint. - ColumnNames []*AzureMachineLearningStudioInputColumn +// AzureMachineLearningWebServiceInputs - The inputs for the Azure Machine Learning web service endpoint. +type AzureMachineLearningWebServiceInputs struct { + // A list of input columns for the Azure Machine Learning web service endpoint. + ColumnNames []*AzureMachineLearningWebServiceInputColumn // The name of the input. This is the name provided while authoring the endpoint. Name *string } -// AzureMachineLearningStudioOutputColumn - Describes an output column for the Azure Machine Learning Studio endpoint. -type AzureMachineLearningStudioOutputColumn struct { +// AzureMachineLearningWebServiceOutputColumn - Describes an output column for the Azure Machine Learning web service endpoint. +type AzureMachineLearningWebServiceOutputColumn struct { // The (Azure Machine Learning supported) data type of the output column. A list of valid Azure Machine Learning data types // are described at https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx . DataType *string @@ -459,9 +322,6 @@ func (a *AzureSQLReferenceInputDataSource) GetReferenceInputDataSource() *Refere // AzureSQLReferenceInputDataSourceProperties - The properties that are associated with SQL DB input containing reference // data. Required on PUT (CreateOrReplace) requests. type AzureSQLReferenceInputDataSourceProperties struct { - // Authentication Mode. - AuthenticationMode *AuthenticationMode - // This element is associated with the datasource element. This is the name of the database that output will be written to. Database *string @@ -488,6 +348,9 @@ type AzureSQLReferenceInputDataSourceProperties struct { // will be written to. Server *string + // This element is associated with the datasource element. The name of the table in the Azure SQL database.. + Table *string + // This element is associated with the datasource element. This is the user name that will be used to connect to the SQL Database // instance. User *string @@ -495,9 +358,6 @@ type AzureSQLReferenceInputDataSourceProperties struct { // AzureSynapseDataSourceProperties - The properties that are associated with an Azure SQL database data source. type AzureSynapseDataSourceProperties struct { - // Authentication Mode. - AuthenticationMode *AuthenticationMode - // The name of the Azure SQL database. Required on PUT (CreateOrReplace) requests. Database *string @@ -532,9 +392,6 @@ func (a *AzureSynapseOutputDataSource) GetOutputDataSource() *OutputDataSource { // AzureSynapseOutputDataSourceProperties - The properties that are associated with an Azure Synapse output. type AzureSynapseOutputDataSourceProperties struct { - // Authentication Mode. - AuthenticationMode *AuthenticationMode - // The name of the Azure SQL database. Required on PUT (CreateOrReplace) requests. Database *string @@ -643,9 +500,6 @@ type BlobOutputDataSourceProperties struct { // Blob path prefix. BlobPathPrefix *string - // Blob write mode. - BlobWriteMode *BlobWriteMode - // The name of a container within the associated Storage account. This container contains either the blob(s) to be read from // or written to. Required on PUT (CreateOrReplace) requests. Container *string @@ -688,9 +542,6 @@ type BlobReferenceInputDataSourceProperties struct { // Authentication Mode. AuthenticationMode *AuthenticationMode - // The name of the blob input. - BlobName *string - // The name of a container within the associated Storage account. This container contains either the blob(s) to be read from // or written to. Required on PUT (CreateOrReplace) requests. Container *string @@ -698,15 +549,6 @@ type BlobReferenceInputDataSourceProperties struct { // The date format. Wherever {date} appears in pathPattern, the value of this property is used as the date format instead. DateFormat *string - // The path pattern of the delta snapshot. - DeltaPathPattern *string - - // The interval that the user generates a delta snapshot of this reference blob input data source. - DeltaSnapshotRefreshRate *string - - // The refresh interval of the blob input data source. - FullSnapshotRefreshRate *string - // The blob path pattern. Not a regular expression. It represents a pattern against which blob names will be matched to determine // whether or not they should be included as input or output to the job. See // https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output @@ -714,9 +556,6 @@ type BlobReferenceInputDataSourceProperties struct { // and example. PathPattern *string - // The partition count of the blob input data source. Range 1 - 256. - SourcePartitionCount *int32 - // A list of one or more Azure Storage accounts. Required on PUT (CreateOrReplace) requests. StorageAccounts []*StorageAccount @@ -799,64 +638,6 @@ type CSVSerializationProperties struct { FieldDelimiter *string } -// CSharpFunctionBinding - The binding to a CSharp function. -type CSharpFunctionBinding struct { - // REQUIRED; Indicates the function binding type. - Type *string - - // The binding properties associated with a CSharp function. - Properties *CSharpFunctionBindingProperties -} - -// GetFunctionBinding implements the FunctionBindingClassification interface for type CSharpFunctionBinding. -func (c *CSharpFunctionBinding) GetFunctionBinding() *FunctionBinding { - return &FunctionBinding{ - Type: c.Type, - } -} - -// CSharpFunctionBindingProperties - The binding properties associated with a CSharp function. -type CSharpFunctionBindingProperties struct { - // The Csharp code containing a single function definition. - Class *string - - // The Csharp code containing a single function definition. - DllPath *string - - // The Csharp code containing a single function definition. - Method *string - - // Refresh modes for Stream Analytics functions. - UpdateMode *UpdateMode -} - -// CSharpFunctionBindingRetrievalProperties - The binding retrieval properties associated with a CSharp function. -type CSharpFunctionBindingRetrievalProperties struct { - // The CSharp code containing a single function definition. - Script *string - - // The function type. - UdfType *string -} - -// CSharpFunctionRetrieveDefaultDefinitionParameters - The parameters needed to retrieve the default function definition for -// a CSharp function. -type CSharpFunctionRetrieveDefaultDefinitionParameters struct { - // REQUIRED; Indicates the function binding type. - BindingType *string - - // The binding retrieval properties associated with a CSharp function. - BindingRetrievalProperties *CSharpFunctionBindingRetrievalProperties -} - -// GetFunctionRetrieveDefaultDefinitionParameters implements the FunctionRetrieveDefaultDefinitionParametersClassification -// interface for type CSharpFunctionRetrieveDefaultDefinitionParameters. -func (c *CSharpFunctionRetrieveDefaultDefinitionParameters) GetFunctionRetrieveDefaultDefinitionParameters() *FunctionRetrieveDefaultDefinitionParameters { - return &FunctionRetrieveDefaultDefinitionParameters{ - BindingType: c.BindingType, - } -} - // Cluster - A Stream Analytics Cluster object type Cluster struct { // The geo-location where the resource lives @@ -953,83 +734,12 @@ type ClusterSKU struct { Name *ClusterSKUName } -// CompileQuery - The query compilation object which defines the input, output, and transformation for the query compilation. -type CompileQuery struct { - // REQUIRED; Describes the type of the job. Valid values are Cloud and 'Edge'. - JobType *JobType - - // REQUIRED; The query to compile. - Query *string - - // The query to compile. - CompatibilityLevel *CompatibilityLevel - - // The functions for the query compilation. - Functions []*QueryFunction - - // The inputs for the query compilation. - Inputs []*QueryInput -} - // Compression - Describes how input data is compressed type Compression struct { // REQUIRED; Indicates the type of compression that the input uses. Required on PUT (CreateOrReplace) requests. Type *CompressionType } -// CustomClrSerialization - Describes how data from an input is serialized or how data is serialized when written to an output -// in custom format. -type CustomClrSerialization struct { - // REQUIRED; Indicates the type of serialization that the input or output uses. Required on PUT (CreateOrReplace) requests. - Type *EventSerializationType - - // The properties that are associated with the CustomClr serialization type. Required on PUT (CreateOrReplace) requests. - Properties *CustomClrSerializationProperties -} - -// GetSerialization implements the SerializationClassification interface for type CustomClrSerialization. -func (c *CustomClrSerialization) GetSerialization() *Serialization { - return &Serialization{ - Type: c.Type, - } -} - -// CustomClrSerializationProperties - The properties that are associated with the CustomClr serialization type. -type CustomClrSerializationProperties struct { - // The serialization class name. - SerializationClassName *string - - // The serialization library path. - SerializationDllPath *string -} - -// DeltaSerialization - Describes how data from an input is serialized or how data is serialized when written to an output -// in Delta Lake format. -type DeltaSerialization struct { - // REQUIRED; Indicates the type of serialization that the input or output uses. Required on PUT (CreateOrReplace) requests. - Type *EventSerializationType - - // The properties that are associated with the Delta Lake serialization type. Required on PUT (CreateOrReplace) requests. - Properties *DeltaSerializationProperties -} - -// GetSerialization implements the SerializationClassification interface for type DeltaSerialization. -func (d *DeltaSerialization) GetSerialization() *Serialization { - return &Serialization{ - Type: d.Type, - } -} - -// DeltaSerializationProperties - The properties that are associated with the Delta Lake serialization type. -type DeltaSerializationProperties struct { - // REQUIRED; Specifies the path of the Delta Lake table that the output will be written to. - DeltaTablePath *string - - // Specifies the names of the columns for which the Delta Lake table will be partitioned. We are only supporting 1 partition - // column, but keeping it as an array for extensibility. - PartitionColumns []*string -} - // DiagnosticCondition - Condition applicable to the resource, or to the job overall, that warrant customer attention. type DiagnosticCondition struct { // READ-ONLY; The opaque diagnostic code. @@ -1075,9 +785,6 @@ type DocumentDbOutputDataSourceProperties struct { // The account key for the DocumentDB account. Required on PUT (CreateOrReplace) requests. AccountKey *string - // Authentication Mode. - AuthenticationMode *AuthenticationMode - // The collection name pattern for the collections to be used. The collection name format can be constructed using the optional // {partition} token, where partitions start from 0. See the DocumentDB // section of https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for more information. Required @@ -1138,38 +845,6 @@ type ErrorResponse struct { Message *string } -// EventGridStreamInputDataSource - Describes an event grid input data source that contains stream data. -type EventGridStreamInputDataSource struct { - // REQUIRED; Indicates the type of input data source containing stream data. Required on PUT (CreateOrReplace) requests. - Type *string - - // The properties that are associated with an event grid input containing stream data. - Properties *EventGridStreamInputDataSourceProperties -} - -// GetStreamInputDataSource implements the StreamInputDataSourceClassification interface for type EventGridStreamInputDataSource. -func (e *EventGridStreamInputDataSource) GetStreamInputDataSource() *StreamInputDataSource { - return &StreamInputDataSource{ - Type: e.Type, - } -} - -// EventGridStreamInputDataSourceProperties - The properties that are associated with an event grid input containing stream -// data. -type EventGridStreamInputDataSourceProperties struct { - // List of Event Types that are supported by the Event Grid adapter. - EventTypes []*string - - // Indicates the Event Grid schema type. - Schema *EventGridEventSchemaType - - // A list of one or more Azure Storage accounts. Required on PUT (CreateOrReplace) requests. - StorageAccounts []*StorageAccount - - // Subscribers for the Event Grid. Currently only EventHub Subscriber is supported. - Subscriber *EventHubV2StreamInputDataSource -} - // EventHubDataSourceProperties - The common properties that are associated with Event Hub data sources. type EventHubDataSourceProperties struct { // Authentication Mode. @@ -1178,9 +853,6 @@ type EventHubDataSourceProperties struct { // The name of the Event Hub. Required on PUT (CreateOrReplace) requests. EventHubName *string - // The partition count of the event hub data source. Range 1 - 256. - PartitionCount *int32 - // The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT // (CreateOrReplace) requests. ServiceBusNamespace *string @@ -1217,9 +889,6 @@ type EventHubOutputDataSourceProperties struct { // The name of the Event Hub. Required on PUT (CreateOrReplace) requests. EventHubName *string - // The partition count of the event hub data source. Range 1 - 256. - PartitionCount *int32 - // The key/column that is used to determine to which partition to send event data. PartitionKey *string @@ -1267,12 +936,6 @@ type EventHubStreamInputDataSourceProperties struct { // The name of the Event Hub. Required on PUT (CreateOrReplace) requests. EventHubName *string - // The partition count of the event hub data source. Range 1 - 256. - PartitionCount *int32 - - // The number of messages that the message receiver can simultaneously request. - PrefetchCount *int32 - // The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT // (CreateOrReplace) requests. ServiceBusNamespace *string @@ -1317,21 +980,6 @@ func (e *EventHubV2StreamInputDataSource) GetStreamInputDataSource() *StreamInpu } } -// External - The storage account where the custom code artifacts are located. -type External struct { - // The UserCustomCode container. - Container *string - - // The UserCustomCode path. - Path *string - - // The refresh parameters for any/all updatable user defined functions present in the job config. - RefreshConfiguration *RefreshConfiguration - - // The properties that are associated with an Azure Storage account - StorageAccount *StorageAccount -} - // FileReferenceInputDataSource - Describes a file input data source that contains reference data. type FileReferenceInputDataSource struct { // REQUIRED; Indicates the type of input data source containing reference data. Required on PUT (CreateOrReplace) requests. @@ -1497,45 +1145,15 @@ type GatewayMessageBusStreamInputDataSourceProperties struct { Topic *string } -// GetStreamingJobSKUResult - Describes an available SKU information. -type GetStreamingJobSKUResult struct { - // READ-ONLY; Describes scaling information of a SKU. - Capacity *SKUCapacity - - // READ-ONLY; The type of resource the SKU applies to. - ResourceType *ResourceType - - // READ-ONLY; The properties that are associated with a SKU. - SKU *GetStreamingJobSKUResultSKU -} - -// GetStreamingJobSKUResultSKU - The properties that are associated with a SKU. -type GetStreamingJobSKUResultSKU struct { - // The name of the SKU. - Name *SKUName -} - -// GetStreamingJobSKUResults - Result of the request to get streaming job SKUs. -type GetStreamingJobSKUResults struct { - // The list of available SKUs that the streaming job can use. - Value []*GetStreamingJobSKUResult - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - // Identity - Describes how identity is verified type Identity struct { - // The type of identity, can be SystemAssigned or UserAssigned. + // The identity type Type *string - // The user assigned identities associated with the streaming job resource. - UserAssignedIdentities map[string]any - - // READ-ONLY; The principalId of the identity. + // READ-ONLY; The identity principal ID PrincipalID *string - // READ-ONLY; The tenantId of the identity. + // READ-ONLY; The identity tenantId TenantID *string } @@ -1579,9 +1197,6 @@ type InputProperties struct { // requests. Serialization SerializationClassification - // Settings which determine whether to read watermark events. - WatermarkSettings *InputWatermarkProperties - // READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. Diagnostics *Diagnostics @@ -1594,12 +1209,6 @@ type InputProperties struct { // GetInputProperties implements the InputPropertiesClassification interface for type InputProperties. func (i *InputProperties) GetInputProperties() *InputProperties { return i } -// InputWatermarkProperties - Settings which determine whether to read watermark events. -type InputWatermarkProperties struct { - // The input watermark mode. - WatermarkMode *InputWatermarkMode -} - // IoTHubStreamInputDataSource - Describes an IoT Hub input data source that contains stream data. type IoTHubStreamInputDataSource struct { // REQUIRED; Indicates the type of input data source containing stream data. Required on PUT (CreateOrReplace) requests. @@ -1728,15 +1337,6 @@ type JobStorageAccount struct { AuthenticationMode *AuthenticationMode } -// LastOutputEventTimestamp - An output event timestamp. -type LastOutputEventTimestamp struct { - // The last output event time. - LastOutputEventTime *string - - // The time that the last update happened. - LastUpdateTime *string -} - // OAuthBasedDataSourceProperties - The properties that are associated with data sources that use OAuth as their authentication // model. type OAuthBasedDataSourceProperties struct { @@ -1842,9 +1442,6 @@ type OutputProperties struct { // The time frame for filtering Stream Analytics job outputs. TimeWindow *string - // Settings which determine whether to send watermarks to downstream. - WatermarkSettings *OutputWatermarkProperties - // READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. Diagnostics *Diagnostics @@ -1852,20 +1449,6 @@ type OutputProperties struct { // has changed between requests. You can also use it in the If-Match or If-None-Match // headers for write operations for optimistic concurrency. Etag *string - - // READ-ONLY; A list of the last output event times for each output partition. The index of the array corresponds to the partition - // number. - LastOutputEventTimestamps []*LastOutputEventTimestamp -} - -// OutputWatermarkProperties - Settings which determine whether to send watermarks to downstream. -type OutputWatermarkProperties struct { - // Describes the maximal delta between the fastest and slowest partitions, so the out of order window that catches all necessary - // events in downstream jobs is well defined. - MaxWatermarkDifferenceAcrossPartitions *string - - // The output watermark mode. - WatermarkMode *OutputWatermarkMode } // ParquetSerialization - Describes how data from an input is serialized or how data is serialized when written to an output @@ -1885,70 +1468,6 @@ func (p *ParquetSerialization) GetSerialization() *Serialization { } } -// PostgreSQLDataSourceProperties - The properties that are associated with an Azure SQL database data source. -type PostgreSQLDataSourceProperties struct { - // Authentication Mode. - AuthenticationMode *AuthenticationMode - - // The name of the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Database *string - - // Max Writer count, currently only 1(single writer) and 0(based on query partition) are available. Optional on PUT requests. - MaxWriterCount *float32 - - // The password that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Password *string - - // The name of the SQL server containing the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Server *string - - // The name of the table in the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Table *string - - // The user name that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests. - User *string -} - -// PostgreSQLOutputDataSource - Describes a PostgreSQL output data source. -type PostgreSQLOutputDataSource struct { - // REQUIRED; Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. - Type *string - - // The properties that are associated with a PostgreSQL output data source. Required on PUT (CreateOrReplace) requests. - Properties *PostgreSQLOutputDataSourceProperties -} - -// GetOutputDataSource implements the OutputDataSourceClassification interface for type PostgreSQLOutputDataSource. -func (p *PostgreSQLOutputDataSource) GetOutputDataSource() *OutputDataSource { - return &OutputDataSource{ - Type: p.Type, - } -} - -// PostgreSQLOutputDataSourceProperties - The properties that are associated with a PostgreSQL output. -type PostgreSQLOutputDataSourceProperties struct { - // Authentication Mode. - AuthenticationMode *AuthenticationMode - - // The name of the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Database *string - - // Max Writer count, currently only 1(single writer) and 0(based on query partition) are available. Optional on PUT requests. - MaxWriterCount *float32 - - // The password that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Password *string - - // The name of the SQL server containing the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Server *string - - // The name of the table in the Azure SQL database. Required on PUT (CreateOrReplace) requests. - Table *string - - // The user name that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests. - User *string -} - // PowerBIOutputDataSource - Describes a Power BI output data source. type PowerBIOutputDataSource struct { // REQUIRED; Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. @@ -2083,156 +1602,6 @@ type ProxyResource struct { Type *string } -// QueryCompilationError - An error produced by the compiler. -type QueryCompilationError struct { - // READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. - EndColumn *int32 - - // READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. - EndLine *int32 - - // READ-ONLY; Whether the error is not for a specific part but for the entire query. - IsGlobal *bool - - // READ-ONLY; The content of the error message. - Message *string - - // READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. - StartColumn *int32 - - // READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. - StartLine *int32 -} - -// QueryCompilationResult - The result of the query compilation request. -type QueryCompilationResult struct { - // READ-ONLY; Error messages produced by the compiler. - Errors []*QueryCompilationError - - // READ-ONLY; All function names used by the query. - Functions []*string - - // READ-ONLY; All input names used by the query. - Inputs []*string - - // READ-ONLY; All output names used by the query. - Outputs []*string - - // READ-ONLY; Warning messages produced by the compiler. - Warnings []*string -} - -// QueryFunction - A function for the query compilation. -type QueryFunction struct { - // REQUIRED; The type of the function binding. - BindingType *string - - // REQUIRED; The inputs for the function. - Inputs []*FunctionInput - - // REQUIRED; The name of the function. - Name *string - - // REQUIRED; An output for the function. - Output *FunctionOutput - - // REQUIRED; The type of the function. - Type *string -} - -// QueryInput - An input for the query compilation. -type QueryInput struct { - // REQUIRED; The name of the input. - Name *string - - // REQUIRED; The type of the input, can be Stream or Reference. - Type *string -} - -// QueryTestingResult - The result of the query testing request. -type QueryTestingResult struct { - // Error definition properties. - Error *ErrorError - - // READ-ONLY; The SAS URL to the outputs payload. - OutputURI *string - - // READ-ONLY; The status of the query testing request. - Status *QueryTestingResultStatus -} - -// RawInputDatasourceProperties - The properties that are associated with a raw input. -type RawInputDatasourceProperties struct { - // The JSON serialized content of the input data. Either payload or payloadUri must be set, but not both. - Payload *string - - // The SAS URL to a blob containing the JSON serialized content of the input data. Either payload or payloadUri must be set, - // but not both. - PayloadURI *string -} - -// RawOutputDatasource - Describes a raw output data source. This data source type is only applicable/usable when using the -// query testing API. You cannot create a job with this data source type or add an output of this data -// source type to an existing job. -type RawOutputDatasource struct { - // REQUIRED; Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. - Type *string - - // The properties that are associated with a raw output. Required on PUT (CreateOrReplace) requests. - Properties *RawOutputDatasourceProperties -} - -// GetOutputDataSource implements the OutputDataSourceClassification interface for type RawOutputDatasource. -func (r *RawOutputDatasource) GetOutputDataSource() *OutputDataSource { - return &OutputDataSource{ - Type: r.Type, - } -} - -// RawOutputDatasourceProperties - The properties that are associated with a raw output. -type RawOutputDatasourceProperties struct { - // The SAS URL to a blob where the output should be written. If this property is not set, output data will be written into - // a temporary storage, and a SAS URL to that temporary storage will be included in - // the result. - PayloadURI *string -} - -// RawReferenceInputDataSource - Describes a raw input data source that contains reference data. This data source type is -// only applicable/usable when using the query testing API. You cannot create a job with this data source type or -// add an input of this data source type to an existing job. -type RawReferenceInputDataSource struct { - // REQUIRED; Indicates the type of input data source containing reference data. Required on PUT (CreateOrReplace) requests. - Type *string - - // The properties that are associated with a raw input containing reference data. Required on PUT (CreateOrReplace) requests. - Properties *RawInputDatasourceProperties -} - -// GetReferenceInputDataSource implements the ReferenceInputDataSourceClassification interface for type RawReferenceInputDataSource. -func (r *RawReferenceInputDataSource) GetReferenceInputDataSource() *ReferenceInputDataSource { - return &ReferenceInputDataSource{ - Type: r.Type, - } -} - -// RawStreamInputDataSource - Describes a raw input data source that contains stream data. This data source type is only applicable/usable -// when using the query testing API. You cannot create a job with this data source type or add -// an input of this data source type to an existing job. -type RawStreamInputDataSource struct { - // REQUIRED; Indicates the type of input data source containing stream data. Required on PUT (CreateOrReplace) requests. - Type *string - - // The properties that are associated with a raw input. Required on PUT (CreateOrReplace) requests. - Properties *RawInputDatasourceProperties -} - -// GetStreamInputDataSource implements the StreamInputDataSourceClassification interface for type RawStreamInputDataSource. -func (r *RawStreamInputDataSource) GetStreamInputDataSource() *StreamInputDataSource { - return &StreamInputDataSource{ - Type: r.Type, - } -} - // ReferenceInputDataSource - Describes an input data source that contains reference data. type ReferenceInputDataSource struct { // REQUIRED; Indicates the type of input data source containing reference data. Required on PUT (CreateOrReplace) requests. @@ -2260,9 +1629,6 @@ type ReferenceInputProperties struct { // requests. Serialization SerializationClassification - // Settings which determine whether to read watermark events. - WatermarkSettings *InputWatermarkProperties - // READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. Diagnostics *Diagnostics @@ -2275,38 +1641,15 @@ type ReferenceInputProperties struct { // GetInputProperties implements the InputPropertiesClassification interface for type ReferenceInputProperties. func (r *ReferenceInputProperties) GetInputProperties() *InputProperties { return &InputProperties{ - Compression: r.Compression, - Diagnostics: r.Diagnostics, - Etag: r.Etag, - PartitionKey: r.PartitionKey, - Serialization: r.Serialization, - Type: r.Type, - WatermarkSettings: r.WatermarkSettings, + Compression: r.Compression, + Diagnostics: r.Diagnostics, + Etag: r.Etag, + PartitionKey: r.PartitionKey, + Serialization: r.Serialization, + Type: r.Type, } } -// RefreshConfiguration - The refresh parameters for any/all updatable user defined functions present in the job config. -type RefreshConfiguration struct { - // The date format. Wherever {date} appears in pathPattern, the value of this property is used as the date format instead. - DateFormat *string - - // The blob path pattern. Not a regular expression. It represents a pattern against which blob names will be matched to determine - // whether or not they should be included as input or output to the job. See - // https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output - // for a more detailed explanation - // and example. - PathPattern *string - - // The refresh interval. - RefreshInterval *string - - // This property indicates which data refresh option to use, Blocking or Nonblocking. - RefreshType *UpdatableUdfRefreshType - - // The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead. - TimeFormat *string -} - // Resource - The base resource definition type Resource struct { // READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -2330,65 +1673,10 @@ type ResourceTestStatus struct { // SKU - The properties that are associated with a SKU. type SKU struct { - // The capacity of the SKU. - Capacity *int32 - // The name of the SKU. Required on PUT (CreateOrReplace) requests. Name *SKUName } -// SKUCapacity - Describes scaling information of a SKU. -type SKUCapacity struct { - // READ-ONLY; Specifies the valid streaming units a streaming job can scale to. - AllowedValues []*int32 - - // READ-ONLY; Specifies the default streaming units that the streaming job can use. - Default *int32 - - // READ-ONLY; Specifies the maximum streaming units that the streaming job can use. - Maximum *int32 - - // READ-ONLY; Specifies the minimum streaming units that the streaming job can use. - Minimum *int32 - - // READ-ONLY; The scale type applicable to the SKU. - ScaleType *SKUCapacityScaleType -} - -// SampleInput - The stream analytics input to sample. -type SampleInput struct { - // Defaults to the default ASA job compatibility level. Today it is 1.2 - CompatibilityLevel *string - - // Defaults to en-US. - DataLocale *string - - // The SAS URI of the storage blob for service to write the sampled events to. If this parameter is not provided, service - // will write events to he system account and share a temporary SAS URI to it. - EventsURI *string - - // The stream analytics input to sample. - Input *Input -} - -// SampleInputResult - The result of the sample input request. -type SampleInputResult struct { - // Error definition properties. - Error *ErrorError - - // READ-ONLY; Diagnostics messages. E.g. message indicating some partitions from the input have no data. - Diagnostics []*string - - // READ-ONLY; A SAS URL to download the sampled input data. - EventsDownloadURL *string - - // READ-ONLY; The timestamp for the last event in the data. It is in DateTime format. - LastArrivalTime *string - - // READ-ONLY; The status of the sample input request. - Status *SampleInputResultStatus -} - // ScalarFunctionProperties - The properties that are associated with a scalar function. type ScalarFunctionProperties struct { // REQUIRED; Indicates the type of function. @@ -2551,9 +1839,6 @@ type StorageAccount struct { // The name of the Azure Storage account. Required on PUT (CreateOrReplace) requests. AccountName *string - - // Authentication Mode. - AuthenticationMode *AuthenticationMode } // StreamInputDataSource - Describes an input data source that contains stream data. @@ -2583,9 +1868,6 @@ type StreamInputProperties struct { // requests. Serialization SerializationClassification - // Settings which determine whether to read watermark events. - WatermarkSettings *InputWatermarkProperties - // READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. Diagnostics *Diagnostics @@ -2598,19 +1880,18 @@ type StreamInputProperties struct { // GetInputProperties implements the InputPropertiesClassification interface for type StreamInputProperties. func (s *StreamInputProperties) GetInputProperties() *InputProperties { return &InputProperties{ - Compression: s.Compression, - Diagnostics: s.Diagnostics, - Etag: s.Etag, - PartitionKey: s.PartitionKey, - Serialization: s.Serialization, - Type: s.Type, - WatermarkSettings: s.WatermarkSettings, + Compression: s.Compression, + Diagnostics: s.Diagnostics, + Etag: s.Etag, + PartitionKey: s.PartitionKey, + Serialization: s.Serialization, + Type: s.Type, } } // StreamingJob - A streaming job object, containing all information associated with the named streaming job. type StreamingJob struct { - // Describes the managed identity assigned to this job that can be used to authenticate with inputs and outputs. + // Describes the system-assigned managed identity assigned to this job that can be used to authenticate with inputs and outputs. Identity *Identity // The geo-location where the resource lives @@ -2619,9 +1900,6 @@ type StreamingJob struct { // The properties that are associated with a streaming job. Required on PUT (CreateOrReplace) requests. Properties *StreamingJobProperties - // Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. - SKU *SKU - // Resource tags. Tags map[string]*string @@ -2672,9 +1950,6 @@ type StreamingJobProperties struct { // Indicates the policy to apply to events that arrive out of order in the input event stream. EventsOutOfOrderPolicy *EventsOutOfOrderPolicy - // The storage account where the custom code artifacts are located. - Externals *External - // A list of one or more functions for the streaming job. The name property for each function is required when specifying // this property in a PUT request. This property cannot be modify via a PATCH // operation. You must use the PATCH API available for the individual transformation. @@ -2786,45 +2061,6 @@ type SubscriptionQuotasListResult struct { Value []*SubscriptionQuota } -// TestDatasourceResult - The result of the test input or output request. -type TestDatasourceResult struct { - // Error definition properties. - Error *ErrorError - - // READ-ONLY; The status of the sample output request. - Status *TestDatasourceResultStatus -} - -// TestInput - A stream analytics input. -type TestInput struct { - // REQUIRED; The stream analytics input to test. - Input *Input -} - -// TestOutput - A stream analytics output. -type TestOutput struct { - // REQUIRED; The stream analytics output to test. - Output *Output -} - -// TestQuery - The request object for query testing. -type TestQuery struct { - // REQUIRED; Stream analytics job object which defines the input, output, and transformation for the query testing. - StreamingJob *StreamingJob - - // Diagnostics information related to query testing. - Diagnostics *TestQueryDiagnostics -} - -// TestQueryDiagnostics - Diagnostics information related to query testing. -type TestQueryDiagnostics struct { - // REQUIRED; The SAS URI to the container or directory. - WriteURI *string - - // The path to the subdirectory. - Path *string -} - // TrackedResource - The resource model definition for a ARM tracked top level resource type TrackedResource struct { // The geo-location where the resource lives diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go index 82cd942e0e44..a6f5d35bdd1b 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/models_serde.go @@ -81,76 +81,6 @@ func (a *AvroSerialization) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerOutputDataSource. -func (a AzureDataExplorerOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Kusto/clusters/databases" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerOutputDataSource. -func (a *AzureDataExplorerOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureDataExplorerOutputDataSourceProperties. -func (a AzureDataExplorerOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", a.AuthenticationMode) - populate(objectMap, "cluster", a.Cluster) - populate(objectMap, "database", a.Database) - populate(objectMap, "table", a.Table) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerOutputDataSourceProperties. -func (a *AzureDataExplorerOutputDataSourceProperties) 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 "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) - delete(rawMsg, key) - case "cluster": - err = unpopulate(val, "Cluster", &a.Cluster) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &a.Database) - delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &a.Table) - 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 AzureDataLakeStoreOutputDataSource. func (a AzureDataLakeStoreOutputDataSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -315,16 +245,16 @@ func (a *AzureFunctionOutputDataSourceProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceFunctionBinding. -func (a AzureMachineLearningServiceFunctionBinding) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceFunctionBinding. +func (a AzureMachineLearningWebServiceFunctionBinding) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.MachineLearningServices" + objectMap["type"] = "Microsoft.MachineLearning/WebService" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceFunctionBinding. -func (a *AzureMachineLearningServiceFunctionBinding) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBinding. +func (a *AzureMachineLearningWebServiceFunctionBinding) 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) @@ -346,22 +276,19 @@ func (a *AzureMachineLearningServiceFunctionBinding) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceFunctionBindingProperties. -func (a AzureMachineLearningServiceFunctionBindingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceFunctionBindingProperties. +func (a AzureMachineLearningWebServiceFunctionBindingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "apiKey", a.APIKey) populate(objectMap, "batchSize", a.BatchSize) populate(objectMap, "endpoint", a.Endpoint) - populate(objectMap, "inputRequestName", a.InputRequestName) populate(objectMap, "inputs", a.Inputs) - populate(objectMap, "numberOfParallelRequests", a.NumberOfParallelRequests) - populate(objectMap, "outputResponseName", a.OutputResponseName) populate(objectMap, "outputs", a.Outputs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceFunctionBindingProperties. -func (a *AzureMachineLearningServiceFunctionBindingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBindingProperties. +func (a *AzureMachineLearningWebServiceFunctionBindingProperties) 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) @@ -378,18 +305,9 @@ func (a *AzureMachineLearningServiceFunctionBindingProperties) UnmarshalJSON(dat case "endpoint": err = unpopulate(val, "Endpoint", &a.Endpoint) delete(rawMsg, key) - case "inputRequestName": - err = unpopulate(val, "InputRequestName", &a.InputRequestName) - delete(rawMsg, key) case "inputs": err = unpopulate(val, "Inputs", &a.Inputs) delete(rawMsg, key) - case "numberOfParallelRequests": - err = unpopulate(val, "NumberOfParallelRequests", &a.NumberOfParallelRequests) - delete(rawMsg, key) - case "outputResponseName": - err = unpopulate(val, "OutputResponseName", &a.OutputResponseName) - delete(rawMsg, key) case "outputs": err = unpopulate(val, "Outputs", &a.Outputs) delete(rawMsg, key) @@ -401,16 +319,16 @@ func (a *AzureMachineLearningServiceFunctionBindingProperties) UnmarshalJSON(dat return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceFunctionBindingRetrievalProperties. -func (a AzureMachineLearningServiceFunctionBindingRetrievalProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceFunctionBindingRetrievalProperties. +func (a AzureMachineLearningWebServiceFunctionBindingRetrievalProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "executeEndpoint", a.ExecuteEndpoint) objectMap["udfType"] = "Scalar" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceFunctionBindingRetrievalProperties. -func (a *AzureMachineLearningServiceFunctionBindingRetrievalProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionBindingRetrievalProperties. +func (a *AzureMachineLearningWebServiceFunctionBindingRetrievalProperties) 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) @@ -432,16 +350,16 @@ func (a *AzureMachineLearningServiceFunctionBindingRetrievalProperties) Unmarsha return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters. -func (a AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. +func (a AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "bindingRetrievalProperties", a.BindingRetrievalProperties) - objectMap["bindingType"] = "Microsoft.MachineLearningServices" + objectMap["bindingType"] = "Microsoft.MachineLearning/WebService" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters. -func (a *AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters. +func (a *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) 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) @@ -463,8 +381,8 @@ func (a *AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceInputColumn. -func (a AzureMachineLearningServiceInputColumn) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceInputColumn. +func (a AzureMachineLearningWebServiceInputColumn) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataType", a.DataType) populate(objectMap, "mapTo", a.MapTo) @@ -472,8 +390,8 @@ func (a AzureMachineLearningServiceInputColumn) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceInputColumn. -func (a *AzureMachineLearningServiceInputColumn) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceInputColumn. +func (a *AzureMachineLearningWebServiceInputColumn) 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) @@ -498,16 +416,16 @@ func (a *AzureMachineLearningServiceInputColumn) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceInputs. -func (a AzureMachineLearningServiceInputs) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceInputs. +func (a AzureMachineLearningWebServiceInputs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "columnNames", a.ColumnNames) populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceInputs. -func (a *AzureMachineLearningServiceInputs) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceInputs. +func (a *AzureMachineLearningWebServiceInputs) 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) @@ -529,17 +447,16 @@ func (a *AzureMachineLearningServiceInputs) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningServiceOutputColumn. -func (a AzureMachineLearningServiceOutputColumn) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningWebServiceOutputColumn. +func (a AzureMachineLearningWebServiceOutputColumn) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataType", a.DataType) - populate(objectMap, "mapTo", a.MapTo) populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningServiceOutputColumn. -func (a *AzureMachineLearningServiceOutputColumn) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningWebServiceOutputColumn. +func (a *AzureMachineLearningWebServiceOutputColumn) 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) @@ -550,9 +467,6 @@ func (a *AzureMachineLearningServiceOutputColumn) UnmarshalJSON(data []byte) err case "dataType": err = unpopulate(val, "DataType", &a.DataType) delete(rawMsg, key) - case "mapTo": - err = unpopulate(val, "MapTo", &a.MapTo) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) @@ -564,16 +478,22 @@ func (a *AzureMachineLearningServiceOutputColumn) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningStudioFunctionBinding. -func (a AzureMachineLearningStudioFunctionBinding) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureSQLDatabaseDataSourceProperties. +func (a AzureSQLDatabaseDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.MachineLearning/WebService" + populate(objectMap, "authenticationMode", a.AuthenticationMode) + populate(objectMap, "database", a.Database) + populate(objectMap, "maxBatchCount", a.MaxBatchCount) + populate(objectMap, "maxWriterCount", a.MaxWriterCount) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioFunctionBinding. -func (a *AzureMachineLearningStudioFunctionBinding) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseDataSourceProperties. +func (a *AzureSQLDatabaseDataSourceProperties) 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) @@ -581,11 +501,29 @@ func (a *AzureMachineLearningStudioFunctionBinding) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &a.Properties) + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "maxBatchCount": + err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) + delete(rawMsg, key) + case "maxWriterCount": + err = unpopulate(val, "MaxWriterCount", &a.MaxWriterCount) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) delete(rawMsg, key) } if err != nil { @@ -595,19 +533,16 @@ func (a *AzureMachineLearningStudioFunctionBinding) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningStudioFunctionBindingProperties. -func (a AzureMachineLearningStudioFunctionBindingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureSQLDatabaseOutputDataSource. +func (a AzureSQLDatabaseOutputDataSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiKey", a.APIKey) - populate(objectMap, "batchSize", a.BatchSize) - populate(objectMap, "endpoint", a.Endpoint) - populate(objectMap, "inputs", a.Inputs) - populate(objectMap, "outputs", a.Outputs) + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.Sql/Server/Database" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioFunctionBindingProperties. -func (a *AzureMachineLearningStudioFunctionBindingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSource. +func (a *AzureSQLDatabaseOutputDataSource) 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) @@ -615,20 +550,11 @@ func (a *AzureMachineLearningStudioFunctionBindingProperties) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "apiKey": - err = unpopulate(val, "APIKey", &a.APIKey) - delete(rawMsg, key) - case "batchSize": - err = unpopulate(val, "BatchSize", &a.BatchSize) - delete(rawMsg, key) - case "endpoint": - err = unpopulate(val, "Endpoint", &a.Endpoint) - delete(rawMsg, key) - case "inputs": - err = unpopulate(val, "Inputs", &a.Inputs) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "outputs": - err = unpopulate(val, "Outputs", &a.Outputs) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -638,16 +564,22 @@ func (a *AzureMachineLearningStudioFunctionBindingProperties) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningStudioFunctionBindingRetrievalProperties. -func (a AzureMachineLearningStudioFunctionBindingRetrievalProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureSQLDatabaseOutputDataSourceProperties. +func (a AzureSQLDatabaseOutputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "executeEndpoint", a.ExecuteEndpoint) - objectMap["udfType"] = "Scalar" + populate(objectMap, "authenticationMode", a.AuthenticationMode) + populate(objectMap, "database", a.Database) + populate(objectMap, "maxBatchCount", a.MaxBatchCount) + populate(objectMap, "maxWriterCount", a.MaxWriterCount) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioFunctionBindingRetrievalProperties. -func (a *AzureMachineLearningStudioFunctionBindingRetrievalProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSourceProperties. +func (a *AzureSQLDatabaseOutputDataSourceProperties) 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) @@ -655,11 +587,29 @@ func (a *AzureMachineLearningStudioFunctionBindingRetrievalProperties) Unmarshal for key, val := range rawMsg { var err error switch key { - case "executeEndpoint": - err = unpopulate(val, "ExecuteEndpoint", &a.ExecuteEndpoint) + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) delete(rawMsg, key) - case "udfType": - err = unpopulate(val, "UdfType", &a.UdfType) + case "database": + err = unpopulate(val, "Database", &a.Database) + delete(rawMsg, key) + case "maxBatchCount": + err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) + delete(rawMsg, key) + case "maxWriterCount": + err = unpopulate(val, "MaxWriterCount", &a.MaxWriterCount) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) delete(rawMsg, key) } if err != nil { @@ -669,16 +619,16 @@ func (a *AzureMachineLearningStudioFunctionBindingRetrievalProperties) Unmarshal return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters. -func (a AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureSQLReferenceInputDataSource. +func (a AzureSQLReferenceInputDataSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bindingRetrievalProperties", a.BindingRetrievalProperties) - objectMap["bindingType"] = "Microsoft.MachineLearning/WebService" + populate(objectMap, "properties", a.Properties) + objectMap["type"] = "Microsoft.Sql/Server/Database" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters. -func (a *AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSource. +func (a *AzureSQLReferenceInputDataSource) 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) @@ -686,11 +636,11 @@ func (a *AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters) for key, val := range rawMsg { var err error switch key { - case "bindingRetrievalProperties": - err = unpopulate(val, "BindingRetrievalProperties", &a.BindingRetrievalProperties) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "bindingType": - err = unpopulate(val, "BindingType", &a.BindingType) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -700,17 +650,23 @@ func (a *AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningStudioInputColumn. -func (a AzureMachineLearningStudioInputColumn) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureSQLReferenceInputDataSourceProperties. +func (a AzureSQLReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataType", a.DataType) - populate(objectMap, "mapTo", a.MapTo) - populate(objectMap, "name", a.Name) + populate(objectMap, "database", a.Database) + populate(objectMap, "deltaSnapshotQuery", a.DeltaSnapshotQuery) + populate(objectMap, "fullSnapshotQuery", a.FullSnapshotQuery) + populate(objectMap, "password", a.Password) + populate(objectMap, "refreshRate", a.RefreshRate) + populate(objectMap, "refreshType", a.RefreshType) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioInputColumn. -func (a *AzureMachineLearningStudioInputColumn) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSourceProperties. +func (a *AzureSQLReferenceInputDataSourceProperties) 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) @@ -718,14 +674,32 @@ func (a *AzureMachineLearningStudioInputColumn) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "dataType": - err = unpopulate(val, "DataType", &a.DataType) + case "database": + err = unpopulate(val, "Database", &a.Database) delete(rawMsg, key) - case "mapTo": - err = unpopulate(val, "MapTo", &a.MapTo) + case "deltaSnapshotQuery": + err = unpopulate(val, "DeltaSnapshotQuery", &a.DeltaSnapshotQuery) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "fullSnapshotQuery": + err = unpopulate(val, "FullSnapshotQuery", &a.FullSnapshotQuery) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "refreshRate": + err = unpopulate(val, "RefreshRate", &a.RefreshRate) + delete(rawMsg, key) + case "refreshType": + err = unpopulate(val, "RefreshType", &a.RefreshType) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &a.Server) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "user": + err = unpopulate(val, "User", &a.User) delete(rawMsg, key) } if err != nil { @@ -735,16 +709,19 @@ func (a *AzureMachineLearningStudioInputColumn) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureMachineLearningStudioInputs. -func (a AzureMachineLearningStudioInputs) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureSynapseDataSourceProperties. +func (a AzureSynapseDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "columnNames", a.ColumnNames) - populate(objectMap, "name", a.Name) + populate(objectMap, "database", a.Database) + populate(objectMap, "password", a.Password) + populate(objectMap, "server", a.Server) + populate(objectMap, "table", a.Table) + populate(objectMap, "user", a.User) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioInputs. -func (a *AzureMachineLearningStudioInputs) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseDataSourceProperties. +func (a *AzureSynapseDataSourceProperties) 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) @@ -752,308 +729,8 @@ func (a *AzureMachineLearningStudioInputs) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "columnNames": - err = unpopulate(val, "ColumnNames", &a.ColumnNames) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - 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 AzureMachineLearningStudioOutputColumn. -func (a AzureMachineLearningStudioOutputColumn) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataType", a.DataType) - populate(objectMap, "name", a.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMachineLearningStudioOutputColumn. -func (a *AzureMachineLearningStudioOutputColumn) 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 "dataType": - err = unpopulate(val, "DataType", &a.DataType) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - 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 AzureSQLDatabaseDataSourceProperties. -func (a AzureSQLDatabaseDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", a.AuthenticationMode) - populate(objectMap, "database", a.Database) - populate(objectMap, "maxBatchCount", a.MaxBatchCount) - populate(objectMap, "maxWriterCount", a.MaxWriterCount) - populate(objectMap, "password", a.Password) - populate(objectMap, "server", a.Server) - populate(objectMap, "table", a.Table) - populate(objectMap, "user", a.User) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseDataSourceProperties. -func (a *AzureSQLDatabaseDataSourceProperties) 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 "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &a.Database) - delete(rawMsg, key) - case "maxBatchCount": - err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) - delete(rawMsg, key) - case "maxWriterCount": - err = unpopulate(val, "MaxWriterCount", &a.MaxWriterCount) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &a.Password) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &a.Server) - delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &a.Table) - delete(rawMsg, key) - case "user": - err = unpopulate(val, "User", &a.User) - 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 AzureSQLDatabaseOutputDataSource. -func (a AzureSQLDatabaseOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Sql/Server/Database" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSource. -func (a *AzureSQLDatabaseOutputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureSQLDatabaseOutputDataSourceProperties. -func (a AzureSQLDatabaseOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", a.AuthenticationMode) - populate(objectMap, "database", a.Database) - populate(objectMap, "maxBatchCount", a.MaxBatchCount) - populate(objectMap, "maxWriterCount", a.MaxWriterCount) - populate(objectMap, "password", a.Password) - populate(objectMap, "server", a.Server) - populate(objectMap, "table", a.Table) - populate(objectMap, "user", a.User) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseOutputDataSourceProperties. -func (a *AzureSQLDatabaseOutputDataSourceProperties) 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 "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &a.Database) - delete(rawMsg, key) - case "maxBatchCount": - err = unpopulate(val, "MaxBatchCount", &a.MaxBatchCount) - delete(rawMsg, key) - case "maxWriterCount": - err = unpopulate(val, "MaxWriterCount", &a.MaxWriterCount) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &a.Password) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &a.Server) - delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &a.Table) - delete(rawMsg, key) - case "user": - err = unpopulate(val, "User", &a.User) - 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 AzureSQLReferenceInputDataSource. -func (a AzureSQLReferenceInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - objectMap["type"] = "Microsoft.Sql/Server/Database" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSource. -func (a *AzureSQLReferenceInputDataSource) 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 "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - 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 AzureSQLReferenceInputDataSourceProperties. -func (a AzureSQLReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", a.AuthenticationMode) - populate(objectMap, "database", a.Database) - populate(objectMap, "deltaSnapshotQuery", a.DeltaSnapshotQuery) - populate(objectMap, "fullSnapshotQuery", a.FullSnapshotQuery) - populate(objectMap, "password", a.Password) - populate(objectMap, "refreshRate", a.RefreshRate) - populate(objectMap, "refreshType", a.RefreshType) - populate(objectMap, "server", a.Server) - populate(objectMap, "user", a.User) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLReferenceInputDataSourceProperties. -func (a *AzureSQLReferenceInputDataSourceProperties) 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 "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &a.Database) - delete(rawMsg, key) - case "deltaSnapshotQuery": - err = unpopulate(val, "DeltaSnapshotQuery", &a.DeltaSnapshotQuery) - delete(rawMsg, key) - case "fullSnapshotQuery": - err = unpopulate(val, "FullSnapshotQuery", &a.FullSnapshotQuery) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &a.Password) - delete(rawMsg, key) - case "refreshRate": - err = unpopulate(val, "RefreshRate", &a.RefreshRate) - delete(rawMsg, key) - case "refreshType": - err = unpopulate(val, "RefreshType", &a.RefreshType) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &a.Server) - delete(rawMsg, key) - case "user": - err = unpopulate(val, "User", &a.User) - 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 AzureSynapseDataSourceProperties. -func (a AzureSynapseDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", a.AuthenticationMode) - populate(objectMap, "database", a.Database) - populate(objectMap, "password", a.Password) - populate(objectMap, "server", a.Server) - populate(objectMap, "table", a.Table) - populate(objectMap, "user", a.User) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseDataSourceProperties. -func (a *AzureSynapseDataSourceProperties) 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 "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &a.Database) + case "database": + err = unpopulate(val, "Database", &a.Database) delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &a.Password) @@ -1109,7 +786,6 @@ func (a *AzureSynapseOutputDataSource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureSynapseOutputDataSourceProperties. func (a AzureSynapseOutputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", a.AuthenticationMode) populate(objectMap, "database", a.Database) populate(objectMap, "password", a.Password) populate(objectMap, "server", a.Server) @@ -1127,9 +803,6 @@ func (a *AzureSynapseOutputDataSourceProperties) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &a.AuthenticationMode) - delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &a.Database) delete(rawMsg, key) @@ -1318,7 +991,6 @@ func (b BlobOutputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationMode", b.AuthenticationMode) populate(objectMap, "blobPathPrefix", b.BlobPathPrefix) - populate(objectMap, "blobWriteMode", b.BlobWriteMode) populate(objectMap, "container", b.Container) populate(objectMap, "dateFormat", b.DateFormat) populate(objectMap, "pathPattern", b.PathPattern) @@ -1342,9 +1014,6 @@ func (b *BlobOutputDataSourceProperties) UnmarshalJSON(data []byte) error { case "blobPathPrefix": err = unpopulate(val, "BlobPathPrefix", &b.BlobPathPrefix) delete(rawMsg, key) - case "blobWriteMode": - err = unpopulate(val, "BlobWriteMode", &b.BlobWriteMode) - delete(rawMsg, key) case "container": err = unpopulate(val, "Container", &b.Container) delete(rawMsg, key) @@ -1403,14 +1072,9 @@ func (b *BlobReferenceInputDataSource) UnmarshalJSON(data []byte) error { func (b BlobReferenceInputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationMode", b.AuthenticationMode) - populate(objectMap, "blobName", b.BlobName) populate(objectMap, "container", b.Container) populate(objectMap, "dateFormat", b.DateFormat) - populate(objectMap, "deltaPathPattern", b.DeltaPathPattern) - populate(objectMap, "deltaSnapshotRefreshRate", b.DeltaSnapshotRefreshRate) - populate(objectMap, "fullSnapshotRefreshRate", b.FullSnapshotRefreshRate) populate(objectMap, "pathPattern", b.PathPattern) - populate(objectMap, "sourcePartitionCount", b.SourcePartitionCount) populate(objectMap, "storageAccounts", b.StorageAccounts) populate(objectMap, "timeFormat", b.TimeFormat) return json.Marshal(objectMap) @@ -1428,30 +1092,15 @@ func (b *BlobReferenceInputDataSourceProperties) UnmarshalJSON(data []byte) erro case "authenticationMode": err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) delete(rawMsg, key) - case "blobName": - err = unpopulate(val, "BlobName", &b.BlobName) - delete(rawMsg, key) case "container": err = unpopulate(val, "Container", &b.Container) delete(rawMsg, key) case "dateFormat": err = unpopulate(val, "DateFormat", &b.DateFormat) delete(rawMsg, key) - case "deltaPathPattern": - err = unpopulate(val, "DeltaPathPattern", &b.DeltaPathPattern) - delete(rawMsg, key) - case "deltaSnapshotRefreshRate": - err = unpopulate(val, "DeltaSnapshotRefreshRate", &b.DeltaSnapshotRefreshRate) - delete(rawMsg, key) - case "fullSnapshotRefreshRate": - err = unpopulate(val, "FullSnapshotRefreshRate", &b.FullSnapshotRefreshRate) - delete(rawMsg, key) case "pathPattern": err = unpopulate(val, "PathPattern", &b.PathPattern) delete(rawMsg, key) - case "sourcePartitionCount": - err = unpopulate(val, "SourcePartitionCount", &b.SourcePartitionCount) - delete(rawMsg, key) case "storageAccounts": err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) delete(rawMsg, key) @@ -1510,186 +1159,54 @@ func (b BlobStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BlobStreamInputDataSourceProperties. -func (b *BlobStreamInputDataSourceProperties) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) - delete(rawMsg, key) - case "container": - err = unpopulate(val, "Container", &b.Container) - delete(rawMsg, key) - case "dateFormat": - err = unpopulate(val, "DateFormat", &b.DateFormat) - delete(rawMsg, key) - case "pathPattern": - err = unpopulate(val, "PathPattern", &b.PathPattern) - delete(rawMsg, key) - case "sourcePartitionCount": - err = unpopulate(val, "SourcePartitionCount", &b.SourcePartitionCount) - delete(rawMsg, key) - case "storageAccounts": - err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) - delete(rawMsg, key) - case "timeFormat": - err = unpopulate(val, "TimeFormat", &b.TimeFormat) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CSVSerialization. -func (c CSVSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - objectMap["type"] = EventSerializationTypeCSV - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerialization. -func (c *CSVSerialization) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CSVSerializationProperties. -func (c CSVSerializationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encoding", c.Encoding) - populate(objectMap, "fieldDelimiter", c.FieldDelimiter) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerializationProperties. -func (c *CSVSerializationProperties) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encoding": - err = unpopulate(val, "Encoding", &c.Encoding) - delete(rawMsg, key) - case "fieldDelimiter": - err = unpopulate(val, "FieldDelimiter", &c.FieldDelimiter) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CSharpFunctionBinding. -func (c CSharpFunctionBinding) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - objectMap["type"] = "Microsoft.StreamAnalytics/CLRUdf" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CSharpFunctionBinding. -func (c *CSharpFunctionBinding) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CSharpFunctionBindingProperties. -func (c CSharpFunctionBindingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "class", c.Class) - populate(objectMap, "dllPath", c.DllPath) - populate(objectMap, "method", c.Method) - populate(objectMap, "updateMode", c.UpdateMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CSharpFunctionBindingProperties. -func (c *CSharpFunctionBindingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobStreamInputDataSourceProperties. +func (b *BlobStreamInputDataSourceProperties) 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "class": - err = unpopulate(val, "Class", &c.Class) + case "authenticationMode": + err = unpopulate(val, "AuthenticationMode", &b.AuthenticationMode) + delete(rawMsg, key) + case "container": + err = unpopulate(val, "Container", &b.Container) + delete(rawMsg, key) + case "dateFormat": + err = unpopulate(val, "DateFormat", &b.DateFormat) delete(rawMsg, key) - case "dllPath": - err = unpopulate(val, "DllPath", &c.DllPath) + case "pathPattern": + err = unpopulate(val, "PathPattern", &b.PathPattern) + delete(rawMsg, key) + case "sourcePartitionCount": + err = unpopulate(val, "SourcePartitionCount", &b.SourcePartitionCount) delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &c.Method) + case "storageAccounts": + err = unpopulate(val, "StorageAccounts", &b.StorageAccounts) delete(rawMsg, key) - case "updateMode": - err = unpopulate(val, "UpdateMode", &c.UpdateMode) + case "timeFormat": + err = unpopulate(val, "TimeFormat", &b.TimeFormat) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CSharpFunctionBindingRetrievalProperties. -func (c CSharpFunctionBindingRetrievalProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CSVSerialization. +func (c CSVSerialization) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "script", c.Script) - objectMap["udfType"] = "Scalar" + populate(objectMap, "properties", c.Properties) + objectMap["type"] = EventSerializationTypeCSV return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CSharpFunctionBindingRetrievalProperties. -func (c *CSharpFunctionBindingRetrievalProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerialization. +func (c *CSVSerialization) 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", c, err) @@ -1697,11 +1214,11 @@ func (c *CSharpFunctionBindingRetrievalProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "script": - err = unpopulate(val, "Script", &c.Script) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "udfType": - err = unpopulate(val, "UdfType", &c.UdfType) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -1711,16 +1228,16 @@ func (c *CSharpFunctionBindingRetrievalProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type CSharpFunctionRetrieveDefaultDefinitionParameters. -func (c CSharpFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CSVSerializationProperties. +func (c CSVSerializationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bindingRetrievalProperties", c.BindingRetrievalProperties) - objectMap["bindingType"] = "Microsoft.StreamAnalytics/CLRUdf" + populate(objectMap, "encoding", c.Encoding) + populate(objectMap, "fieldDelimiter", c.FieldDelimiter) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CSharpFunctionRetrieveDefaultDefinitionParameters. -func (c *CSharpFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CSVSerializationProperties. +func (c *CSVSerializationProperties) 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", c, err) @@ -1728,11 +1245,11 @@ func (c *CSharpFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(data [ for key, val := range rawMsg { var err error switch key { - case "bindingRetrievalProperties": - err = unpopulate(val, "BindingRetrievalProperties", &c.BindingRetrievalProperties) + case "encoding": + err = unpopulate(val, "Encoding", &c.Encoding) delete(rawMsg, key) - case "bindingType": - err = unpopulate(val, "BindingType", &c.BindingType) + case "fieldDelimiter": + err = unpopulate(val, "FieldDelimiter", &c.FieldDelimiter) delete(rawMsg, key) } if err != nil { @@ -1995,49 +1512,6 @@ func (c *ClusterSKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CompileQuery. -func (c CompileQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "compatibilityLevel", c.CompatibilityLevel) - populate(objectMap, "functions", c.Functions) - populate(objectMap, "inputs", c.Inputs) - populate(objectMap, "jobType", c.JobType) - populate(objectMap, "query", c.Query) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CompileQuery. -func (c *CompileQuery) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "compatibilityLevel": - err = unpopulate(val, "CompatibilityLevel", &c.CompatibilityLevel) - delete(rawMsg, key) - case "functions": - err = unpopulate(val, "Functions", &c.Functions) - delete(rawMsg, key) - case "inputs": - err = unpopulate(val, "Inputs", &c.Inputs) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &c.JobType) - delete(rawMsg, key) - case "query": - err = unpopulate(val, "Query", &c.Query) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Compression. func (c Compression) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2065,130 +1539,6 @@ func (c *Compression) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomClrSerialization. -func (c CustomClrSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - objectMap["type"] = EventSerializationTypeCustomClr - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomClrSerialization. -func (c *CustomClrSerialization) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomClrSerializationProperties. -func (c CustomClrSerializationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "serializationClassName", c.SerializationClassName) - populate(objectMap, "serializationDllPath", c.SerializationDllPath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomClrSerializationProperties. -func (c *CustomClrSerializationProperties) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serializationClassName": - err = unpopulate(val, "SerializationClassName", &c.SerializationClassName) - delete(rawMsg, key) - case "serializationDllPath": - err = unpopulate(val, "SerializationDllPath", &c.SerializationDllPath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeltaSerialization. -func (d DeltaSerialization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - objectMap["type"] = EventSerializationTypeDelta - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeltaSerialization. -func (d *DeltaSerialization) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeltaSerializationProperties. -func (d DeltaSerializationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "deltaTablePath", d.DeltaTablePath) - populate(objectMap, "partitionColumns", d.PartitionColumns) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeltaSerializationProperties. -func (d *DeltaSerializationProperties) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deltaTablePath": - err = unpopulate(val, "DeltaTablePath", &d.DeltaTablePath) - delete(rawMsg, key) - case "partitionColumns": - err = unpopulate(val, "PartitionColumns", &d.PartitionColumns) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type DiagnosticCondition. func (d DiagnosticCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2287,7 +1637,6 @@ func (d DocumentDbOutputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accountId", d.AccountID) populate(objectMap, "accountKey", d.AccountKey) - populate(objectMap, "authenticationMode", d.AuthenticationMode) populate(objectMap, "collectionNamePattern", d.CollectionNamePattern) populate(objectMap, "database", d.Database) populate(objectMap, "documentId", d.DocumentID) @@ -2310,9 +1659,6 @@ func (d *DocumentDbOutputDataSourceProperties) UnmarshalJSON(data []byte) error case "accountKey": err = unpopulate(val, "AccountKey", &d.AccountKey) delete(rawMsg, key) - case "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &d.AuthenticationMode) - delete(rawMsg, key) case "collectionNamePattern": err = unpopulate(val, "CollectionNamePattern", &d.CollectionNamePattern) delete(rawMsg, key) @@ -2465,82 +1811,11 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EventGridStreamInputDataSource. -func (e EventGridStreamInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", e.Properties) - objectMap["type"] = "Microsoft.EventGrid/EventSubscriptions" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridStreamInputDataSource. -func (e *EventGridStreamInputDataSource) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventGridStreamInputDataSourceProperties. -func (e EventGridStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eventTypes", e.EventTypes) - populate(objectMap, "schema", e.Schema) - populate(objectMap, "storageAccounts", e.StorageAccounts) - populate(objectMap, "subscriber", e.Subscriber) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridStreamInputDataSourceProperties. -func (e *EventGridStreamInputDataSourceProperties) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eventTypes": - err = unpopulate(val, "EventTypes", &e.EventTypes) - delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &e.Schema) - delete(rawMsg, key) - case "storageAccounts": - err = unpopulate(val, "StorageAccounts", &e.StorageAccounts) - delete(rawMsg, key) - case "subscriber": - err = unpopulate(val, "Subscriber", &e.Subscriber) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type EventHubDataSourceProperties. func (e EventHubDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationMode", e.AuthenticationMode) populate(objectMap, "eventHubName", e.EventHubName) - populate(objectMap, "partitionCount", e.PartitionCount) populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) populate(objectMap, "sharedAccessPolicyKey", e.SharedAccessPolicyKey) populate(objectMap, "sharedAccessPolicyName", e.SharedAccessPolicyName) @@ -2562,9 +1837,6 @@ func (e *EventHubDataSourceProperties) UnmarshalJSON(data []byte) error { case "eventHubName": err = unpopulate(val, "EventHubName", &e.EventHubName) delete(rawMsg, key) - case "partitionCount": - err = unpopulate(val, "PartitionCount", &e.PartitionCount) - delete(rawMsg, key) case "serviceBusNamespace": err = unpopulate(val, "ServiceBusNamespace", &e.ServiceBusNamespace) delete(rawMsg, key) @@ -2618,7 +1890,6 @@ func (e EventHubOutputDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationMode", e.AuthenticationMode) populate(objectMap, "eventHubName", e.EventHubName) - populate(objectMap, "partitionCount", e.PartitionCount) populate(objectMap, "partitionKey", e.PartitionKey) populate(objectMap, "propertyColumns", e.PropertyColumns) populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) @@ -2642,9 +1913,6 @@ func (e *EventHubOutputDataSourceProperties) UnmarshalJSON(data []byte) error { case "eventHubName": err = unpopulate(val, "EventHubName", &e.EventHubName) delete(rawMsg, key) - case "partitionCount": - err = unpopulate(val, "PartitionCount", &e.PartitionCount) - delete(rawMsg, key) case "partitionKey": err = unpopulate(val, "PartitionKey", &e.PartitionKey) delete(rawMsg, key) @@ -2705,8 +1973,6 @@ func (e EventHubStreamInputDataSourceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "authenticationMode", e.AuthenticationMode) populate(objectMap, "consumerGroupName", e.ConsumerGroupName) populate(objectMap, "eventHubName", e.EventHubName) - populate(objectMap, "partitionCount", e.PartitionCount) - populate(objectMap, "prefetchCount", e.PrefetchCount) populate(objectMap, "serviceBusNamespace", e.ServiceBusNamespace) populate(objectMap, "sharedAccessPolicyKey", e.SharedAccessPolicyKey) populate(objectMap, "sharedAccessPolicyName", e.SharedAccessPolicyName) @@ -2731,12 +1997,6 @@ func (e *EventHubStreamInputDataSourceProperties) UnmarshalJSON(data []byte) err case "eventHubName": err = unpopulate(val, "EventHubName", &e.EventHubName) delete(rawMsg, key) - case "partitionCount": - err = unpopulate(val, "PartitionCount", &e.PartitionCount) - delete(rawMsg, key) - case "prefetchCount": - err = unpopulate(val, "PrefetchCount", &e.PrefetchCount) - delete(rawMsg, key) case "serviceBusNamespace": err = unpopulate(val, "ServiceBusNamespace", &e.ServiceBusNamespace) delete(rawMsg, key) @@ -2788,46 +2048,13 @@ func (e *EventHubV2OutputDataSource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EventHubV2StreamInputDataSource. func (e EventHubV2StreamInputDataSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", e.Properties) - objectMap["type"] = "Microsoft.EventHub/EventHub" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubV2StreamInputDataSource. -func (e *EventHubV2StreamInputDataSource) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type External. -func (e External) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "container", e.Container) - populate(objectMap, "path", e.Path) - populate(objectMap, "refreshConfiguration", e.RefreshConfiguration) - populate(objectMap, "storageAccount", e.StorageAccount) + populate(objectMap, "properties", e.Properties) + objectMap["type"] = "Microsoft.EventHub/EventHub" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type External. -func (e *External) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubV2StreamInputDataSource. +func (e *EventHubV2StreamInputDataSource) 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", e, err) @@ -2835,17 +2062,11 @@ func (e *External) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "container": - err = unpopulate(val, "Container", &e.Container) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &e.Path) - delete(rawMsg, key) - case "refreshConfiguration": - err = unpopulate(val, "RefreshConfiguration", &e.RefreshConfiguration) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "storageAccount": - err = unpopulate(val, "StorageAccount", &e.StorageAccount) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { @@ -3308,106 +2529,12 @@ func (g *GatewayMessageBusStreamInputDataSourceProperties) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type GetStreamingJobSKUResult. -func (g GetStreamingJobSKUResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", g.Capacity) - populate(objectMap, "resourceType", g.ResourceType) - populate(objectMap, "sku", g.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GetStreamingJobSKUResult. -func (g *GetStreamingJobSKUResult) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &g.Capacity) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &g.ResourceType) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &g.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GetStreamingJobSKUResultSKU. -func (g GetStreamingJobSKUResultSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", g.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GetStreamingJobSKUResultSKU. -func (g *GetStreamingJobSKUResultSKU) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GetStreamingJobSKUResults. -func (g GetStreamingJobSKUResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GetStreamingJobSKUResults. -func (g *GetStreamingJobSKUResults) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Identity. func (i Identity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "principalId", i.PrincipalID) populate(objectMap, "tenantId", i.TenantID) populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) return json.Marshal(objectMap) } @@ -3429,9 +2556,6 @@ func (i *Identity) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -3519,7 +2643,6 @@ func (i InputProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "partitionKey", i.PartitionKey) populate(objectMap, "serialization", i.Serialization) objectMap["type"] = i.Type - populate(objectMap, "watermarkSettings", i.WatermarkSettings) return json.Marshal(objectMap) } @@ -3550,36 +2673,6 @@ func (i *InputProperties) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) - case "watermarkSettings": - err = unpopulate(val, "WatermarkSettings", &i.WatermarkSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InputWatermarkProperties. -func (i InputWatermarkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "watermarkMode", i.WatermarkMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InputWatermarkProperties. -func (i *InputWatermarkProperties) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "watermarkMode": - err = unpopulate(val, "WatermarkMode", &i.WatermarkMode) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -3879,37 +2972,6 @@ func (j *JobStorageAccount) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LastOutputEventTimestamp. -func (l LastOutputEventTimestamp) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "lastOutputEventTime", l.LastOutputEventTime) - populate(objectMap, "lastUpdateTime", l.LastUpdateTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LastOutputEventTimestamp. -func (l *LastOutputEventTimestamp) 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", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "lastOutputEventTime": - err = unpopulate(val, "LastOutputEventTime", &l.LastOutputEventTime) - delete(rawMsg, key) - case "lastUpdateTime": - err = unpopulate(val, "LastUpdateTime", &l.LastUpdateTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type OAuthBasedDataSourceProperties. func (o OAuthBasedDataSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4153,11 +3215,9 @@ func (o OutputProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "datasource", o.Datasource) populate(objectMap, "diagnostics", o.Diagnostics) populate(objectMap, "etag", o.Etag) - populate(objectMap, "lastOutputEventTimestamps", o.LastOutputEventTimestamps) populate(objectMap, "serialization", o.Serialization) populate(objectMap, "sizeWindow", o.SizeWindow) populate(objectMap, "timeWindow", o.TimeWindow) - populate(objectMap, "watermarkSettings", o.WatermarkSettings) return json.Marshal(objectMap) } @@ -4179,9 +3239,6 @@ func (o *OutputProperties) UnmarshalJSON(data []byte) error { case "etag": err = unpopulate(val, "Etag", &o.Etag) delete(rawMsg, key) - case "lastOutputEventTimestamps": - err = unpopulate(val, "LastOutputEventTimestamps", &o.LastOutputEventTimestamps) - delete(rawMsg, key) case "serialization": o.Serialization, err = unmarshalSerializationClassification(val) delete(rawMsg, key) @@ -4191,40 +3248,6 @@ func (o *OutputProperties) UnmarshalJSON(data []byte) error { case "timeWindow": err = unpopulate(val, "TimeWindow", &o.TimeWindow) delete(rawMsg, key) - case "watermarkSettings": - err = unpopulate(val, "WatermarkSettings", &o.WatermarkSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OutputWatermarkProperties. -func (o OutputWatermarkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxWatermarkDifferenceAcrossPartitions", o.MaxWatermarkDifferenceAcrossPartitions) - populate(objectMap, "watermarkMode", o.WatermarkMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OutputWatermarkProperties. -func (o *OutputWatermarkProperties) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxWatermarkDifferenceAcrossPartitions": - err = unpopulate(val, "MaxWatermarkDifferenceAcrossPartitions", &o.MaxWatermarkDifferenceAcrossPartitions) - delete(rawMsg, key) - case "watermarkMode": - err = unpopulate(val, "WatermarkMode", &o.WatermarkMode) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -4242,152 +3265,19 @@ func (p ParquetSerialization) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements the json.Unmarshaller interface for type ParquetSerialization. -func (p *ParquetSerialization) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PostgreSQLDataSourceProperties. -func (p PostgreSQLDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", p.AuthenticationMode) - populate(objectMap, "database", p.Database) - populate(objectMap, "maxWriterCount", p.MaxWriterCount) - populate(objectMap, "password", p.Password) - populate(objectMap, "server", p.Server) - populate(objectMap, "table", p.Table) - populate(objectMap, "user", p.User) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLDataSourceProperties. -func (p *PostgreSQLDataSourceProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &p.AuthenticationMode) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &p.Database) - delete(rawMsg, key) - case "maxWriterCount": - err = unpopulate(val, "MaxWriterCount", &p.MaxWriterCount) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &p.Password) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &p.Server) - delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &p.Table) - delete(rawMsg, key) - case "user": - err = unpopulate(val, "User", &p.User) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PostgreSQLOutputDataSource. -func (p PostgreSQLOutputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", p.Properties) - objectMap["type"] = "Microsoft.DBForPostgreSQL/servers/databases" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLOutputDataSource. -func (p *PostgreSQLOutputDataSource) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PostgreSQLOutputDataSourceProperties. -func (p PostgreSQLOutputDataSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authenticationMode", p.AuthenticationMode) - populate(objectMap, "database", p.Database) - populate(objectMap, "maxWriterCount", p.MaxWriterCount) - populate(objectMap, "password", p.Password) - populate(objectMap, "server", p.Server) - populate(objectMap, "table", p.Table) - populate(objectMap, "user", p.User) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLOutputDataSourceProperties. -func (p *PostgreSQLOutputDataSourceProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &p.AuthenticationMode) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &p.Database) - delete(rawMsg, key) - case "maxWriterCount": - err = unpopulate(val, "MaxWriterCount", &p.MaxWriterCount) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &p.Password) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &p.Server) - delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &p.Table) +func (p *ParquetSerialization) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "user": - err = unpopulate(val, "User", &p.User) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -4678,397 +3568,47 @@ func (p *PrivateLinkServiceConnectionProperties) UnmarshalJSON(data []byte) erro case "privateLinkServiceId": err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) delete(rawMsg, key) - case "requestMessage": - err = unpopulate(val, "RequestMessage", &p.RequestMessage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryCompilationError. -func (q QueryCompilationError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "endColumn", q.EndColumn) - populate(objectMap, "endLine", q.EndLine) - populate(objectMap, "isGlobal", q.IsGlobal) - populate(objectMap, "message", q.Message) - populate(objectMap, "startColumn", q.StartColumn) - populate(objectMap, "startLine", q.StartLine) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryCompilationError. -func (q *QueryCompilationError) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endColumn": - err = unpopulate(val, "EndColumn", &q.EndColumn) - delete(rawMsg, key) - case "endLine": - err = unpopulate(val, "EndLine", &q.EndLine) - delete(rawMsg, key) - case "isGlobal": - err = unpopulate(val, "IsGlobal", &q.IsGlobal) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &q.Message) - delete(rawMsg, key) - case "startColumn": - err = unpopulate(val, "StartColumn", &q.StartColumn) - delete(rawMsg, key) - case "startLine": - err = unpopulate(val, "StartLine", &q.StartLine) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryCompilationResult. -func (q QueryCompilationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errors", q.Errors) - populate(objectMap, "functions", q.Functions) - populate(objectMap, "inputs", q.Inputs) - populate(objectMap, "outputs", q.Outputs) - populate(objectMap, "warnings", q.Warnings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryCompilationResult. -func (q *QueryCompilationResult) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errors": - err = unpopulate(val, "Errors", &q.Errors) - delete(rawMsg, key) - case "functions": - err = unpopulate(val, "Functions", &q.Functions) - delete(rawMsg, key) - case "inputs": - err = unpopulate(val, "Inputs", &q.Inputs) - delete(rawMsg, key) - case "outputs": - err = unpopulate(val, "Outputs", &q.Outputs) - delete(rawMsg, key) - case "warnings": - err = unpopulate(val, "Warnings", &q.Warnings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryFunction. -func (q QueryFunction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bindingType", q.BindingType) - populate(objectMap, "inputs", q.Inputs) - populate(objectMap, "name", q.Name) - populate(objectMap, "output", q.Output) - populate(objectMap, "type", q.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryFunction. -func (q *QueryFunction) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bindingType": - err = unpopulate(val, "BindingType", &q.BindingType) - delete(rawMsg, key) - case "inputs": - err = unpopulate(val, "Inputs", &q.Inputs) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &q.Name) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &q.Output) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &q.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryInput. -func (q QueryInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", q.Name) - populate(objectMap, "type", q.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryInput. -func (q *QueryInput) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &q.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &q.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QueryTestingResult. -func (q QueryTestingResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", q.Error) - populate(objectMap, "outputUri", q.OutputURI) - populate(objectMap, "status", q.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryTestingResult. -func (q *QueryTestingResult) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &q.Error) - delete(rawMsg, key) - case "outputUri": - err = unpopulate(val, "OutputURI", &q.OutputURI) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &q.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RawInputDatasourceProperties. -func (r RawInputDatasourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "payload", r.Payload) - populate(objectMap, "payloadUri", r.PayloadURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RawInputDatasourceProperties. -func (r *RawInputDatasourceProperties) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "payload": - err = unpopulate(val, "Payload", &r.Payload) - delete(rawMsg, key) - case "payloadUri": - err = unpopulate(val, "PayloadURI", &r.PayloadURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RawOutputDatasource. -func (r RawOutputDatasource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", r.Properties) - objectMap["type"] = "Raw" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RawOutputDatasource. -func (r *RawOutputDatasource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RawOutputDatasourceProperties. -func (r RawOutputDatasourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "payloadUri", r.PayloadURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RawOutputDatasourceProperties. -func (r *RawOutputDatasourceProperties) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "payloadUri": - err = unpopulate(val, "PayloadURI", &r.PayloadURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RawReferenceInputDataSource. -func (r RawReferenceInputDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", r.Properties) - objectMap["type"] = "Raw" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RawReferenceInputDataSource. -func (r *RawReferenceInputDataSource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &p.RequestMessage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RawStreamInputDataSource. -func (r RawStreamInputDataSource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", r.Properties) - objectMap["type"] = "Raw" + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RawStreamInputDataSource. -func (r *RawStreamInputDataSource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil @@ -5111,7 +3651,6 @@ func (r ReferenceInputProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "partitionKey", r.PartitionKey) populate(objectMap, "serialization", r.Serialization) objectMap["type"] = "Reference" - populate(objectMap, "watermarkSettings", r.WatermarkSettings) return json.Marshal(objectMap) } @@ -5145,52 +3684,6 @@ func (r *ReferenceInputProperties) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) - case "watermarkSettings": - err = unpopulate(val, "WatermarkSettings", &r.WatermarkSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RefreshConfiguration. -func (r RefreshConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dateFormat", r.DateFormat) - populate(objectMap, "pathPattern", r.PathPattern) - populate(objectMap, "refreshInterval", r.RefreshInterval) - populate(objectMap, "refreshType", r.RefreshType) - populate(objectMap, "timeFormat", r.TimeFormat) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshConfiguration. -func (r *RefreshConfiguration) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dateFormat": - err = unpopulate(val, "DateFormat", &r.DateFormat) - delete(rawMsg, key) - case "pathPattern": - err = unpopulate(val, "PathPattern", &r.PathPattern) - delete(rawMsg, key) - case "refreshInterval": - err = unpopulate(val, "RefreshInterval", &r.RefreshInterval) - delete(rawMsg, key) - case "refreshType": - err = unpopulate(val, "RefreshType", &r.RefreshType) - delete(rawMsg, key) - case "timeFormat": - err = unpopulate(val, "TimeFormat", &r.TimeFormat) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -5268,7 +3761,6 @@ func (r *ResourceTestStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SKU. func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) populate(objectMap, "name", s.Name) return json.Marshal(objectMap) } @@ -5282,9 +3774,6 @@ func (s *SKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) @@ -5296,131 +3785,6 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUCapacity. -func (s SKUCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowedValues", s.AllowedValues) - populate(objectMap, "default", s.Default) - populate(objectMap, "maximum", s.Maximum) - populate(objectMap, "minimum", s.Minimum) - populate(objectMap, "scaleType", s.ScaleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. -func (s *SKUCapacity) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowedValues": - err = unpopulate(val, "AllowedValues", &s.AllowedValues) - delete(rawMsg, key) - case "default": - err = unpopulate(val, "Default", &s.Default) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &s.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &s.Minimum) - delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &s.ScaleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SampleInput. -func (s SampleInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "compatibilityLevel", s.CompatibilityLevel) - populate(objectMap, "dataLocale", s.DataLocale) - populate(objectMap, "eventsUri", s.EventsURI) - populate(objectMap, "input", s.Input) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SampleInput. -func (s *SampleInput) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "compatibilityLevel": - err = unpopulate(val, "CompatibilityLevel", &s.CompatibilityLevel) - delete(rawMsg, key) - case "dataLocale": - err = unpopulate(val, "DataLocale", &s.DataLocale) - delete(rawMsg, key) - case "eventsUri": - err = unpopulate(val, "EventsURI", &s.EventsURI) - delete(rawMsg, key) - case "input": - err = unpopulate(val, "Input", &s.Input) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SampleInputResult. -func (s SampleInputResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diagnostics", s.Diagnostics) - populate(objectMap, "error", s.Error) - populate(objectMap, "eventsDownloadUrl", s.EventsDownloadURL) - populate(objectMap, "lastArrivalTime", s.LastArrivalTime) - populate(objectMap, "status", s.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SampleInputResult. -func (s *SampleInputResult) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diagnostics": - err = unpopulate(val, "Diagnostics", &s.Diagnostics) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &s.Error) - delete(rawMsg, key) - case "eventsDownloadUrl": - err = unpopulate(val, "EventsDownloadURL", &s.EventsDownloadURL) - delete(rawMsg, key) - case "lastArrivalTime": - err = unpopulate(val, "LastArrivalTime", &s.LastArrivalTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ScalarFunctionProperties. func (s ScalarFunctionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5749,7 +4113,6 @@ func (s StorageAccount) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accountKey", s.AccountKey) populate(objectMap, "accountName", s.AccountName) - populate(objectMap, "authenticationMode", s.AuthenticationMode) return json.Marshal(objectMap) } @@ -5768,9 +4131,6 @@ func (s *StorageAccount) UnmarshalJSON(data []byte) error { case "accountName": err = unpopulate(val, "AccountName", &s.AccountName) delete(rawMsg, key) - case "authenticationMode": - err = unpopulate(val, "AuthenticationMode", &s.AuthenticationMode) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -5816,7 +4176,6 @@ func (s StreamInputProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "partitionKey", s.PartitionKey) populate(objectMap, "serialization", s.Serialization) objectMap["type"] = "Stream" - populate(objectMap, "watermarkSettings", s.WatermarkSettings) return json.Marshal(objectMap) } @@ -5850,9 +4209,6 @@ func (s *StreamInputProperties) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) - case "watermarkSettings": - err = unpopulate(val, "WatermarkSettings", &s.WatermarkSettings) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -5869,7 +4225,6 @@ func (s StreamingJob) MarshalJSON() ([]byte, error) { populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -5899,9 +4254,6 @@ func (s *StreamingJob) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) @@ -5959,7 +4311,6 @@ func (s StreamingJobProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "eventsLateArrivalMaxDelayInSeconds", s.EventsLateArrivalMaxDelayInSeconds) populate(objectMap, "eventsOutOfOrderMaxDelayInSeconds", s.EventsOutOfOrderMaxDelayInSeconds) populate(objectMap, "eventsOutOfOrderPolicy", s.EventsOutOfOrderPolicy) - populate(objectMap, "externals", s.Externals) populate(objectMap, "functions", s.Functions) populate(objectMap, "inputs", s.Inputs) populate(objectMap, "jobId", s.JobID) @@ -6013,9 +4364,6 @@ func (s *StreamingJobProperties) UnmarshalJSON(data []byte) error { case "eventsOutOfOrderPolicy": err = unpopulate(val, "EventsOutOfOrderPolicy", &s.EventsOutOfOrderPolicy) delete(rawMsg, key) - case "externals": - err = unpopulate(val, "Externals", &s.Externals) - delete(rawMsg, key) case "functions": err = unpopulate(val, "Functions", &s.Functions) delete(rawMsg, key) @@ -6198,153 +4546,6 @@ func (s *SubscriptionQuotasListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TestDatasourceResult. -func (t TestDatasourceResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", t.Error) - populate(objectMap, "status", t.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TestDatasourceResult. -func (t *TestDatasourceResult) 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 "error": - err = unpopulate(val, "Error", &t.Error) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) - 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 TestInput. -func (t TestInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "input", t.Input) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TestInput. -func (t *TestInput) 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 "input": - err = unpopulate(val, "Input", &t.Input) - 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 TestOutput. -func (t TestOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "output", t.Output) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TestOutput. -func (t *TestOutput) 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 "output": - err = unpopulate(val, "Output", &t.Output) - 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 TestQuery. -func (t TestQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diagnostics", t.Diagnostics) - populate(objectMap, "streamingJob", t.StreamingJob) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TestQuery. -func (t *TestQuery) 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 "diagnostics": - err = unpopulate(val, "Diagnostics", &t.Diagnostics) - delete(rawMsg, key) - case "streamingJob": - err = unpopulate(val, "StreamingJob", &t.StreamingJob) - 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 TestQueryDiagnostics. -func (t TestQueryDiagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "path", t.Path) - populate(objectMap, "writeUri", t.WriteURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TestQueryDiagnostics. -func (t *TestQueryDiagnostics) 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 "path": - err = unpopulate(val, "Path", &t.Path) - delete(rawMsg, key) - case "writeUri": - err = unpopulate(val, "WriteURI", &t.WriteURI) - 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 TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6487,7 +4688,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client.go index 82860daad2f8..578ff01079a5 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Stream Analytics related operations. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - 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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client_example_test.go deleted file mode 100644 index 9234cbf328fd..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/operations_client_example_test.go +++ /dev/null @@ -1,352 +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 armstreamanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Operation_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.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 = armstreamanalytics.OperationListResult{ - // Value: []*armstreamanalytics.Operation{ - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/locations/quotas/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Subscription Quota"), - // Operation: to.Ptr("Read Stream Analytics Subscription Quota"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Subscription Quota"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/operations/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Operations"), - // Operation: to.Ptr("Read Stream Analytics Operations"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Operations"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/Register/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Register subscription with Stream Analytics Resource Provider"), - // Operation: to.Ptr("Register subscription with Stream Analytics Resource Provider"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Resource Provider"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/Delete"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Delete Stream Analytics Job"), - // Operation: to.Ptr("Delete Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions/Delete"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Delete Stream Analytics Job Function"), - // Operation: to.Ptr("Delete Stream Analytics Job Function"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Function"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions/operationresults/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read operation results for Stream Analytics Job Function"), - // Operation: to.Ptr("Read operation results for Stream Analytics Job Function"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Function"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Job Function"), - // Operation: to.Ptr("Read Stream Analytics Job Function"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Function"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions/RetrieveDefaultDefinition/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Retrieve Default Definition of a Stream Analytics Job Function"), - // Operation: to.Ptr("Retrieve Default Definition of a Stream Analytics Job Function"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Function"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions/Test/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Test Stream Analytics Job Function"), - // Operation: to.Ptr("Test Stream Analytics Job Function"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Function"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/functions/Write"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Write Stream Analytics Job Function"), - // Operation: to.Ptr("Write Stream Analytics Job Function"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Function"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs/Delete"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Delete Stream Analytics Job Input"), - // Operation: to.Ptr("Delete Stream Analytics Job Input"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Input"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs/operationresults/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read operation results for Stream Analytics Job Input"), - // Operation: to.Ptr("Read operation results for Stream Analytics Job Input"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Input"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Job Input"), - // Operation: to.Ptr("Read Stream Analytics Job Input"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Input"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs/Sample/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Sample Stream Analytics Job Input"), - // Operation: to.Ptr("Sample Stream Analytics Job Input"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Input"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs/Test/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Test Stream Analytics Job Input"), - // Operation: to.Ptr("Test Stream Analytics Job Input"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Input"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs/Write"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Write Stream Analytics Job Input"), - // Operation: to.Ptr("Write Stream Analytics Job Input"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Input"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/metricdefinitions/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Metric Definitions"), - // Operation: to.Ptr("Read Metric Definitions"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Metric Definitions"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/operationresults/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read operation results for Stream Analytics Job"), - // Operation: to.Ptr("Read operation results for Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs/Delete"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Delete Stream Analytics Job Output"), - // Operation: to.Ptr("Delete Stream Analytics Job Output"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Output"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs/operationresults/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read operation results for Stream Analytics Job Output"), - // Operation: to.Ptr("Read operation results for Stream Analytics Job Output"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Output"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Job Output"), - // Operation: to.Ptr("Read Stream Analytics Job Output"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Output"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs/Test/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Test Stream Analytics Job Output"), - // Operation: to.Ptr("Test Stream Analytics Job Output"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Output"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs/Write"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Write Stream Analytics Job Output"), - // Operation: to.Ptr("Write Stream Analytics Job Output"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Output"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read diagnostic setting."), - // Operation: to.Ptr("Read diagnostic setting."), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("streamingjobs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Write diagnostic setting."), - // Operation: to.Ptr("Write diagnostic setting."), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("streamingjobs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/PublishEdgePackage/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Publish edge package for Stream Analytics Job"), - // Operation: to.Ptr("Publish edge package for Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Job"), - // Operation: to.Ptr("Read Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/Scale/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Scale Stream Analytics Job"), - // Operation: to.Ptr("Scale Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/Start/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Start Stream Analytics Job"), - // Operation: to.Ptr("Start Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/Stop/action"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Stop Stream Analytics Job"), - // Operation: to.Ptr("Stop Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations/Delete"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Delete Stream Analytics Job Transformation"), - // Operation: to.Ptr("Delete Stream Analytics Job Transformation"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Transformation"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations/Read"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Read Stream Analytics Job Transformation"), - // Operation: to.Ptr("Read Stream Analytics Job Transformation"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Transformation"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations/Write"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Write Stream Analytics Job Transformation"), - // Operation: to.Ptr("Write Stream Analytics Job Transformation"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job Transformation"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/Write"), - // Display: &armstreamanalytics.OperationDisplay{ - // Description: to.Ptr("Write Stream Analytics Job"), - // Operation: to.Ptr("Write Stream Analytics Job"), - // Provider: to.Ptr("Microsoft Azure Stream Analytics"), - // Resource: to.Ptr("Stream Analytics Job"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/options.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/options.go index c433b3ea9f15..7c44711d8520 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/options.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/options.go @@ -252,11 +252,6 @@ type PrivateEndpointsClientListByClusterOptions struct { // placeholder for future optional parameters } -// SKUClientListOptions contains the optional parameters for the SKUClient.NewListPager method. -type SKUClientListOptions struct { - // placeholder for future optional parameters -} - // StreamingJobsClientBeginCreateOrReplaceOptions contains the optional parameters for the StreamingJobsClient.BeginCreateOrReplace // method. type StreamingJobsClientBeginCreateOrReplaceOptions struct { @@ -334,37 +329,6 @@ type StreamingJobsClientUpdateOptions struct { IfMatch *string } -// SubscriptionsClientBeginSampleInputOptions contains the optional parameters for the SubscriptionsClient.BeginSampleInput -// method. -type SubscriptionsClientBeginSampleInputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubscriptionsClientBeginTestInputOptions contains the optional parameters for the SubscriptionsClient.BeginTestInput method. -type SubscriptionsClientBeginTestInputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubscriptionsClientBeginTestOutputOptions contains the optional parameters for the SubscriptionsClient.BeginTestOutput -// method. -type SubscriptionsClientBeginTestOutputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubscriptionsClientBeginTestQueryOptions contains the optional parameters for the SubscriptionsClient.BeginTestQuery method. -type SubscriptionsClientBeginTestQueryOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubscriptionsClientCompileQueryOptions contains the optional parameters for the SubscriptionsClient.CompileQuery method. -type SubscriptionsClientCompileQueryOptions struct { - // placeholder for future optional parameters -} - // SubscriptionsClientListQuotasOptions contains the optional parameters for the SubscriptionsClient.ListQuotas method. type SubscriptionsClientListQuotasOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client.go index b10955083c25..867c4b6d10d7 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client.go @@ -46,7 +46,7 @@ func NewOutputsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrReplace - Creates an output or replaces an already existing output under an existing streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - outputName - The name of the output. @@ -99,15 +99,15 @@ func (client *OutputsClient) createOrReplaceCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, output); err != nil { return nil, err } @@ -129,7 +129,7 @@ func (client *OutputsClient) createOrReplaceHandleResponse(resp *http.Response) // Delete - Deletes an output from the streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - outputName - The name of the output. @@ -179,7 +179,7 @@ func (client *OutputsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *OutputsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets details about the specified output. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - outputName - The name of the output. @@ -239,7 +239,7 @@ func (client *OutputsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *OutputsClient) getHandleResponse(resp *http.Response) (OutputsClie // NewListByStreamingJobPager - Lists all of the outputs under the specified streaming job. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - OutputsClientListByStreamingJobOptions contains the optional parameters for the OutputsClient.NewListByStreamingJobPager @@ -310,7 +310,7 @@ func (client *OutputsClient) listByStreamingJobCreateRequest(ctx context.Context if options != nil && options.Select != nil { reqQP.Set("$select", *options.Select) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *OutputsClient) listByStreamingJobHandleResponse(resp *http.Respons // BeginTest - Tests whether an output’s datasource is reachable and usable by the Azure Stream Analytics service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - outputName - The name of the output. @@ -353,7 +353,7 @@ func (client *OutputsClient) BeginTest(ctx context.Context, resourceGroupName st // Test - Tests whether an output’s datasource is reachable and usable by the Azure Stream Analytics service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *OutputsClient) test(ctx context.Context, resourceGroupName string, jobName string, outputName string, options *OutputsClientBeginTestOptions) (*http.Response, error) { var err error const operationName = "OutputsClient.BeginTest" @@ -399,7 +399,7 @@ func (client *OutputsClient) testCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Output != nil { @@ -415,7 +415,7 @@ func (client *OutputsClient) testCreateRequest(ctx context.Context, resourceGrou // or two properties) an output without affecting the rest the job or output definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - outputName - The name of the output. @@ -470,12 +470,12 @@ func (client *OutputsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, output); err != nil { return nil, err } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client_example_test.go deleted file mode 100644 index 3f27ee94cd62..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/outputs_client_example_test.go +++ /dev/null @@ -1,2337 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_DeltaLake.json -func ExampleOutputsClient_CreateOrReplace_createADeltaLakeOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg", "sjName", "output1221", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.BlobOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - Container: to.Ptr("deltaoutput"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("accountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - }, - }, - Serialization: &armstreamanalytics.DeltaSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeDelta), - Properties: &armstreamanalytics.DeltaSerializationProperties{ - DeltaTablePath: to.Ptr("/folder1/table1"), - PartitionColumns: []*string{ - to.Ptr("column1")}, - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1221"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/output1221"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("deltaoutput"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // }, - // }, - // Serialization: &armstreamanalytics.DeltaSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeDelta), - // Properties: &armstreamanalytics.DeltaSerializationProperties{ - // DeltaTablePath: to.Ptr("/folder1/table1"), - // PartitionColumns: []*string{ - // to.Ptr("column1")}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_DocumentDB.json -func ExampleOutputsClient_CreateOrReplace_createADocumentDbOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg7983", "sj2331", "output3022", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/DocumentDB"), - Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - AccountID: to.Ptr("someAccountId"), - AccountKey: to.Ptr("accountKey=="), - AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - CollectionNamePattern: to.Ptr("collection"), - Database: to.Ptr("db01"), - DocumentID: to.Ptr("documentId"), - PartitionKey: to.Ptr("key"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/DocumentDB"), - // Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - // AccountID: to.Ptr("someAccountId"), - // CollectionNamePattern: to.Ptr("collection"), - // Database: to.Ptr("db01"), - // DocumentID: to.Ptr("documentId"), - // PartitionKey: to.Ptr("key"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_GatewayMessageBus.json -func ExampleOutputsClient_CreateOrReplace_createAGatewayMessageBusOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg7983", "sj2331", "output3022", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.GatewayMessageBusOutputDataSource{ - Type: to.Ptr("GatewayMessageBus"), - Properties: &armstreamanalytics.GatewayMessageBusOutputDataSourceProperties{ - Topic: to.Ptr("EdgeTopic1"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.GatewayMessageBusOutputDataSource{ - // Type: to.Ptr("GatewayMessageBus"), - // Properties: &armstreamanalytics.GatewayMessageBusOutputDataSourceProperties{ - // Topic: to.Ptr("EdgeTopic1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_PostgreSQL.json -func ExampleOutputsClient_CreateOrReplace_createAPostgreSqlOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg7983", "sj2331", "output3022", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.PostgreSQLOutputDataSource{ - Type: to.Ptr("Microsoft.DBForPostgreSQL/servers/databases"), - Properties: &armstreamanalytics.PostgreSQLOutputDataSourceProperties{ - AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - Database: to.Ptr("someDatabase"), - MaxWriterCount: to.Ptr[float32](1), - Password: to.Ptr("somePassword"), - Server: to.Ptr("someServer"), - Table: to.Ptr("someTable"), - User: to.Ptr("user"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.PostgreSQLOutputDataSource{ - // Type: to.Ptr("Microsoft.DBForPostgreSQL/servers/databases"), - // Properties: &armstreamanalytics.PostgreSQLOutputDataSourceProperties{ - // AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - // Database: to.Ptr("someDatabase"), - // MaxWriterCount: to.Ptr[float32](1), - // Server: to.Ptr("someServer"), - // Table: to.Ptr("someTable"), - // User: to.Ptr("user"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_PowerBI.json -func ExampleOutputsClient_CreateOrReplace_createAPowerBiOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg7983", "sj2331", "output3022", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.PowerBIOutputDataSource{ - Type: to.Ptr("PowerBI"), - Properties: &armstreamanalytics.PowerBIOutputDataSourceProperties{ - RefreshToken: to.Ptr("someRefreshToken=="), - TokenUserDisplayName: to.Ptr("Bob Smith"), - TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - Dataset: to.Ptr("someDataset"), - GroupID: to.Ptr("ac40305e-3e8d-43ac-8161-c33799f43e95"), - GroupName: to.Ptr("MyPowerBIGroup"), - Table: to.Ptr("someTable"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.PowerBIOutputDataSource{ - // Type: to.Ptr("PowerBI"), - // Properties: &armstreamanalytics.PowerBIOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // Dataset: to.Ptr("someDataset"), - // GroupID: to.Ptr("ac40305e-3e8d-43ac-8161-c33799f43e95"), - // GroupName: to.Ptr("MyPowerBIGroup"), - // Table: to.Ptr("someTable"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_ServiceBusQueue_Avro.json -func ExampleOutputsClient_CreateOrReplace_createAServiceBusQueueOutputWithAvroSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg3410", "sj5095", "output3456", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.ServiceBusQueueOutputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/Queue"), - Properties: &armstreamanalytics.ServiceBusQueueOutputDataSourceProperties{ - ServiceBusNamespace: to.Ptr("sdktest"), - SharedAccessPolicyKey: to.Ptr("sharedAccessPolicyKey="), - SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - PropertyColumns: []*string{ - to.Ptr("column1"), - to.Ptr("column2")}, - QueueName: to.Ptr("sdkqueue"), - SystemPropertyColumns: map[string]any{ - "MessageId": "col3", - "PartitionKey": "col4", - }, - }, - }, - Serialization: &armstreamanalytics.AvroSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3456"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3410/providers/Microsoft.StreamAnalytics/streamingjobs/sj5095/outputs/output3456"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusQueueOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Queue"), - // Properties: &armstreamanalytics.ServiceBusQueueOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // QueueName: to.Ptr("sdkqueue"), - // }, - // }, - // Serialization: &armstreamanalytics.AvroSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - // Properties: map[string]any{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_ServiceBusTopic_CSV.json -func ExampleOutputsClient_CreateOrReplace_createAServiceBusTopicOutputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg6450", "sj7094", "output7886", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.ServiceBusTopicOutputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/Topic"), - Properties: &armstreamanalytics.ServiceBusTopicOutputDataSourceProperties{ - ServiceBusNamespace: to.Ptr("sdktest"), - SharedAccessPolicyKey: to.Ptr("sharedAccessPolicyKey="), - SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - PropertyColumns: []*string{ - to.Ptr("column1"), - to.Ptr("column2")}, - TopicName: to.Ptr("sdktopic"), - }, - }, - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output7886"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6450/providers/Microsoft.StreamAnalytics/streamingjobs/sj7094/outputs/output7886"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusTopicOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Topic"), - // Properties: &armstreamanalytics.ServiceBusTopicOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // TopicName: to.Ptr("sdktopic"), - // }, - // }, - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_Blob_CSV.json -func ExampleOutputsClient_CreateOrReplace_createABlobOutputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg5023", "sj900", "output1623", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.BlobOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("accountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - BlobPathPrefix: to.Ptr("my/path"), - BlobWriteMode: to.Ptr(armstreamanalytics.BlobWriteModeOnce), - }, - }, - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1623"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg5023/providers/Microsoft.StreamAnalytics/streamingjobs/sj900/outputs/output1623"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_AzureDataExplorer.json -func ExampleOutputsClient_CreateOrReplace_createAnAzureDataExplorerOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg", "sjName", "adxOutput", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureDataExplorerOutputDataSource{ - Type: to.Ptr("Microsoft.Kusto/clusters/databases"), - Properties: &armstreamanalytics.AzureDataExplorerOutputDataSourceProperties{ - AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - Cluster: to.Ptr("https://asakustotest.eastus.kusto.windows.net"), - Database: to.Ptr("dbname"), - Table: to.Ptr("mytable"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("adxOutput"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/7f31cba8-b597-4129-b158-8f21a7395bd0/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/adxOutput"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureDataExplorerOutputDataSource{ - // Type: to.Ptr("Microsoft.Kusto/clusters/databases"), - // Properties: &armstreamanalytics.AzureDataExplorerOutputDataSourceProperties{ - // AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - // Cluster: to.Ptr("https://asakustotest.eastus.kusto.windows.net"), - // Database: to.Ptr("dbname"), - // Table: to.Ptr("mytable"), - // }, - // }, - // Etag: to.Ptr("7b912929-346d-432e-9495-6972dbd63179"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_AzureDataLakeStore_JSON.json -func ExampleOutputsClient_CreateOrReplace_createAnAzureDataLakeStoreOutputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg6912", "sj3310", "output5195", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureDataLakeStoreOutputDataSource{ - Type: to.Ptr("Microsoft.DataLake/Accounts"), - Properties: &armstreamanalytics.AzureDataLakeStoreOutputDataSourceProperties{ - RefreshToken: to.Ptr("someRefreshToken=="), - TokenUserDisplayName: to.Ptr("Bob Smith"), - TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - AccountName: to.Ptr("someaccount"), - DateFormat: to.Ptr("yyyy/MM/dd"), - FilePathPrefix: to.Ptr("{date}/{time}"), - TenantID: to.Ptr("cea4e98b-c798-49e7-8c40-4a2b3beb47dd"), - TimeFormat: to.Ptr("HH"), - }, - }, - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatArray), - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6912/providers/Microsoft.StreamAnalytics/streamingjobs/sj3310/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureDataLakeStoreOutputDataSource{ - // Type: to.Ptr("Microsoft.DataLake/Accounts"), - // Properties: &armstreamanalytics.AzureDataLakeStoreOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // AccountName: to.Ptr("someaccount"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // FilePathPrefix: to.Ptr("{date}/{time}"), - // TenantID: to.Ptr("cea4e98b-c798-49e7-8c40-4a2b3beb47dd"), - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatArray), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_DataWarehouse.json -func ExampleOutputsClient_CreateOrReplace_createAnAzureDataWarehouseOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg", "sjName", "dwOutput", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureSynapseOutputDataSource{ - Type: to.Ptr("Microsoft.Sql/Server/DataWarehouse"), - Properties: &armstreamanalytics.AzureSynapseOutputDataSourceProperties{ - AuthenticationMode: to.Ptr(armstreamanalytics.AuthenticationModeMsi), - Database: to.Ptr("zhayaSQLpool"), - Password: to.Ptr("password123"), - Server: to.Ptr("asatestserver"), - Table: to.Ptr("test2"), - User: to.Ptr("tolladmin"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("dwOutput"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/dwOutput"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSynapseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/DataWarehouse"), - // Properties: &armstreamanalytics.AzureSynapseOutputDataSourceProperties{ - // Database: to.Ptr("zhayaSQLpool"), - // Server: to.Ptr("asatestserver"), - // Table: to.Ptr("test2"), - // User: to.Ptr("tolladmin"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_AzureFunction.json -func ExampleOutputsClient_CreateOrReplace_createAnAzureFunctionOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg", "sjName", "azureFunction1", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureFunctionOutputDataSource{ - Type: to.Ptr("Microsoft.AzureFunction"), - Properties: &armstreamanalytics.AzureFunctionOutputDataSourceProperties{ - FunctionAppName: to.Ptr("functionappforasaautomation"), - FunctionName: to.Ptr("HttpTrigger2"), - MaxBatchCount: to.Ptr[float32](100), - MaxBatchSize: to.Ptr[float32](256), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("azureFunction1"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/7f31cba8-b597-4129-b158-8f21a7395bd0/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/azureFunction1"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureFunctionOutputDataSource{ - // Type: to.Ptr("Microsoft.AzureFunction"), - // Properties: &armstreamanalytics.AzureFunctionOutputDataSourceProperties{ - // FunctionAppName: to.Ptr("functionappforasaautomation"), - // FunctionName: to.Ptr("HttpTrigger2"), - // MaxBatchCount: to.Ptr[float32](100), - // MaxBatchSize: to.Ptr[float32](256), - // }, - // }, - // Etag: to.Ptr("7b912929-346d-432e-9495-6972dbd63179"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_AzureSQL.json -func ExampleOutputsClient_CreateOrReplace_createAnAzureSqlDatabaseOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg2157", "sj6458", "output1755", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - Type: to.Ptr("Microsoft.Sql/Server/Database"), - Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - Database: to.Ptr("someDatabase"), - Password: to.Ptr("somePassword"), - Server: to.Ptr("someServer"), - Table: to.Ptr("someTable"), - User: to.Ptr(""), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1755"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output1755"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("someDatabase"), - // Server: to.Ptr("someServer"), - // Table: to.Ptr("someTable"), - // User: to.Ptr("someUser"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_AzureTable.json -func ExampleOutputsClient_CreateOrReplace_createAnAzureTableOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg5176", "sj2790", "output958", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureTableOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Table"), - Properties: &armstreamanalytics.AzureTableOutputDataSourceProperties{ - AccountKey: to.Ptr("accountKey=="), - AccountName: to.Ptr("someAccountName"), - BatchSize: to.Ptr[int32](25), - ColumnsToRemove: []*string{ - to.Ptr("column1"), - to.Ptr("column2")}, - PartitionKey: to.Ptr("partitionKey"), - RowKey: to.Ptr("rowKey"), - Table: to.Ptr("samples"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output958"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg5176/providers/Microsoft.StreamAnalytics/streamingjobs/sj2790/outputs/output958"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureTableOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Table"), - // Properties: &armstreamanalytics.AzureTableOutputDataSourceProperties{ - // AccountName: to.Ptr("someAccountName"), - // BatchSize: to.Ptr[int32](25), - // ColumnsToRemove: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // PartitionKey: to.Ptr("partitionKey"), - // RowKey: to.Ptr("rowKey"), - // Table: to.Ptr("samples"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_EventHub_JSON.json -func ExampleOutputsClient_CreateOrReplace_createAnEventHubOutputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().CreateOrReplace(ctx, "sjrg6912", "sj3310", "output5195", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.EventHubOutputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - Properties: &armstreamanalytics.EventHubOutputDataSourceProperties{ - ServiceBusNamespace: to.Ptr("sdktest"), - SharedAccessPolicyKey: to.Ptr("sharedAccessPolicyKey="), - SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - EventHubName: to.Ptr("sdkeventhub"), - PartitionKey: to.Ptr("partitionKey"), - }, - }, - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatArray), - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - WatermarkSettings: &armstreamanalytics.OutputWatermarkProperties{ - MaxWatermarkDifferenceAcrossPartitions: to.Ptr("16:14:30"), - WatermarkMode: to.Ptr(armstreamanalytics.OutputWatermarkModeSendCurrentPartitionWatermark), - }, - }, - }, &armstreamanalytics.OutputsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6912/providers/Microsoft.StreamAnalytics/streamingjobs/sj3310/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.EventHubOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // PartitionKey: to.Ptr("partitionKey"), - // }, - // }, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatArray), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_DeltaLake.json -func ExampleOutputsClient_Update_updateADeltaLakeOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg", "sjName", "output1221", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.BlobOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - Container: to.Ptr("deltaoutput2"), - }, - }, - Serialization: &armstreamanalytics.DeltaSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeDelta), - Properties: &armstreamanalytics.DeltaSerializationProperties{ - DeltaTablePath: to.Ptr("/folder1/table2"), - PartitionColumns: []*string{ - to.Ptr("column2")}, - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1221"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/output1221"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("deltaoutput2"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // }, - // }, - // Serialization: &armstreamanalytics.DeltaSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeDelta), - // Properties: &armstreamanalytics.DeltaSerializationProperties{ - // DeltaTablePath: to.Ptr("/folder1/table2"), - // PartitionColumns: []*string{ - // to.Ptr("column2")}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_DocumentDB.json -func ExampleOutputsClient_Update_updateADocumentDbOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg7983", "sj2331", "output3022", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/DocumentDB"), - Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - PartitionKey: to.Ptr("differentPartitionKey"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/DocumentDB"), - // Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - // AccountID: to.Ptr("someAccountId"), - // CollectionNamePattern: to.Ptr("collection"), - // Database: to.Ptr("db01"), - // DocumentID: to.Ptr("documentId"), - // PartitionKey: to.Ptr("differentPartitionKey"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_PowerBI.json -func ExampleOutputsClient_Update_updateAPowerBiOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg7983", "sj2331", "output3022", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.PowerBIOutputDataSource{ - Type: to.Ptr("PowerBI"), - Properties: &armstreamanalytics.PowerBIOutputDataSourceProperties{ - Dataset: to.Ptr("differentDataset"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.PowerBIOutputDataSource{ - // Type: to.Ptr("PowerBI"), - // Properties: &armstreamanalytics.PowerBIOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // Dataset: to.Ptr("differentDataset"), - // GroupID: to.Ptr("ac40305e-3e8d-43ac-8161-c33799f43e95"), - // GroupName: to.Ptr("MyPowerBIGroup"), - // Table: to.Ptr("someTable"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_ServiceBusQueue.json -func ExampleOutputsClient_Update_updateAServiceBusQueueOutputWithAvroSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg3410", "sj5095", "output3456", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.ServiceBusQueueOutputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/Queue"), - Properties: &armstreamanalytics.ServiceBusQueueOutputDataSourceProperties{ - QueueName: to.Ptr("differentQueueName"), - }, - }, - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3456"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3410/providers/Microsoft.StreamAnalytics/streamingjobs/sj5095/outputs/output3456"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusQueueOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Queue"), - // Properties: &armstreamanalytics.ServiceBusQueueOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // QueueName: to.Ptr("differentQueueName"), - // }, - // }, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_ServiceBusTopic.json -func ExampleOutputsClient_Update_updateAServiceBusTopicOutputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg6450", "sj7094", "output7886", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.ServiceBusTopicOutputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/Topic"), - Properties: &armstreamanalytics.ServiceBusTopicOutputDataSourceProperties{ - TopicName: to.Ptr("differentTopicName"), - }, - }, - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr("|"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output7886"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6450/providers/Microsoft.StreamAnalytics/streamingjobs/sj7094/outputs/output7886"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusTopicOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Topic"), - // Properties: &armstreamanalytics.ServiceBusTopicOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // TopicName: to.Ptr("differentTopicName"), - // }, - // }, - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_Blob.json -func ExampleOutputsClient_Update_updateABlobOutputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg5023", "sj900", "output1623", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.BlobOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - Container: to.Ptr("differentContainer"), - }, - }, - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr("|"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1623"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg5023/providers/Microsoft.StreamAnalytics/streamingjobs/sj900/outputs/output1623"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("differentContainer"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_AzureDataLakeStore.json -func ExampleOutputsClient_Update_updateAnAzureDataLakeStoreOutputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg6912", "sj3310", "output5195", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureDataLakeStoreOutputDataSource{ - Type: to.Ptr("Microsoft.DataLake/Accounts"), - Properties: &armstreamanalytics.AzureDataLakeStoreOutputDataSourceProperties{ - AccountName: to.Ptr("differentaccount"), - }, - }, - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6912/providers/Microsoft.StreamAnalytics/streamingjobs/sj3310/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureDataLakeStoreOutputDataSource{ - // Type: to.Ptr("Microsoft.DataLake/Accounts"), - // Properties: &armstreamanalytics.AzureDataLakeStoreOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // AccountName: to.Ptr("differentaccount"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // FilePathPrefix: to.Ptr("{date}/{time}"), - // TenantID: to.Ptr("cea4e98b-c798-49e7-8c40-4a2b3beb47dd"), - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_DataWarehouse.json -func ExampleOutputsClient_Update_updateAnAzureDataWarehouseOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg", "sjName", "dwOutput", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - Type: to.Ptr("Microsoft.Sql/Server/Database"), - Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - Table: to.Ptr("differentTable"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("dwOutput"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/dwOutput"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSynapseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/DataWarehouse"), - // Properties: &armstreamanalytics.AzureSynapseOutputDataSourceProperties{ - // Database: to.Ptr("zhayaSQLpool"), - // Server: to.Ptr("asatestserver"), - // Table: to.Ptr("differentTable"), - // User: to.Ptr("tolladmin"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_AzureFunction.json -func ExampleOutputsClient_Update_updateAnAzureFunctionOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg", "sjName", "azureFunction1", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureFunctionOutputDataSource{ - Type: to.Ptr("Microsoft.AzureFunction"), - Properties: &armstreamanalytics.AzureFunctionOutputDataSourceProperties{ - FunctionName: to.Ptr("differentFunctionName"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("azureFunction1"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/azureFunction1"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureFunctionOutputDataSource{ - // Type: to.Ptr("Microsoft.AzureFunction"), - // Properties: &armstreamanalytics.AzureFunctionOutputDataSourceProperties{ - // FunctionAppName: to.Ptr("functionappforasaautomation"), - // FunctionName: to.Ptr("differentFunctionName"), - // MaxBatchCount: to.Ptr[float32](100), - // MaxBatchSize: to.Ptr[float32](256), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_AzureSQL.json -func ExampleOutputsClient_Update_updateAnAzureSqlDatabaseOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg2157", "sj6458", "output1755", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - Type: to.Ptr("Microsoft.Sql/Server/Database"), - Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - Table: to.Ptr("differentTable"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1755"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output1755"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("someDatabase"), - // Server: to.Ptr("someServer"), - // Table: to.Ptr("differentTable"), - // User: to.Ptr("someUser"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_AzureTable.json -func ExampleOutputsClient_Update_updateAnAzureTableOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg5176", "sj2790", "output958", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureTableOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Table"), - Properties: &armstreamanalytics.AzureTableOutputDataSourceProperties{ - PartitionKey: to.Ptr("differentPartitionKey"), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output958"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg5176/providers/Microsoft.StreamAnalytics/streamingjobs/sj2790/outputs/output958"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureTableOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Table"), - // Properties: &armstreamanalytics.AzureTableOutputDataSourceProperties{ - // AccountName: to.Ptr("someAccountName"), - // BatchSize: to.Ptr[int32](25), - // ColumnsToRemove: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // PartitionKey: to.Ptr("differentPartitionKey"), - // RowKey: to.Ptr("rowKey"), - // Table: to.Ptr("samples"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_EventHub.json -func ExampleOutputsClient_Update_updateAnEventHubOutputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Update(ctx, "sjrg6912", "sj3310", "output5195", armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.EventHubOutputDataSource{ - Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - Properties: &armstreamanalytics.EventHubOutputDataSourceProperties{ - PartitionKey: to.Ptr("differentPartitionKey"), - }, - }, - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - }, - }, &armstreamanalytics.OutputsClientUpdateOptions{IfMatch: 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6912/providers/Microsoft.StreamAnalytics/streamingjobs/sj3310/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.EventHubOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // PartitionKey: to.Ptr("differentPartitionKey"), - // }, - // }, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Delete.json -func ExampleOutputsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewOutputsClient().Delete(ctx, "sjrg2157", "sj6458", "output1755", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DeltaLake.json -func ExampleOutputsClient_Get_getADeltaLakeOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg", "sjName", "output1221", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1221"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/output1221"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("deltaoutput"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // }, - // }, - // Serialization: &armstreamanalytics.DeltaSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeDelta), - // Properties: &armstreamanalytics.DeltaSerializationProperties{ - // DeltaTablePath: to.Ptr("/folder1/table1"), - // PartitionColumns: []*string{ - // to.Ptr("column1")}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DocumentDB.json -func ExampleOutputsClient_Get_getADocumentDbOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg7983", "sj2331", "output3022", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/DocumentDB"), - // Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - // AccountID: to.Ptr("someAccountId"), - // CollectionNamePattern: to.Ptr("collection"), - // Database: to.Ptr("db01"), - // DocumentID: to.Ptr("documentId"), - // PartitionKey: to.Ptr("key"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_PowerBI.json -func ExampleOutputsClient_Get_getAPowerBiOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg7983", "sj2331", "output3022", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg7983/providers/Microsoft.StreamAnalytics/streamingjobs/sj2331/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.PowerBIOutputDataSource{ - // Type: to.Ptr("PowerBI"), - // Properties: &armstreamanalytics.PowerBIOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // Dataset: to.Ptr("someDataset"), - // GroupID: to.Ptr("ac40305e-3e8d-43ac-8161-c33799f43e95"), - // GroupName: to.Ptr("MyPowerBIGroup"), - // Table: to.Ptr("someTable"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_ServiceBusQueue_Avro.json -func ExampleOutputsClient_Get_getAServiceBusQueueOutputWithAvroSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg3410", "sj5095", "output3456", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output3456"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3410/providers/Microsoft.StreamAnalytics/streamingjobs/sj5095/outputs/output3456"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusQueueOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Queue"), - // Properties: &armstreamanalytics.ServiceBusQueueOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // QueueName: to.Ptr("sdkqueue"), - // }, - // }, - // Serialization: &armstreamanalytics.AvroSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeAvro), - // Properties: map[string]any{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_ServiceBusTopic_CSV.json -func ExampleOutputsClient_Get_getAServiceBusTopicOutputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg6450", "sj7094", "output7886", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output7886"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6450/providers/Microsoft.StreamAnalytics/streamingjobs/sj7094/outputs/output7886"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusTopicOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Topic"), - // Properties: &armstreamanalytics.ServiceBusTopicOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // TopicName: to.Ptr("sdktopic"), - // }, - // }, - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_Blob_CSV.json -func ExampleOutputsClient_Get_getABlobOutputWithCsvSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg5023", "sj900", "output1623", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1623"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg5023/providers/Microsoft.StreamAnalytics/streamingjobs/sj900/outputs/output1623"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("state"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr(","), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_AzureDataLakeStore_JSON.json -func ExampleOutputsClient_Get_getAnAzureDataLakeStoreOutputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg6912", "sj3310", "output5195", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6912/providers/Microsoft.StreamAnalytics/streamingjobs/sj3310/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureDataLakeStoreOutputDataSource{ - // Type: to.Ptr("Microsoft.DataLake/Accounts"), - // Properties: &armstreamanalytics.AzureDataLakeStoreOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // AccountName: to.Ptr("someaccount"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // FilePathPrefix: to.Ptr("{date}/{time}"), - // TenantID: to.Ptr("cea4e98b-c798-49e7-8c40-4a2b3beb47dd"), - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatArray), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DataWarehouse.json -func ExampleOutputsClient_Get_getAnAzureDataWarehouseOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg", "sjName", "dwOutput", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("dwOutput"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/dwOutput"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSynapseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/DataWarehouse"), - // Properties: &armstreamanalytics.AzureSynapseOutputDataSourceProperties{ - // Database: to.Ptr("zhayaSQLpool"), - // Server: to.Ptr("asatestserver"), - // Table: to.Ptr("test2"), - // User: to.Ptr("tolladmin"), - // }, - // }, - // Etag: to.Ptr("ce3fb956-0487-4168-af20-1133a59bdc6e"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_AzureFunction.json -func ExampleOutputsClient_Get_getAnAzureFunctionOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg", "sjName", "azureFunction1", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("azureFunction1"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/7f31cba8-b597-4129-b158-8f21a7395bd0/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName/outputs/azureFunction1"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureFunctionOutputDataSource{ - // Type: to.Ptr("Microsoft.AzureFunction"), - // Properties: &armstreamanalytics.AzureFunctionOutputDataSourceProperties{ - // FunctionAppName: to.Ptr("functionappforasaautomation"), - // FunctionName: to.Ptr("HttpTrigger2"), - // MaxBatchCount: to.Ptr[float32](100), - // MaxBatchSize: to.Ptr[float32](256), - // }, - // }, - // Etag: to.Ptr("7b912929-346d-432e-9495-6972dbd63179"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_AzureSQL.json -func ExampleOutputsClient_Get_getAnAzureSqlDatabaseOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg2157", "sj6458", "output1755", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output1755"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output1755"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("someDatabase"), - // Server: to.Ptr("someServer"), - // Table: to.Ptr("someTable"), - // User: to.Ptr("someUser"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_AzureTable.json -func ExampleOutputsClient_Get_getAnAzureTableOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg5176", "sj2790", "output958", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output958"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg5176/providers/Microsoft.StreamAnalytics/streamingjobs/sj2790/outputs/output958"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureTableOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Table"), - // Properties: &armstreamanalytics.AzureTableOutputDataSourceProperties{ - // AccountName: to.Ptr("someAccountName"), - // BatchSize: to.Ptr[int32](25), - // ColumnsToRemove: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // PartitionKey: to.Ptr("partitionKey"), - // RowKey: to.Ptr("rowKey"), - // Table: to.Ptr("samples"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_EventHub_JSON.json -func ExampleOutputsClient_Get_getAnEventHubOutputWithJsonSerialization() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOutputsClient().Get(ctx, "sjrg6912", "sj3310", "output5195", 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.Output = armstreamanalytics.Output{ - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6912/providers/Microsoft.StreamAnalytics/streamingjobs/sj3310/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.EventHubOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // PartitionKey: to.Ptr("partitionKey"), - // }, - // }, - // LastOutputEventTimestamps: []*armstreamanalytics.LastOutputEventTimestamp{ - // { - // LastOutputEventTime: to.Ptr("2009-06-15T13:45:30"), - // LastUpdateTime: to.Ptr("2009-06-15T13:45:30"), - // }, - // { - // LastOutputEventTime: to.Ptr("2009-07-15T13:45:30"), - // LastUpdateTime: to.Ptr("2009-06-15T13:45:30"), - // }}, - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatArray), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_ListByStreamingJob.json -func ExampleOutputsClient_NewListByStreamingJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOutputsClient().NewListByStreamingJobPager("sjrg2157", "sj6458", &armstreamanalytics.OutputsClientListByStreamingJobOptions{Select: 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.OutputListResult = armstreamanalytics.OutputListResult{ - // Value: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("output1755"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output1755"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("someDatabase"), - // Server: to.Ptr("someServer"), - // Table: to.Ptr("differentTable"), - // User: to.Ptr("someUser"), - // }, - // }, - // Etag: to.Ptr("f489d6f3-fcd5-4bcb-b642-81e987ee16d6"), - // }, - // }, - // { - // Name: to.Ptr("output958"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output958"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureTableOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Table"), - // Properties: &armstreamanalytics.AzureTableOutputDataSourceProperties{ - // AccountName: to.Ptr("someAccountName"), - // BatchSize: to.Ptr[int32](25), - // ColumnsToRemove: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // PartitionKey: to.Ptr("differentPartitionKey"), - // RowKey: to.Ptr("rowKey"), - // Table: to.Ptr("samples"), - // }, - // }, - // Etag: to.Ptr("ea1d20bf-6cb3-40bc-bc7b-ec3a7fd5977e"), - // }, - // }, - // { - // Name: to.Ptr("output1623"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output1623"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.BlobOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - // Container: to.Ptr("differentContainer"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // PathPattern: to.Ptr("{date}/{time}"), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("someAccountName"), - // }}, - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Etag: to.Ptr("3a1b2023-79a9-4b33-93e8-f49fc3e573fe"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("output3022"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output3022"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.DocumentDbOutputDataSource{ - // Type: to.Ptr("Microsoft.Storage/DocumentDB"), - // Properties: &armstreamanalytics.DocumentDbOutputDataSourceProperties{ - // AccountID: to.Ptr("someAccountId"), - // CollectionNamePattern: to.Ptr("collection"), - // Database: to.Ptr("db01"), - // DocumentID: to.Ptr("documentId"), - // PartitionKey: to.Ptr("differentPartitionKey"), - // }, - // }, - // Etag: to.Ptr("7849c132-e995-4631-91c3-931606eec432"), - // }, - // }, - // { - // Name: to.Ptr("output5195"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output5195"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.EventHubOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/EventHub"), - // Properties: &armstreamanalytics.EventHubOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // EventHubName: to.Ptr("sdkeventhub"), - // PartitionKey: to.Ptr("differentPartitionKey"), - // }, - // }, - // Etag: to.Ptr("5020de6b-5bb3-4b88-8606-f11fb3c46185"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("output3456"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output3456"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusQueueOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Queue"), - // Properties: &armstreamanalytics.ServiceBusQueueOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // QueueName: to.Ptr("differentQueueName"), - // }, - // }, - // Etag: to.Ptr("429adaec-a777-4750-8a39-8d0c931d801c"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("output7886"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output7886"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.ServiceBusTopicOutputDataSource{ - // Type: to.Ptr("Microsoft.ServiceBus/Topic"), - // Properties: &armstreamanalytics.ServiceBusTopicOutputDataSourceProperties{ - // ServiceBusNamespace: to.Ptr("sdktest"), - // SharedAccessPolicyName: to.Ptr("RootManageSharedAccessKey"), - // PropertyColumns: []*string{ - // to.Ptr("column1"), - // to.Ptr("column2")}, - // TopicName: to.Ptr("differentTopicName"), - // }, - // }, - // Etag: to.Ptr("c1c2007f-45b2-419a-ae7d-4d2148998460"), - // Serialization: &armstreamanalytics.CSVSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - // Properties: &armstreamanalytics.CSVSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // FieldDelimiter: to.Ptr("|"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("output3021"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output3021"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.PowerBIOutputDataSource{ - // Type: to.Ptr("PowerBI"), - // Properties: &armstreamanalytics.PowerBIOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // Dataset: to.Ptr("differentDataset"), - // GroupID: to.Ptr("ac40305e-3e8d-43ac-8161-c33799f43e95"), - // GroupName: to.Ptr("MyPowerBIGroup"), - // Table: to.Ptr("someTable"), - // }, - // }, - // Etag: to.Ptr("4a492191-9672-4178-be10-043b9dbd4b9f"), - // }, - // }, - // { - // Name: to.Ptr("output5196"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg2157/providers/Microsoft.StreamAnalytics/streamingjobs/sj6458/outputs/output5196"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureDataLakeStoreOutputDataSource{ - // Type: to.Ptr("Microsoft.DataLake/Accounts"), - // Properties: &armstreamanalytics.AzureDataLakeStoreOutputDataSourceProperties{ - // TokenUserDisplayName: to.Ptr("Bob Smith"), - // TokenUserPrincipalName: to.Ptr("bobsmith@contoso.com"), - // AccountName: to.Ptr("differentaccount"), - // DateFormat: to.Ptr("yyyy/MM/dd"), - // FilePathPrefix: to.Ptr("{date}/{time}"), - // TenantID: to.Ptr("cea4e98b-c798-49e7-8c40-4a2b3beb47dd"), - // TimeFormat: to.Ptr("HH"), - // }, - // }, - // Etag: to.Ptr("39ab7642-8c1e-48ed-85eb-949068d68002"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Format: to.Ptr(armstreamanalytics.JSONOutputSerializationFormatLineSeparated), - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Test.json -func ExampleOutputsClient_BeginTest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOutputsClient().BeginTest(ctx, "sjrg2157", "sj6458", "output1755", &armstreamanalytics.OutputsClientBeginTestOptions{Output: 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.ResourceTestStatus = armstreamanalytics.ResourceTestStatus{ - // Status: to.Ptr("TestSucceeded"), - // } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.go index 4bae2a41705f..7e8f380dcfbd 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armstreamanalytics import "encoding/json" func unmarshalFunctionBindingClassification(rawMsg json.RawMessage) (FunctionBindingClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -21,11 +21,7 @@ func unmarshalFunctionBindingClassification(rawMsg json.RawMessage) (FunctionBin var b FunctionBindingClassification switch m["type"] { case "Microsoft.MachineLearning/WebService": - b = &AzureMachineLearningStudioFunctionBinding{} - case "Microsoft.MachineLearningServices": - b = &AzureMachineLearningServiceFunctionBinding{} - case "Microsoft.StreamAnalytics/CLRUdf": - b = &CSharpFunctionBinding{} + b = &AzureMachineLearningWebServiceFunctionBinding{} case "Microsoft.StreamAnalytics/JavascriptUdf": b = &JavaScriptFunctionBinding{} default: @@ -38,7 +34,7 @@ func unmarshalFunctionBindingClassification(rawMsg json.RawMessage) (FunctionBin } func unmarshalFunctionPropertiesClassification(rawMsg json.RawMessage) (FunctionPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -61,7 +57,7 @@ func unmarshalFunctionPropertiesClassification(rawMsg json.RawMessage) (Function } func unmarshalInputPropertiesClassification(rawMsg json.RawMessage) (InputPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -84,7 +80,7 @@ func unmarshalInputPropertiesClassification(rawMsg json.RawMessage) (InputProper } func unmarshalOutputDataSourceClassification(rawMsg json.RawMessage) (OutputDataSourceClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -97,14 +93,10 @@ func unmarshalOutputDataSourceClassification(rawMsg json.RawMessage) (OutputData b = &GatewayMessageBusOutputDataSource{} case "Microsoft.AzureFunction": b = &AzureFunctionOutputDataSource{} - case "Microsoft.DBForPostgreSQL/servers/databases": - b = &PostgreSQLOutputDataSource{} case "Microsoft.DataLake/Accounts": b = &AzureDataLakeStoreOutputDataSource{} case "Microsoft.EventHub/EventHub": b = &EventHubV2OutputDataSource{} - case "Microsoft.Kusto/clusters/databases": - b = &AzureDataExplorerOutputDataSource{} case "Microsoft.ServiceBus/EventHub": b = &EventHubOutputDataSource{} case "Microsoft.ServiceBus/Queue": @@ -123,8 +115,6 @@ func unmarshalOutputDataSourceClassification(rawMsg json.RawMessage) (OutputData b = &AzureTableOutputDataSource{} case "PowerBI": b = &PowerBIOutputDataSource{} - case "Raw": - b = &RawOutputDatasource{} default: b = &OutputDataSource{} } @@ -135,7 +125,7 @@ func unmarshalOutputDataSourceClassification(rawMsg json.RawMessage) (OutputData } func unmarshalReferenceInputDataSourceClassification(rawMsg json.RawMessage) (ReferenceInputDataSourceClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -150,8 +140,6 @@ func unmarshalReferenceInputDataSourceClassification(rawMsg json.RawMessage) (Re b = &AzureSQLReferenceInputDataSource{} case "Microsoft.Storage/Blob": b = &BlobReferenceInputDataSource{} - case "Raw": - b = &RawReferenceInputDataSource{} default: b = &ReferenceInputDataSource{} } @@ -162,7 +150,7 @@ func unmarshalReferenceInputDataSourceClassification(rawMsg json.RawMessage) (Re } func unmarshalSerializationClassification(rawMsg json.RawMessage) (SerializationClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -175,10 +163,6 @@ func unmarshalSerializationClassification(rawMsg json.RawMessage) (Serialization b = &AvroSerialization{} case string(EventSerializationTypeCSV): b = &CSVSerialization{} - case string(EventSerializationTypeCustomClr): - b = &CustomClrSerialization{} - case string(EventSerializationTypeDelta): - b = &DeltaSerialization{} case string(EventSerializationTypeJSON): b = &JSONSerialization{} case string(EventSerializationTypeParquet): @@ -193,7 +177,7 @@ func unmarshalSerializationClassification(rawMsg json.RawMessage) (Serialization } func unmarshalStreamInputDataSourceClassification(rawMsg json.RawMessage) (StreamInputDataSourceClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -206,16 +190,12 @@ func unmarshalStreamInputDataSourceClassification(rawMsg json.RawMessage) (Strea b = &GatewayMessageBusStreamInputDataSource{} case "Microsoft.Devices/IotHubs": b = &IoTHubStreamInputDataSource{} - case "Microsoft.EventGrid/EventSubscriptions": - b = &EventGridStreamInputDataSource{} case "Microsoft.EventHub/EventHub": b = &EventHubV2StreamInputDataSource{} case "Microsoft.ServiceBus/EventHub": b = &EventHubStreamInputDataSource{} case "Microsoft.Storage/Blob": b = &BlobStreamInputDataSource{} - case "Raw": - b = &RawStreamInputDataSource{} default: b = &StreamInputDataSource{} } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client.go index 05fbadb0592e..55a5a3458e40 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates a Stream Analytics Private Endpoint or replaces an already existing Private Endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateEndpointName - The name of the private endpoint. @@ -100,15 +100,15 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateEndpoint); err != nil { return nil, err } @@ -127,7 +127,7 @@ func (client *PrivateEndpointsClient) createOrUpdateHandleResponse(resp *http.Re // BeginDelete - Delete the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateEndpointName - The name of the private endpoint. @@ -153,7 +153,7 @@ func (client *PrivateEndpointsClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete the specified private endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginDelete" @@ -199,7 +199,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets information about the specified Private Endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateEndpointName - The name of the private endpoint. @@ -259,7 +259,7 @@ func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (Pr // NewListByClusterPager - Lists the private endpoints in the cluster. // -// Generated from API version 2020-03-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - PrivateEndpointsClientListByClusterOptions contains the optional parameters for the PrivateEndpointsClient.NewListByClusterPager @@ -324,7 +324,7 @@ func (client *PrivateEndpointsClient) listByClusterCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client_example_test.go deleted file mode 100644 index cdba67e17e69..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/privateendpoints_client_example_test.go +++ /dev/null @@ -1,213 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/PrivateEndpoint_Create.json -func ExamplePrivateEndpointsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().CreateOrUpdate(ctx, "sjrg", "testcluster", "testpe", armstreamanalytics.PrivateEndpoint{ - Properties: &armstreamanalytics.PrivateEndpointProperties{ - ManualPrivateLinkServiceConnections: []*armstreamanalytics.PrivateLinkServiceConnection{ - { - Properties: &armstreamanalytics.PrivateLinkServiceConnectionProperties{ - GroupIDs: []*string{ - to.Ptr("groupIdFromResource")}, - PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - }, - }}, - }, - }, &armstreamanalytics.PrivateEndpointsClientCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: 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.PrivateEndpoint = armstreamanalytics.PrivateEndpoint{ - // Name: to.Ptr("An Example Private Endpoint"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters/privateEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/testcluster/privateEndpoints/AnExamplePrivateEndpoint"), - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.PrivateEndpointProperties{ - // CreatedDate: to.Ptr("2020-03-01T01:00Z"), - // ManualPrivateLinkServiceConnections: []*armstreamanalytics.PrivateLinkServiceConnection{ - // { - // Properties: &armstreamanalytics.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armstreamanalytics.PrivateLinkConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/PrivateEndpoint_Get.json -func ExamplePrivateEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointsClient().Get(ctx, "sjrg", "testcluster", "testpe", 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.PrivateEndpoint = armstreamanalytics.PrivateEndpoint{ - // Name: to.Ptr("An Example Private Endpoint"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters/privateEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/testcluster/privateEndpoints/AnExamplePrivateEndpoint"), - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.PrivateEndpointProperties{ - // CreatedDate: to.Ptr("2020-03-01T01:00Z"), - // ManualPrivateLinkServiceConnections: []*armstreamanalytics.PrivateLinkServiceConnection{ - // { - // Properties: &armstreamanalytics.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armstreamanalytics.PrivateLinkConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("This connection request originated from Azure Stream Analytics cluster named \"testcluster\". Please approve this request to allow any Stream Analytics job running on that cluster to access this resource."), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/PrivateEndpoint_Delete.json -func ExamplePrivateEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginDelete(ctx, "sjrg", "testcluster", "testpe", 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2020-03-01-preview/examples/PrivateEndpoint_ListByCluster.json -func ExamplePrivateEndpointsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointsClient().NewListByClusterPager("sjrg", "testcluster", 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.PrivateEndpointListResult = armstreamanalytics.PrivateEndpointListResult{ - // Value: []*armstreamanalytics.PrivateEndpoint{ - // { - // Name: to.Ptr("An Example Private Endpoint"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters/privateEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/testcluster/privateEndpoints/AnExamplePrivateEndpoint"), - // Etag: to.Ptr("F86B9B70-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.PrivateEndpointProperties{ - // CreatedDate: to.Ptr("2020-03-01T01:00Z"), - // ManualPrivateLinkServiceConnections: []*armstreamanalytics.PrivateLinkServiceConnection{ - // { - // Properties: &armstreamanalytics.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armstreamanalytics.PrivateLinkConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // }, - // }, - // { - // Name: to.Ptr("A Different Private Endpoint"), - // Type: to.Ptr("Microsoft.StreamAnalytics/clusters/privateEndpoints"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/clusters/testcluster/privateEndpoints/ADifferentPrivateEndpoint"), - // Etag: to.Ptr("G97C0C81-D5B1-451D-AFC8-0B42D4729B8C"), - // Properties: &armstreamanalytics.PrivateEndpointProperties{ - // CreatedDate: to.Ptr("2020-03-01T01:00Z"), - // ManualPrivateLinkServiceConnections: []*armstreamanalytics.PrivateLinkServiceConnection{ - // { - // Properties: &armstreamanalytics.PrivateLinkServiceConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("groupIdFromResource")}, - // PrivateLinkServiceConnectionState: &armstreamanalytics.PrivateLinkConnectionState{ - // Description: to.Ptr("Awaiting approval"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // PrivateLinkServiceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls"), - // RequestMessage: to.Ptr("Please approve my connection."), - // }, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/response_types.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/responses.go similarity index 90% rename from sdk/resourcemanager/streamanalytics/armstreamanalytics/response_types.go rename to sdk/resourcemanager/streamanalytics/armstreamanalytics/responses.go index 1d6162d106b0..0ee1f99bb288 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/response_types.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/responses.go @@ -227,12 +227,6 @@ type PrivateEndpointsClientListByClusterResponse struct { PrivateEndpointListResult } -// SKUClientListResponse contains the response from method SKUClient.NewListPager. -type SKUClientListResponse struct { - // Result of the request to get streaming job SKUs. - GetStreamingJobSKUResults -} - // StreamingJobsClientCreateOrReplaceResponse contains the response from method StreamingJobsClient.BeginCreateOrReplace. type StreamingJobsClientCreateOrReplaceResponse struct { // A streaming job object, containing all information associated with the named streaming job. @@ -289,42 +283,12 @@ type StreamingJobsClientUpdateResponse struct { ETag *string } -// SubscriptionsClientCompileQueryResponse contains the response from method SubscriptionsClient.CompileQuery. -type SubscriptionsClientCompileQueryResponse struct { - // The result of the query compilation request. - QueryCompilationResult -} - // SubscriptionsClientListQuotasResponse contains the response from method SubscriptionsClient.ListQuotas. type SubscriptionsClientListQuotasResponse struct { // Result of the GetQuotas operation. It contains a list of quotas for the subscription in a particular region. SubscriptionQuotasListResult } -// SubscriptionsClientSampleInputResponse contains the response from method SubscriptionsClient.BeginSampleInput. -type SubscriptionsClientSampleInputResponse struct { - // The result of the sample input request. - SampleInputResult -} - -// SubscriptionsClientTestInputResponse contains the response from method SubscriptionsClient.BeginTestInput. -type SubscriptionsClientTestInputResponse struct { - // The result of the test input or output request. - TestDatasourceResult -} - -// SubscriptionsClientTestOutputResponse contains the response from method SubscriptionsClient.BeginTestOutput. -type SubscriptionsClientTestOutputResponse struct { - // The result of the test input or output request. - TestDatasourceResult -} - -// SubscriptionsClientTestQueryResponse contains the response from method SubscriptionsClient.BeginTestQuery. -type SubscriptionsClientTestQueryResponse struct { - // The result of the query testing request. - QueryTestingResult -} - // TransformationsClientCreateOrReplaceResponse contains the response from method TransformationsClient.CreateOrReplace. type TransformationsClientCreateOrReplaceResponse struct { // A transformation object, containing all information associated with the named transformation. All transformations are contained diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/sku_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/sku_client.go deleted file mode 100644 index 87174a12b3ec..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/sku_client.go +++ /dev/null @@ -1,108 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armstreamanalytics - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SKUClient contains the methods for the SKU group. -// Don't use this type directly, use NewSKUClient() instead. -type SKUClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSKUClient creates a new instance of SKUClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSKUClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SKUClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Gets a list of available SKUs about the specified streaming job. -// -// Generated from API version 2021-10-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - jobName - The name of the streaming job. -// - options - SKUClientListOptions contains the optional parameters for the SKUClient.NewListPager method. -func (client *SKUClient) NewListPager(resourceGroupName string, jobName string, options *SKUClientListOptions) *runtime.Pager[SKUClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SKUClientListResponse]{ - More: func(page SKUClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SKUClientListResponse) (SKUClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SKUClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, jobName, options) - }, nil) - if err != nil { - return SKUClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SKUClient) listCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *SKUClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/skus" - 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 jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SKUClient) listHandleResponse(resp *http.Response) (SKUClientListResponse, error) { - result := SKUClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GetStreamingJobSKUResults); err != nil { - return SKUClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/sku_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/sku_client_example_test.go deleted file mode 100644 index 3a4434a651c8..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/sku_client_example_test.go +++ /dev/null @@ -1,65 +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 armstreamanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_GetSkus.json -func ExampleSKUClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUClient().NewListPager("sjrg3276", "sj7804", 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.GetStreamingJobSKUResults = armstreamanalytics.GetStreamingJobSKUResults{ - // Value: []*armstreamanalytics.GetStreamingJobSKUResult{ - // { - // Capacity: &armstreamanalytics.SKUCapacity{ - // Default: to.Ptr[int32](3), - // AllowedValues: []*int32{ - // to.Ptr[int32](1), - // to.Ptr[int32](3), - // to.Ptr[int32](6), - // to.Ptr[int32](12), - // to.Ptr[int32](18), - // to.Ptr[int32](24)}, - // Maximum: to.Ptr[int32](192), - // Minimum: to.Ptr[int32](1), - // ScaleType: to.Ptr(armstreamanalytics.SKUCapacityScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr(armstreamanalytics.ResourceTypeMicrosoftStreamAnalyticsStreamingjobs), - // SKU: &armstreamanalytics.GetStreamingJobSKUResultSKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client.go index 9b31c3391b61..8fc02267a8d2 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client.go @@ -46,7 +46,7 @@ func NewStreamingJobsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrReplace - Creates a streaming job or replaces an already existing streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - streamingJob - The definition of the streaming job that will be used to create a new streaming job or replace the existing @@ -73,7 +73,7 @@ func (client *StreamingJobsClient) BeginCreateOrReplace(ctx context.Context, res // CreateOrReplace - Creates a streaming job or replaces an already existing streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *StreamingJobsClient) createOrReplace(ctx context.Context, resourceGroupName string, jobName string, streamingJob StreamingJob, options *StreamingJobsClientBeginCreateOrReplaceOptions) (*http.Response, error) { var err error const operationName = "StreamingJobsClient.BeginCreateOrReplace" @@ -115,15 +115,15 @@ func (client *StreamingJobsClient) createOrReplaceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, streamingJob); err != nil { return nil, err } @@ -133,7 +133,7 @@ func (client *StreamingJobsClient) createOrReplaceCreateRequest(ctx context.Cont // BeginDelete - Deletes a streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - StreamingJobsClientBeginDeleteOptions contains the optional parameters for the StreamingJobsClient.BeginDelete @@ -158,7 +158,7 @@ func (client *StreamingJobsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *StreamingJobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *StreamingJobsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "StreamingJobsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *StreamingJobsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,7 @@ func (client *StreamingJobsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets details about the specified streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - StreamingJobsClientGetOptions contains the optional parameters for the StreamingJobsClient.Get method. @@ -258,7 +258,7 @@ func (client *StreamingJobsClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *StreamingJobsClient) getHandleResponse(resp *http.Response) (Strea // NewListPager - Lists all of the streaming jobs in the given subscription. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - options - StreamingJobsClientListOptions contains the optional parameters for the StreamingJobsClient.NewListPager method. func (client *StreamingJobsClient) NewListPager(options *StreamingJobsClientListOptions) *runtime.Pager[StreamingJobsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingJobsClientListResponse]{ @@ -318,7 +318,7 @@ func (client *StreamingJobsClient) listCreateRequest(ctx context.Context, option if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +335,7 @@ func (client *StreamingJobsClient) listHandleResponse(resp *http.Response) (Stre // NewListByResourceGroupPager - Lists all of the streaming jobs in the specified resource group. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - StreamingJobsClientListByResourceGroupOptions contains the optional parameters for the StreamingJobsClient.NewListByResourceGroupPager // method. @@ -381,7 +381,7 @@ func (client *StreamingJobsClient) listByResourceGroupCreateRequest(ctx context. if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -399,7 +399,7 @@ func (client *StreamingJobsClient) listByResourceGroupHandleResponse(resp *http. // BeginScale - Scales a streaming job when the job is running. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - StreamingJobsClientBeginScaleOptions contains the optional parameters for the StreamingJobsClient.BeginScale @@ -424,7 +424,7 @@ func (client *StreamingJobsClient) BeginScale(ctx context.Context, resourceGroup // Scale - Scales a streaming job when the job is running. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *StreamingJobsClient) scale(ctx context.Context, resourceGroupName string, jobName string, options *StreamingJobsClientBeginScaleOptions) (*http.Response, error) { var err error const operationName = "StreamingJobsClient.BeginScale" @@ -466,7 +466,7 @@ func (client *StreamingJobsClient) scaleCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScaleJobParameters != nil { @@ -481,7 +481,7 @@ func (client *StreamingJobsClient) scaleCreateRequest(ctx context.Context, resou // BeginStart - Starts a streaming job. Once a job is started it will start processing input events and produce output. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - StreamingJobsClientBeginStartOptions contains the optional parameters for the StreamingJobsClient.BeginStart @@ -506,7 +506,7 @@ func (client *StreamingJobsClient) BeginStart(ctx context.Context, resourceGroup // Start - Starts a streaming job. Once a job is started it will start processing input events and produce output. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *StreamingJobsClient) start(ctx context.Context, resourceGroupName string, jobName string, options *StreamingJobsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "StreamingJobsClient.BeginStart" @@ -548,7 +548,7 @@ func (client *StreamingJobsClient) startCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.StartJobParameters != nil { @@ -564,7 +564,7 @@ func (client *StreamingJobsClient) startCreateRequest(ctx context.Context, resou // producing output. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - options - StreamingJobsClientBeginStopOptions contains the optional parameters for the StreamingJobsClient.BeginStop method. @@ -589,7 +589,7 @@ func (client *StreamingJobsClient) BeginStop(ctx context.Context, resourceGroupN // output. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 func (client *StreamingJobsClient) stop(ctx context.Context, resourceGroupName string, jobName string, options *StreamingJobsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "StreamingJobsClient.BeginStop" @@ -631,7 +631,7 @@ func (client *StreamingJobsClient) stopCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -641,7 +641,7 @@ func (client *StreamingJobsClient) stopCreateRequest(ctx context.Context, resour // job without affecting the rest the job definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - streamingJob - A streaming job object. The properties specified here will overwrite the corresponding properties in the @@ -691,12 +691,12 @@ func (client *StreamingJobsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, streamingJob); err != nil { return nil, err } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client_example_test.go deleted file mode 100644 index c916ef679109..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/streamingjobs_client_example_test.go +++ /dev/null @@ -1,1324 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Create_CompleteJob.json -func ExampleStreamingJobsClient_BeginCreateOrReplace_createACompleteStreamingJobAStreamingJobWithATransformationAtLeast1InputAndAtLeast1Output() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginCreateOrReplace(ctx, "sjrg3276", "sj7804", armstreamanalytics.StreamingJob{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key3": to.Ptr("value3"), - "randomKey": to.Ptr("randomValue"), - }, - Properties: &armstreamanalytics.StreamingJobProperties{ - CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - DataLocale: to.Ptr("en-US"), - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - Externals: &armstreamanalytics.External{ - Path: to.Ptr("UserCustomCode.zip"), - Container: to.Ptr("mycontainer"), - RefreshConfiguration: &armstreamanalytics.RefreshConfiguration{ - DateFormat: to.Ptr("yyyy-dd-MM"), - PathPattern: to.Ptr("{date}\\\\{time}"), - RefreshInterval: to.Ptr("00:01:00"), - RefreshType: to.Ptr(armstreamanalytics.UpdatableUdfRefreshTypeNonblocking), - TimeFormat: to.Ptr("HH"), - }, - StorageAccount: &armstreamanalytics.StorageAccount{ - AccountKey: to.Ptr("mykey"), - AccountName: to.Ptr("mystorageaccount"), - }, - }, - Functions: []*armstreamanalytics.Function{}, - Inputs: []*armstreamanalytics.Input{ - { - Name: to.Ptr("inputtest"), - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - Container: to.Ptr("containerName"), - PathPattern: to.Ptr(""), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("yourAccountKey=="), - AccountName: to.Ptr("yourAccountName"), - }}, - }, - }, - }, - }}, - OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - Outputs: []*armstreamanalytics.Output{ - { - Name: to.Ptr("outputtest"), - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - Type: to.Ptr("Microsoft.Sql/Server/Database"), - Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - Database: to.Ptr("databaseName"), - Password: to.Ptr("userPassword"), - Server: to.Ptr("serverName"), - Table: to.Ptr("tableName"), - User: to.Ptr(""), - }, - }, - }, - }}, - SKU: &armstreamanalytics.SKU{ - Name: to.Ptr(armstreamanalytics.SKUNameStandard), - }, - Transformation: &armstreamanalytics.Transformation{ - Name: to.Ptr("transformationtest"), - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("Select Id, Name from inputtest"), - StreamingUnits: to.Ptr[int32](1), - }, - }, - }, - }, &armstreamanalytics.StreamingJobsClientBeginCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.StreamingJob = armstreamanalytics.StreamingJob{ - // Name: to.Ptr("sj7804"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:11.540Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("ca88f8fa-605b-4c7f-8695-46f5faa60cd0"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("containerName"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("accountName"), - // }}, - // }, - // }, - // }, - // }}, - // JobID: to.Ptr("732e4b1d-94a7-43ae-8297-3ad04f1540b9"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // Outputs: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("outputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/outputs/outputtest"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("databaseName"), - // Server: to.Ptr("serverName"), - // Table: to.Ptr("tableName"), - // User: to.Ptr("userName"), - // }, - // }, - // Etag: to.Ptr("62097c3c-b503-41ff-a56f-196a9598ab90"), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // Transformation: &armstreamanalytics.Transformation{ - // Name: to.Ptr("transformationtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/transformations/transformationtest"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Etag: to.Ptr("91d8fcbe-60b3-49c3-9f21-9942b95602b8"), - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](1), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Create_JobShell.json -func ExampleStreamingJobsClient_BeginCreateOrReplace_createAStreamingJobShellAStreamingJobWithNoInputsOutputsTransformationOrFunctions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginCreateOrReplace(ctx, "sjrg6936", "sj59", armstreamanalytics.StreamingJob{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key3": to.Ptr("value3"), - "randomKey": to.Ptr("randomValue"), - }, - Properties: &armstreamanalytics.StreamingJobProperties{ - CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - DataLocale: to.Ptr("en-US"), - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](16), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - Functions: []*armstreamanalytics.Function{}, - Inputs: []*armstreamanalytics.Input{}, - OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - Outputs: []*armstreamanalytics.Output{}, - SKU: &armstreamanalytics.SKU{ - Name: to.Ptr(armstreamanalytics.SKUNameStandard), - }, - }, - }, &armstreamanalytics.StreamingJobsClientBeginCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.StreamingJob = armstreamanalytics.StreamingJob{ - // Name: to.Ptr("sj59"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj59"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](16), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // }, - // JobID: to.Ptr("d53ecc3c-fcb0-485d-9caf-25e20fcb2061"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // Outputs: []*armstreamanalytics.Output{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Create_UserAssignedIdentity.json -func ExampleStreamingJobsClient_BeginCreateOrReplace_createAStreamingJobShellAStreamingJobWithNoInputsOutputsTransformationOrFunctionsWithUserAssignedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginCreateOrReplace(ctx, "sjrg", "sjName", armstreamanalytics.StreamingJob{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key3": to.Ptr("value3"), - "randomKey": to.Ptr("randomValue"), - }, - Identity: &armstreamanalytics.Identity{ - Type: to.Ptr("UserAssigned"), - UserAssignedIdentities: map[string]any{ - "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity": map[string]any{}, - }, - }, - Properties: &armstreamanalytics.StreamingJobProperties{ - CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - DataLocale: to.Ptr("en-US"), - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](16), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - Functions: []*armstreamanalytics.Function{}, - Inputs: []*armstreamanalytics.Input{}, - OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - Outputs: []*armstreamanalytics.Output{}, - SKU: &armstreamanalytics.SKU{ - Name: to.Ptr(armstreamanalytics.SKUNameStandard), - }, - }, - }, &armstreamanalytics.StreamingJobsClientBeginCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.StreamingJob = armstreamanalytics.StreamingJob{ - // Name: to.Ptr("sjName"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg/providers/Microsoft.StreamAnalytics/streamingjobs/sjName"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Identity: &armstreamanalytics.Identity{ - // Type: to.Ptr("UserAssigned"), - // PrincipalID: to.Ptr("c10a9ec7-7136-441f-9e90-d17cd1a51b94"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // UserAssignedIdentities: map[string]any{ - // "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity": map[string]any{ - // }, - // }, - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](16), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // }, - // JobID: to.Ptr("d53ecc3c-fcb0-485d-9caf-25e20fcb2061"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // Outputs: []*armstreamanalytics.Output{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Update.json -func ExampleStreamingJobsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStreamingJobsClient().Update(ctx, "sjrg6936", "sj59", armstreamanalytics.StreamingJob{ - Properties: &armstreamanalytics.StreamingJobProperties{ - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](13), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](21), - }, - }, &armstreamanalytics.StreamingJobsClientUpdateOptions{IfMatch: 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.StreamingJob = armstreamanalytics.StreamingJob{ - // Name: to.Ptr("sj59"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj59"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](13), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](21), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // JobID: to.Ptr("d53ecc3c-fcb0-485d-9caf-25e20fcb2061"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Delete.json -func ExampleStreamingJobsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginDelete(ctx, "sjrg6936", "sj59", 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Get_NoExpand.json -func ExampleStreamingJobsClient_Get_getAStreamingJobAndDoNotUseTheExpandODataQueryParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStreamingJobsClient().Get(ctx, "sjrg6936", "sj59", &armstreamanalytics.StreamingJobsClientGetOptions{Expand: 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.StreamingJob = armstreamanalytics.StreamingJob{ - // Name: to.Ptr("sj59"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj59"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](16), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // JobID: to.Ptr("d53ecc3c-fcb0-485d-9caf-25e20fcb2061"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Get_Expand.json -func ExampleStreamingJobsClient_Get_getAStreamingJobAndUseTheExpandODataQueryParameterToExpandInputsOutputsTransformationAndFunctions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStreamingJobsClient().Get(ctx, "sjrg3276", "sj7804", &armstreamanalytics.StreamingJobsClientGetOptions{Expand: to.Ptr("inputs,outputs,transformation,functions")}) - 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.StreamingJob = armstreamanalytics.StreamingJob{ - // Name: to.Ptr("sj7804"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:11.540Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("ca88f8fa-605b-4c7f-8695-46f5faa60cd0"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("containerName"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("accountName"), - // }}, - // }, - // }, - // }, - // }}, - // JobID: to.Ptr("732e4b1d-94a7-43ae-8297-3ad04f1540b9"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // Outputs: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("outputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/outputs/outputtest"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("databaseName"), - // Server: to.Ptr("serverName"), - // Table: to.Ptr("tableName"), - // User: to.Ptr("userName"), - // }, - // }, - // Etag: to.Ptr("62097c3c-b503-41ff-a56f-196a9598ab90"), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // Transformation: &armstreamanalytics.Transformation{ - // Name: to.Ptr("transformationtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/transformations/transformationtest"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Etag: to.Ptr("91d8fcbe-60b3-49c3-9f21-9942b95602b8"), - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](1), - // }, - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_List_ByResourceGroup_NoExpand.json -func ExampleStreamingJobsClient_NewListByResourceGroupPager_listAllStreamingJobsInAResourceGroupAndDoNotUseTheExpandODataQueryParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStreamingJobsClient().NewListByResourceGroupPager("sjrg6936", &armstreamanalytics.StreamingJobsClientListByResourceGroupOptions{Expand: 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.StreamingJobListResult = armstreamanalytics.StreamingJobListResult{ - // Value: []*armstreamanalytics.StreamingJob{ - // { - // Name: to.Ptr("sj59"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj59"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("3e6872bc-c9d0-45b6-91b6-da66f1773056"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](13), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](21), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // JobID: to.Ptr("d53ecc3c-fcb0-485d-9caf-25e20fcb2061"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }, - // { - // Name: to.Ptr("sj69"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj69"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:38:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("99538949-a164-4e2f-a991-40303e86024f"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](6), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // JobID: to.Ptr("817b36cf-a161-4a9e-86f2-eb00b3566d88"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_List_ByResourceGroup_Expand.json -func ExampleStreamingJobsClient_NewListByResourceGroupPager_listAllStreamingJobsInAResourceGroupAndUseTheExpandODataQueryParameterToExpandInputsOutputsTransformationAndFunctions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStreamingJobsClient().NewListByResourceGroupPager("sjrg3276", &armstreamanalytics.StreamingJobsClientListByResourceGroupOptions{Expand: to.Ptr("inputs,outputs,transformation,functions")}) - 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.StreamingJobListResult = armstreamanalytics.StreamingJobListResult{ - // Value: []*armstreamanalytics.StreamingJob{ - // { - // Name: to.Ptr("sj7804"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:11.540Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("8081b2a3-dfe6-457f-8740-1a22d209bf8a"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyAdjust), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("ca88f8fa-605b-4c7f-8695-46f5faa60cd0"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("containerName"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("accountName"), - // }}, - // }, - // }, - // }, - // }}, - // JobID: to.Ptr("732e4b1d-94a7-43ae-8297-3ad04f1540b9"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyStop), - // Outputs: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("outputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/outputs/outputtest"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("databaseName"), - // Server: to.Ptr("serverName"), - // Table: to.Ptr("tableName"), - // User: to.Ptr("userName"), - // }, - // }, - // Etag: to.Ptr("62097c3c-b503-41ff-a56f-196a9598ab90"), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // Transformation: &armstreamanalytics.Transformation{ - // Name: to.Ptr("transformationtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/transformations/transformationtest"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Etag: to.Ptr("91d8fcbe-60b3-49c3-9f21-9942b95602b8"), - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](1), - // }, - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }, - // { - // Name: to.Ptr("sj7805"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7805"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:38:11.540Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("5420059f-e5d7-47d4-be44-40816a4dca7e"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyAdjust), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("45dcf40f-88bb-4776-b5ca-7b10a607cb59"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("containerName"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("accountName"), - // }}, - // }, - // }, - // }, - // }}, - // JobID: to.Ptr("d8f4041a-0793-433e-a38d-5499d5332113"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyStop), - // Outputs: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("outputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/outputs/outputtest"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("databaseName"), - // Server: to.Ptr("serverName"), - // Table: to.Ptr("tableName"), - // User: to.Ptr("userName"), - // }, - // }, - // Etag: to.Ptr("b09606c8-1b0d-43c9-affb-fac0e18b9481"), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // Transformation: &armstreamanalytics.Transformation{ - // Name: to.Ptr("transformationtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/transformations/transformationtest"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Etag: to.Ptr("288d95c0-204b-4c54-828f-f57aa6896b2a"), - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](1), - // }, - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_List_BySubscription_NoExpand.json -func ExampleStreamingJobsClient_NewListPager_listAllStreamingJobsInASubscriptionAndDoNotUseTheExpandODataQueryParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStreamingJobsClient().NewListPager(&armstreamanalytics.StreamingJobsClientListOptions{Expand: 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.StreamingJobListResult = armstreamanalytics.StreamingJobListResult{ - // Value: []*armstreamanalytics.StreamingJob{ - // { - // Name: to.Ptr("sj59"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj59"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("3e6872bc-c9d0-45b6-91b6-da66f1773056"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](13), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](21), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // JobID: to.Ptr("d53ecc3c-fcb0-485d-9caf-25e20fcb2061"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }, - // { - // Name: to.Ptr("sj69"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg6936/providers/Microsoft.StreamAnalytics/streamingjobs/sj69"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:38:04.697Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("99538949-a164-4e2f-a991-40303e86024f"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](6), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - // JobID: to.Ptr("817b36cf-a161-4a9e-86f2-eb00b3566d88"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_List_BySubscription_Expand.json -func ExampleStreamingJobsClient_NewListPager_listAllStreamingJobsInASubscriptionAndUseTheExpandODataQueryParameterToExpandInputsOutputsTransformationAndFunctions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStreamingJobsClient().NewListPager(&armstreamanalytics.StreamingJobsClientListOptions{Expand: to.Ptr("inputs,outputs,transformation,functions")}) - 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.StreamingJobListResult = armstreamanalytics.StreamingJobListResult{ - // Value: []*armstreamanalytics.StreamingJob{ - // { - // Name: to.Ptr("sj7804"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:37:11.540Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("8081b2a3-dfe6-457f-8740-1a22d209bf8a"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyAdjust), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("ca88f8fa-605b-4c7f-8695-46f5faa60cd0"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("containerName"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("accountName"), - // }}, - // }, - // }, - // }, - // }}, - // JobID: to.Ptr("732e4b1d-94a7-43ae-8297-3ad04f1540b9"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyStop), - // Outputs: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("outputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/outputs/outputtest"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("databaseName"), - // Server: to.Ptr("serverName"), - // Table: to.Ptr("tableName"), - // User: to.Ptr("userName"), - // }, - // }, - // Etag: to.Ptr("62097c3c-b503-41ff-a56f-196a9598ab90"), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // Transformation: &armstreamanalytics.Transformation{ - // Name: to.Ptr("transformationtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7804/transformations/transformationtest"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Etag: to.Ptr("91d8fcbe-60b3-49c3-9f21-9942b95602b8"), - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](1), - // }, - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }, - // { - // Name: to.Ptr("sj7805"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7805"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key3": to.Ptr("value3"), - // "randomKey": to.Ptr("randomValue"), - // }, - // Properties: &armstreamanalytics.StreamingJobProperties{ - // CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-11T04:38:11.540Z"); return t}()), - // DataLocale: to.Ptr("en-US"), - // Etag: to.Ptr("5420059f-e5d7-47d4-be44-40816a4dca7e"), - // EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - // EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - // EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyAdjust), - // Functions: []*armstreamanalytics.Function{ - // }, - // Inputs: []*armstreamanalytics.Input{ - // { - // Name: to.Ptr("inputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/inputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7805/inputs/inputtest"), - // Properties: &armstreamanalytics.StreamInputProperties{ - // Type: to.Ptr("Stream"), - // Etag: to.Ptr("45dcf40f-88bb-4776-b5ca-7b10a607cb59"), - // Serialization: &armstreamanalytics.JSONSerialization{ - // Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - // Properties: &armstreamanalytics.JSONSerializationProperties{ - // Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - // }, - // }, - // Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - // Type: to.Ptr("Microsoft.Storage/Blob"), - // Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - // Container: to.Ptr("containerName"), - // PathPattern: to.Ptr(""), - // StorageAccounts: []*armstreamanalytics.StorageAccount{ - // { - // AccountName: to.Ptr("accountName"), - // }}, - // }, - // }, - // }, - // }}, - // JobID: to.Ptr("d8f4041a-0793-433e-a38d-5499d5332113"), - // JobState: to.Ptr("Created"), - // OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyStop), - // Outputs: []*armstreamanalytics.Output{ - // { - // Name: to.Ptr("outputtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/outputs"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7805/outputs/outputtest"), - // Properties: &armstreamanalytics.OutputProperties{ - // Datasource: &armstreamanalytics.AzureSQLDatabaseOutputDataSource{ - // Type: to.Ptr("Microsoft.Sql/Server/Database"), - // Properties: &armstreamanalytics.AzureSQLDatabaseOutputDataSourceProperties{ - // Database: to.Ptr("databaseName"), - // Server: to.Ptr("serverName"), - // Table: to.Ptr("tableName"), - // User: to.Ptr("userName"), - // }, - // }, - // Etag: to.Ptr("b09606c8-1b0d-43c9-affb-fac0e18b9481"), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // }, - // Transformation: &armstreamanalytics.Transformation{ - // Name: to.Ptr("transformationtest"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg3276/providers/Microsoft.StreamAnalytics/streamingjobs/sj7805/transformations/transformationtest"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Etag: to.Ptr("288d95c0-204b-4c54-828f-f57aa6896b2a"), - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](1), - // }, - // }, - // }, - // SKU: &armstreamanalytics.SKU{ - // Name: to.Ptr(armstreamanalytics.SKUNameStandard), - // Capacity: to.Ptr[int32](36), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Start_CustomTime.json -func ExampleStreamingJobsClient_BeginStart_startAStreamingJobWithCustomTimeOutputStartMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginStart(ctx, "sjrg6936", "sj59", &armstreamanalytics.StreamingJobsClientBeginStartOptions{StartJobParameters: &armstreamanalytics.StartStreamingJobParameters{ - OutputStartMode: to.Ptr(armstreamanalytics.OutputStartModeCustomTime), - OutputStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2012-12-12T12:12:12.000Z"); return t }()), - }, - }) - 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Start_JobStartTime.json -func ExampleStreamingJobsClient_BeginStart_startAStreamingJobWithJobStartTimeOutputStartMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginStart(ctx, "sjrg6936", "sj59", &armstreamanalytics.StreamingJobsClientBeginStartOptions{StartJobParameters: &armstreamanalytics.StartStreamingJobParameters{ - OutputStartMode: to.Ptr(armstreamanalytics.OutputStartModeJobStartTime), - }, - }) - 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Start_LastOutputEventTime.json -func ExampleStreamingJobsClient_BeginStart_startAStreamingJobWithLastOutputEventTimeOutputStartMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginStart(ctx, "sjrg6936", "sj59", &armstreamanalytics.StreamingJobsClientBeginStartOptions{StartJobParameters: &armstreamanalytics.StartStreamingJobParameters{ - OutputStartMode: to.Ptr(armstreamanalytics.OutputStartModeLastOutputEventTime), - }, - }) - 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Stop.json -func ExampleStreamingJobsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginStop(ctx, "sjrg6936", "sj59", 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Scale.json -func ExampleStreamingJobsClient_BeginScale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStreamingJobsClient().BeginScale(ctx, "sjrg", "sjName", &armstreamanalytics.StreamingJobsClientBeginScaleOptions{ScaleJobParameters: &armstreamanalytics.ScaleStreamingJobParameters{ - StreamingUnits: to.Ptr[int32](36), - }, - }) - 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) - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client.go index a64ab8776acc..b6fb7c990f27 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client.go @@ -43,77 +43,12 @@ func NewSubscriptionsClient(subscriptionID string, credential azcore.TokenCreden return client, nil } -// CompileQuery - Compile the Stream Analytics query. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -// - location - The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported -// in here: https://azure.microsoft.com/en-us/regions/ -// - compileQuery - The query compilation object which defines the input, output, and transformation for the query compilation. -// - options - SubscriptionsClientCompileQueryOptions contains the optional parameters for the SubscriptionsClient.CompileQuery -// method. -func (client *SubscriptionsClient) CompileQuery(ctx context.Context, location string, compileQuery CompileQuery, options *SubscriptionsClientCompileQueryOptions) (SubscriptionsClientCompileQueryResponse, error) { - var err error - const operationName = "SubscriptionsClient.CompileQuery" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.compileQueryCreateRequest(ctx, location, compileQuery, options) - if err != nil { - return SubscriptionsClientCompileQueryResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SubscriptionsClientCompileQueryResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SubscriptionsClientCompileQueryResponse{}, err - } - resp, err := client.compileQueryHandleResponse(httpResp) - return resp, err -} - -// compileQueryCreateRequest creates the CompileQuery request. -func (client *SubscriptionsClient) compileQueryCreateRequest(ctx context.Context, location string, compileQuery CompileQuery, options *SubscriptionsClientCompileQueryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/compileQuery" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, compileQuery); err != nil { - return nil, err - } - return req, nil -} - -// compileQueryHandleResponse handles the CompileQuery response. -func (client *SubscriptionsClient) compileQueryHandleResponse(resp *http.Response) (SubscriptionsClientCompileQueryResponse, error) { - result := SubscriptionsClientCompileQueryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.QueryCompilationResult); err != nil { - return SubscriptionsClientCompileQueryResponse{}, err - } - return result, nil -} - // ListQuotas - Retrieves the subscription's current quota information in a particular region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview -// - location - The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported -// in here: https://azure.microsoft.com/en-us/regions/ +// Generated from API version 2020-03-01 +// - location - The region in which to retrieve the subscription's quota information. You can find out which regions Azure Stream +// Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ // - options - SubscriptionsClientListQuotasOptions contains the optional parameters for the SubscriptionsClient.ListQuotas // method. func (client *SubscriptionsClient) ListQuotas(ctx context.Context, location string, options *SubscriptionsClientListQuotasOptions) (SubscriptionsClientListQuotasResponse, error) { @@ -154,7 +89,7 @@ func (client *SubscriptionsClient) listQuotasCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,311 +103,3 @@ func (client *SubscriptionsClient) listQuotasHandleResponse(resp *http.Response) } return result, nil } - -// BeginSampleInput - Sample the Stream Analytics input data. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -// - location - The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported -// in here: https://azure.microsoft.com/en-us/regions/ -// - sampleInput - Defines the necessary parameters for sampling the Stream Analytics input data. -// - options - SubscriptionsClientBeginSampleInputOptions contains the optional parameters for the SubscriptionsClient.BeginSampleInput -// method. -func (client *SubscriptionsClient) BeginSampleInput(ctx context.Context, location string, sampleInput SampleInput, options *SubscriptionsClientBeginSampleInputOptions) (*runtime.Poller[SubscriptionsClientSampleInputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.sampleInput(ctx, location, sampleInput, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubscriptionsClientSampleInputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SubscriptionsClientSampleInputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SampleInput - Sample the Stream Analytics input data. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -func (client *SubscriptionsClient) sampleInput(ctx context.Context, location string, sampleInput SampleInput, options *SubscriptionsClientBeginSampleInputOptions) (*http.Response, error) { - var err error - const operationName = "SubscriptionsClient.BeginSampleInput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.sampleInputCreateRequest(ctx, location, sampleInput, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// sampleInputCreateRequest creates the SampleInput request. -func (client *SubscriptionsClient) sampleInputCreateRequest(ctx context.Context, location string, sampleInput SampleInput, options *SubscriptionsClientBeginSampleInputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/sampleInput" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, sampleInput); err != nil { - return nil, err - } - return req, nil -} - -// BeginTestInput - Test the Stream Analytics input. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -// - location - The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported -// in here: https://azure.microsoft.com/en-us/regions/ -// - testInput - Defines the necessary parameters for testing the Stream Analytics input. -// - options - SubscriptionsClientBeginTestInputOptions contains the optional parameters for the SubscriptionsClient.BeginTestInput -// method. -func (client *SubscriptionsClient) BeginTestInput(ctx context.Context, location string, testInput TestInput, options *SubscriptionsClientBeginTestInputOptions) (*runtime.Poller[SubscriptionsClientTestInputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.testInput(ctx, location, testInput, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubscriptionsClientTestInputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SubscriptionsClientTestInputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// TestInput - Test the Stream Analytics input. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -func (client *SubscriptionsClient) testInput(ctx context.Context, location string, testInput TestInput, options *SubscriptionsClientBeginTestInputOptions) (*http.Response, error) { - var err error - const operationName = "SubscriptionsClient.BeginTestInput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.testInputCreateRequest(ctx, location, testInput, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// testInputCreateRequest creates the TestInput request. -func (client *SubscriptionsClient) testInputCreateRequest(ctx context.Context, location string, testInput TestInput, options *SubscriptionsClientBeginTestInputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testInput" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, testInput); err != nil { - return nil, err - } - return req, nil -} - -// BeginTestOutput - Test the Stream Analytics output. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -// - location - The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported -// in here: https://azure.microsoft.com/en-us/regions/ -// - testOutput - Defines the necessary parameters for testing the Stream Analytics output. -// - options - SubscriptionsClientBeginTestOutputOptions contains the optional parameters for the SubscriptionsClient.BeginTestOutput -// method. -func (client *SubscriptionsClient) BeginTestOutput(ctx context.Context, location string, testOutput TestOutput, options *SubscriptionsClientBeginTestOutputOptions) (*runtime.Poller[SubscriptionsClientTestOutputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.testOutput(ctx, location, testOutput, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubscriptionsClientTestOutputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SubscriptionsClientTestOutputResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// TestOutput - Test the Stream Analytics output. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -func (client *SubscriptionsClient) testOutput(ctx context.Context, location string, testOutput TestOutput, options *SubscriptionsClientBeginTestOutputOptions) (*http.Response, error) { - var err error - const operationName = "SubscriptionsClient.BeginTestOutput" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.testOutputCreateRequest(ctx, location, testOutput, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// testOutputCreateRequest creates the TestOutput request. -func (client *SubscriptionsClient) testOutputCreateRequest(ctx context.Context, location string, testOutput TestOutput, options *SubscriptionsClientBeginTestOutputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testOutput" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, testOutput); err != nil { - return nil, err - } - return req, nil -} - -// BeginTestQuery - Test the Stream Analytics query on a sample input. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -// - location - The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported -// in here: https://azure.microsoft.com/en-us/regions/ -// - testQuery - The query testing object that defines the input, output, and transformation for the query testing. -// - options - SubscriptionsClientBeginTestQueryOptions contains the optional parameters for the SubscriptionsClient.BeginTestQuery -// method. -func (client *SubscriptionsClient) BeginTestQuery(ctx context.Context, location string, testQuery TestQuery, options *SubscriptionsClientBeginTestQueryOptions) (*runtime.Poller[SubscriptionsClientTestQueryResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.testQuery(ctx, location, testQuery, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubscriptionsClientTestQueryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SubscriptionsClientTestQueryResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// TestQuery - Test the Stream Analytics query on a sample input. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-10-01-preview -func (client *SubscriptionsClient) testQuery(ctx context.Context, location string, testQuery TestQuery, options *SubscriptionsClientBeginTestQueryOptions) (*http.Response, error) { - var err error - const operationName = "SubscriptionsClient.BeginTestQuery" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.testQueryCreateRequest(ctx, location, testQuery, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// testQueryCreateRequest creates the TestQuery request. -func (client *SubscriptionsClient) testQueryCreateRequest(ctx context.Context, location string, testQuery TestQuery, options *SubscriptionsClientBeginTestQueryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testQuery" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, testQuery); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client_example_test.go deleted file mode 100644 index 95d24b7769e1..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/subscriptions_client_example_test.go +++ /dev/null @@ -1,348 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Subscription_ListQuotas.json -func ExampleSubscriptionsClient_ListQuotas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().ListQuotas(ctx, "West US", 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.SubscriptionQuotasListResult = armstreamanalytics.SubscriptionQuotasListResult{ - // Value: []*armstreamanalytics.SubscriptionQuota{ - // { - // Name: to.Ptr("StreamingUnits"), - // Type: to.Ptr("Microsoft.StreamAnalytics/quotas"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/providers/Microsoft.StreamAnalytics/locations/West US/quotas/StreamingUnits"), - // Properties: &armstreamanalytics.SubscriptionQuotaProperties{ - // CurrentCount: to.Ptr[int32](0), - // MaxCount: to.Ptr[int32](200), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Subscription_TestQuery.json -func ExampleSubscriptionsClient_BeginTestQuery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubscriptionsClient().BeginTestQuery(ctx, "West US", armstreamanalytics.TestQuery{ - Diagnostics: &armstreamanalytics.TestQueryDiagnostics{ - Path: to.Ptr("/pathto/subdirectory"), - WriteURI: to.Ptr("http://myoutput.com"), - }, - StreamingJob: &armstreamanalytics.StreamingJob{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key3": to.Ptr("value3"), - "randomKey": to.Ptr("randomValue"), - }, - Properties: &armstreamanalytics.StreamingJobProperties{ - CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne0), - DataLocale: to.Ptr("en-US"), - EventsLateArrivalMaxDelayInSeconds: to.Ptr[int32](5), - EventsOutOfOrderMaxDelayInSeconds: to.Ptr[int32](0), - EventsOutOfOrderPolicy: to.Ptr(armstreamanalytics.EventsOutOfOrderPolicyDrop), - Functions: []*armstreamanalytics.Function{}, - Inputs: []*armstreamanalytics.Input{ - { - Name: to.Ptr("inputtest"), - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - Properties: &armstreamanalytics.JSONSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - }, - }, - Datasource: &armstreamanalytics.RawStreamInputDataSource{ - Type: to.Ptr("Raw"), - Properties: &armstreamanalytics.RawInputDatasourceProperties{ - PayloadURI: to.Ptr("http://myinput.com"), - }, - }, - }, - }}, - OutputErrorPolicy: to.Ptr(armstreamanalytics.OutputErrorPolicyDrop), - Outputs: []*armstreamanalytics.Output{ - { - Name: to.Ptr("outputtest"), - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.RawOutputDatasource{ - Type: to.Ptr("Raw"), - Properties: &armstreamanalytics.RawOutputDatasourceProperties{ - PayloadURI: to.Ptr("http://myoutput.com"), - }, - }, - Serialization: &armstreamanalytics.JSONSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeJSON), - }, - }, - }}, - SKU: &armstreamanalytics.SKU{ - Name: to.Ptr(armstreamanalytics.SKUNameStandard), - }, - Transformation: &armstreamanalytics.Transformation{ - Name: to.Ptr("transformationtest"), - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("Select Id, Name from inputtest"), - StreamingUnits: to.Ptr[int32](1), - }, - }, - }, - }, - }, 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.QueryTestingResult = armstreamanalytics.QueryTestingResult{ - // OutputURI: to.Ptr("http://myoutput.com"), - // Status: to.Ptr(armstreamanalytics.QueryTestingResultStatusSuccess), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Subscription_CompileQuery.json -func ExampleSubscriptionsClient_CompileQuery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().CompileQuery(ctx, "West US", armstreamanalytics.CompileQuery{ - CompatibilityLevel: to.Ptr(armstreamanalytics.CompatibilityLevelOne2), - Functions: []*armstreamanalytics.QueryFunction{ - { - Name: to.Ptr("function1"), - Type: to.Ptr("Scalar"), - BindingType: to.Ptr("Microsoft.StreamAnalytics/JavascriptUdf"), - Inputs: []*armstreamanalytics.FunctionInput{ - { - DataType: to.Ptr("any"), - }}, - Output: &armstreamanalytics.FunctionOutput{ - DataType: to.Ptr("bigint"), - }, - }}, - Inputs: []*armstreamanalytics.QueryInput{ - { - Name: to.Ptr("input1"), - Type: to.Ptr("Stream"), - }}, - JobType: to.Ptr(armstreamanalytics.JobTypeCloud), - Query: to.Ptr("SELECT\r\n *\r\nINTO\r\n [output1]\r\nFROM\r\n [input1]"), - }, 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.QueryCompilationResult = armstreamanalytics.QueryCompilationResult{ - // Errors: []*armstreamanalytics.QueryCompilationError{ - // { - // IsGlobal: to.Ptr(true), - // Message: to.Ptr("Query failed to compile."), - // }}, - // Functions: []*string{ - // to.Ptr("transformationtest")}, - // Inputs: []*string{ - // to.Ptr("inputtest")}, - // Outputs: []*string{ - // to.Ptr("outputtest")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Subscription_SampleInput.json -func ExampleSubscriptionsClient_BeginSampleInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubscriptionsClient().BeginSampleInput(ctx, "West US", armstreamanalytics.SampleInput{ - CompatibilityLevel: to.Ptr("1.2"), - DataLocale: to.Ptr("en-US"), - EventsURI: to.Ptr("http://myoutput.com"), - Input: &armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("someAccountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - SourcePartitionCount: to.Ptr[int32](16), - }, - }, - }, - }, - }, 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Subscription_TestInput.json -func ExampleSubscriptionsClient_BeginTestInput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubscriptionsClient().BeginTestInput(ctx, "West US", armstreamanalytics.TestInput{ - Input: &armstreamanalytics.Input{ - Properties: &armstreamanalytics.StreamInputProperties{ - Type: to.Ptr("Stream"), - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - Datasource: &armstreamanalytics.BlobStreamInputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobStreamInputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("someAccountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - SourcePartitionCount: to.Ptr[int32](16), - }, - }, - }, - }, - }, 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/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Subscription_TestOutput.json -func ExampleSubscriptionsClient_BeginTestOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubscriptionsClient().BeginTestOutput(ctx, "West US", armstreamanalytics.TestOutput{ - Output: &armstreamanalytics.Output{ - Properties: &armstreamanalytics.OutputProperties{ - Datasource: &armstreamanalytics.BlobOutputDataSource{ - Type: to.Ptr("Microsoft.Storage/Blob"), - Properties: &armstreamanalytics.BlobOutputDataSourceProperties{ - Container: to.Ptr("state"), - DateFormat: to.Ptr("yyyy/MM/dd"), - PathPattern: to.Ptr("{date}/{time}"), - StorageAccounts: []*armstreamanalytics.StorageAccount{ - { - AccountKey: to.Ptr("accountKey=="), - AccountName: to.Ptr("someAccountName"), - }}, - TimeFormat: to.Ptr("HH"), - }, - }, - Serialization: &armstreamanalytics.CSVSerialization{ - Type: to.Ptr(armstreamanalytics.EventSerializationTypeCSV), - Properties: &armstreamanalytics.CSVSerializationProperties{ - Encoding: to.Ptr(armstreamanalytics.EncodingUTF8), - FieldDelimiter: to.Ptr(","), - }, - }, - }, - }, - }, 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) - } -} diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/time_rfc3339.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/time_rfc3339.go index dda82208fee2..16eacac4a5f5 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/time_rfc3339.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client.go index 5b79f7e4e7e6..6bb5036d4af4 100644 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client.go +++ b/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client.go @@ -46,7 +46,7 @@ func NewTransformationsClient(subscriptionID string, credential azcore.TokenCred // CreateOrReplace - Creates a transformation or replaces an already existing transformation under an existing streaming job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - transformationName - The name of the transformation. @@ -100,15 +100,15 @@ func (client *TransformationsClient) createOrReplaceCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, transformation); err != nil { return nil, err } @@ -130,7 +130,7 @@ func (client *TransformationsClient) createOrReplaceHandleResponse(resp *http.Re // Get - Gets details about the specified transformation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - transformationName - The name of the transformation. @@ -181,7 +181,7 @@ func (client *TransformationsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *TransformationsClient) getHandleResponse(resp *http.Response) (Tra // transformation definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-10-01-preview +// Generated from API version 2020-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - The name of the streaming job. // - transformationName - The name of the transformation. @@ -259,12 +259,12 @@ func (client *TransformationsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2020-03-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, transformation); err != nil { return nil, err } diff --git a/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client_example_test.go b/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client_example_test.go deleted file mode 100644 index 1cb041e423d2..000000000000 --- a/sdk/resourcemanager/streamanalytics/armstreamanalytics/transformations_client_example_test.go +++ /dev/null @@ -1,117 +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 armstreamanalytics_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/streamanalytics/armstreamanalytics/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Transformation_Create.json -func ExampleTransformationsClient_CreateOrReplace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTransformationsClient().CreateOrReplace(ctx, "sjrg4423", "sj8374", "transformation952", armstreamanalytics.Transformation{ - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("Select Id, Name from inputtest"), - StreamingUnits: to.Ptr[int32](6), - }, - }, &armstreamanalytics.TransformationsClientCreateOrReplaceOptions{IfMatch: nil, - IfNoneMatch: 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.Transformation = armstreamanalytics.Transformation{ - // Name: to.Ptr("transformation952"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg4423/providers/Microsoft.StreamAnalytics/streamingjobs/sj8374/transformations/transformation952"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](6), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Transformation_Update.json -func ExampleTransformationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTransformationsClient().Update(ctx, "sjrg4423", "sj8374", "transformation952", armstreamanalytics.Transformation{ - Properties: &armstreamanalytics.TransformationProperties{ - Query: to.Ptr("New query"), - }, - }, &armstreamanalytics.TransformationsClientUpdateOptions{IfMatch: 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.Transformation = armstreamanalytics.Transformation{ - // Name: to.Ptr("transformation952"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg4423/providers/Microsoft.StreamAnalytics/streamingjobs/sj8374/transformations/transformation952"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Query: to.Ptr("New query"), - // StreamingUnits: to.Ptr[int32](6), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/fa469a1157c33837a46c9bcd524527e94125189a/specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Transformation_Get.json -func ExampleTransformationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstreamanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTransformationsClient().Get(ctx, "sjrg4423", "sj8374", "transformation952", 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.Transformation = armstreamanalytics.Transformation{ - // Name: to.Ptr("transformation952"), - // Type: to.Ptr("Microsoft.StreamAnalytics/streamingjobs/transformations"), - // ID: to.Ptr("/subscriptions/56b5e0a9-b645-407d-99b0-c64f86013e3d/resourceGroups/sjrg4423/providers/Microsoft.StreamAnalytics/streamingjobs/sj8374/transformations/transformation952"), - // Properties: &armstreamanalytics.TransformationProperties{ - // Query: to.Ptr("Select Id, Name from inputtest"), - // StreamingUnits: to.Ptr[int32](6), - // }, - // } -}