diff --git a/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go b/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go new file mode 100644 index 000000000000..32c0775e9391 --- /dev/null +++ b/profiles/preview/adhybridhealthservice/mgmt/adhybridhealthservice/models.go @@ -0,0 +1,408 @@ +// +build go1.9 + +// Copyright 2018 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package adhybridhealthservice + +import original "github.com/Azure/azure-sdk-for-go/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice" + +type AddomainservicemembersClient = original.AddomainservicemembersClient +type AddsservicemembersClient = original.AddsservicemembersClient +type AddsservicesClient = original.AddsservicesClient +type AlertsClient = original.AlertsClient + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type BaseClient = original.BaseClient +type ConfigurationClient = original.ConfigurationClient +type FeedbackClient = original.FeedbackClient +type ForestsummaryClient = original.ForestsummaryClient +type MetricmetadataClient = original.MetricmetadataClient +type MetricsClient = original.MetricsClient +type AlgorithmStepType = original.AlgorithmStepType + +const ( + ConnectorFilter AlgorithmStepType = original.ConnectorFilter + Deprovisioning AlgorithmStepType = original.Deprovisioning + ExportFlow AlgorithmStepType = original.ExportFlow + ImportFlow AlgorithmStepType = original.ImportFlow + Join AlgorithmStepType = original.Join + MvDeletion AlgorithmStepType = original.MvDeletion + MvObjectTypeChange AlgorithmStepType = original.MvObjectTypeChange + Projection AlgorithmStepType = original.Projection + Provisioning AlgorithmStepType = original.Provisioning + Recall AlgorithmStepType = original.Recall + Staging AlgorithmStepType = original.Staging + Undefined AlgorithmStepType = original.Undefined + ValidateConnectorFilter AlgorithmStepType = original.ValidateConnectorFilter +) + +type AttributeDeltaOperationType = original.AttributeDeltaOperationType + +const ( + AttributeDeltaOperationTypeAdd AttributeDeltaOperationType = original.AttributeDeltaOperationTypeAdd + AttributeDeltaOperationTypeDelete AttributeDeltaOperationType = original.AttributeDeltaOperationTypeDelete + AttributeDeltaOperationTypeReplace AttributeDeltaOperationType = original.AttributeDeltaOperationTypeReplace + AttributeDeltaOperationTypeUndefined AttributeDeltaOperationType = original.AttributeDeltaOperationTypeUndefined + AttributeDeltaOperationTypeUpdate AttributeDeltaOperationType = original.AttributeDeltaOperationTypeUpdate +) + +type AttributeMappingType = original.AttributeMappingType + +const ( + Constant AttributeMappingType = original.Constant + Direct AttributeMappingType = original.Direct + DnPart AttributeMappingType = original.DnPart + Script AttributeMappingType = original.Script +) + +type DeltaOperationType = original.DeltaOperationType + +const ( + DeltaOperationTypeAdd DeltaOperationType = original.DeltaOperationTypeAdd + DeltaOperationTypeDeletAdd DeltaOperationType = original.DeltaOperationTypeDeletAdd + DeltaOperationTypeDelete DeltaOperationType = original.DeltaOperationTypeDelete + DeltaOperationTypeNone DeltaOperationType = original.DeltaOperationTypeNone + DeltaOperationTypeObsolete DeltaOperationType = original.DeltaOperationTypeObsolete + DeltaOperationTypeReplace DeltaOperationType = original.DeltaOperationTypeReplace + DeltaOperationTypeUndefined DeltaOperationType = original.DeltaOperationTypeUndefined + DeltaOperationTypeUpdate DeltaOperationType = original.DeltaOperationTypeUpdate +) + +type HealthStatus = original.HealthStatus + +const ( + Error HealthStatus = original.Error + Healthy HealthStatus = original.Healthy + Missing HealthStatus = original.Missing + NotMonitored HealthStatus = original.NotMonitored + Warning HealthStatus = original.Warning +) + +type Level = original.Level + +const ( + LevelError Level = original.LevelError + LevelPreWarning Level = original.LevelPreWarning + LevelWarning Level = original.LevelWarning +) + +type MonitoringLevel = original.MonitoringLevel + +const ( + Full MonitoringLevel = original.Full + Off MonitoringLevel = original.Off + Partial MonitoringLevel = original.Partial +) + +type PasswordOperationTypes = original.PasswordOperationTypes + +const ( + PasswordOperationTypesChange PasswordOperationTypes = original.PasswordOperationTypesChange + PasswordOperationTypesSet PasswordOperationTypes = original.PasswordOperationTypesSet + PasswordOperationTypesUndefined PasswordOperationTypes = original.PasswordOperationTypesUndefined +) + +type RunStepOperationType = original.RunStepOperationType + +const ( + RunStepOperationTypeApplyRules RunStepOperationType = original.RunStepOperationTypeApplyRules + RunStepOperationTypeDeltaImport RunStepOperationType = original.RunStepOperationTypeDeltaImport + RunStepOperationTypeDeltaSynchronization RunStepOperationType = original.RunStepOperationTypeDeltaSynchronization + RunStepOperationTypeExport RunStepOperationType = original.RunStepOperationTypeExport + RunStepOperationTypeFullExport RunStepOperationType = original.RunStepOperationTypeFullExport + RunStepOperationTypeFullImport RunStepOperationType = original.RunStepOperationTypeFullImport + RunStepOperationTypeFullImportReevaluateRules RunStepOperationType = original.RunStepOperationTypeFullImportReevaluateRules + RunStepOperationTypeFullSynchornization RunStepOperationType = original.RunStepOperationTypeFullSynchornization + RunStepOperationTypeUndefined RunStepOperationType = original.RunStepOperationTypeUndefined +) + +type ServerDisabledReason = original.ServerDisabledReason + +const ( + DeletedFromPortal ServerDisabledReason = original.DeletedFromPortal + DisabledDueToInactivity ServerDisabledReason = original.DisabledDueToInactivity + GdprStopCollection ServerDisabledReason = original.GdprStopCollection + None ServerDisabledReason = original.None +) + +type ServiceType = original.ServiceType + +const ( + ServiceTypeAadConnectSync ServiceType = original.ServiceTypeAadConnectSync + ServiceTypeDirSync ServiceType = original.ServiceTypeDirSync + ServiceTypeUndefined ServiceType = original.ServiceTypeUndefined +) + +type State = original.State + +const ( + Active State = original.Active + ResolvedByPositiveResult State = original.ResolvedByPositiveResult + ResolvedByStateChange State = original.ResolvedByStateChange + ResolvedByTimer State = original.ResolvedByTimer + ResolvedManually State = original.ResolvedManually +) + +type ValueDeltaOperationType = original.ValueDeltaOperationType + +const ( + ValueDeltaOperationTypeAdd ValueDeltaOperationType = original.ValueDeltaOperationTypeAdd + ValueDeltaOperationTypeDelete ValueDeltaOperationType = original.ValueDeltaOperationTypeDelete + ValueDeltaOperationTypeUndefined ValueDeltaOperationType = original.ValueDeltaOperationTypeUndefined + ValueDeltaOperationTypeUpdate ValueDeltaOperationType = original.ValueDeltaOperationTypeUpdate +) + +type ValueType = original.ValueType + +const ( + ValueTypeBinary ValueType = original.ValueTypeBinary + ValueTypeBoolean ValueType = original.ValueTypeBoolean + ValueTypeDn ValueType = original.ValueTypeDn + ValueTypeInteger ValueType = original.ValueTypeInteger + ValueTypeString ValueType = original.ValueTypeString + ValueTypeUndefined ValueType = original.ValueTypeUndefined +) + +type AdditionalInformation = original.AdditionalInformation +type AddsServiceMember = original.AddsServiceMember +type AddsServiceMembers = original.AddsServiceMembers +type Agent = original.Agent +type Alert = original.Alert +type AlertFeedback = original.AlertFeedback +type AlertFeedbacks = original.AlertFeedbacks +type Alerts = original.Alerts +type AssociatedObject = original.AssociatedObject +type AttributeDelta = original.AttributeDelta +type AttributeMapping = original.AttributeMapping +type AttributeMppingSource = original.AttributeMppingSource +type Bool = original.Bool +type ChangeNotReimported = original.ChangeNotReimported +type ChangeNotReimportedDelta = original.ChangeNotReimportedDelta +type ChangeNotReimportedEntry = original.ChangeNotReimportedEntry +type Connector = original.Connector +type ConnectorConnectionError = original.ConnectorConnectionError +type ConnectorConnectionErrors = original.ConnectorConnectionErrors +type ConnectorObjectError = original.ConnectorObjectError +type ConnectorObjectErrors = original.ConnectorObjectErrors +type Connectors = original.Connectors +type Credential = original.Credential +type DataFreshnessDetail = original.DataFreshnessDetail +type Display = original.Display +type ErrorCount = original.ErrorCount +type ErrorCounts = original.ErrorCounts +type ErrorDetail = original.ErrorDetail +type ErrorReportUsersEntries = original.ErrorReportUsersEntries +type ErrorReportUsersEntry = original.ErrorReportUsersEntry +type ExportError = original.ExportError +type ExportErrors = original.ExportErrors +type ExportStatus = original.ExportStatus +type ExportStatuses = original.ExportStatuses +type ExtensionErrorInfo = original.ExtensionErrorInfo +type ForestSummary = original.ForestSummary +type GlobalConfiguration = original.GlobalConfiguration +type HelpLink = original.HelpLink +type Hotfix = original.Hotfix +type Hotfixes = original.Hotfixes +type ImportError = original.ImportError +type ImportErrors = original.ImportErrors +type InboundReplicationNeighbor = original.InboundReplicationNeighbor +type InboundReplicationNeighbors = original.InboundReplicationNeighbors +type Item = original.Item +type Items = original.Items +type ListString = original.ListString +type MergedExportError = original.MergedExportError +type MergedExportErrors = original.MergedExportErrors +type MetricGroup = original.MetricGroup +type MetricMetadata = original.MetricMetadata +type MetricMetadataList = original.MetricMetadataList +type MetricSet = original.MetricSet +type MetricSets = original.MetricSets +type ModuleConfiguration = original.ModuleConfiguration +type ModuleConfigurations = original.ModuleConfigurations +type ObjectWithSyncError = original.ObjectWithSyncError +type Operation = original.Operation +type OperationListResponse = original.OperationListResponse +type Partition = original.Partition +type PartitionScope = original.PartitionScope +type PasswordHashSyncConfiguration = original.PasswordHashSyncConfiguration +type PasswordManagementSettings = original.PasswordManagementSettings +type ReplicationStatus = original.ReplicationStatus +type ReplicationSummary = original.ReplicationSummary +type ReplicationSummaryList = original.ReplicationSummaryList +type RuleErrorInfo = original.RuleErrorInfo +type RunProfile = original.RunProfile +type RunProfiles = original.RunProfiles +type RunStep = original.RunStep +type Service = original.Service +type ServiceConfiguration = original.ServiceConfiguration +type ServiceMember = original.ServiceMember +type ServiceMemberProperties = original.ServiceMemberProperties +type ServiceMembers = original.ServiceMembers +type ServiceProperties = original.ServiceProperties +type Services = original.Services +type TabularExportError = original.TabularExportError +type Tenant = original.Tenant +type TenantOnboardingDetails = original.TenantOnboardingDetails +type ValueDelta = original.ValueDelta +type OperationsClient = original.OperationsClient +type PremiumCheckClient = original.PremiumCheckClient +type ReplicationstatusClient = original.ReplicationstatusClient +type ReplicationsummaryClient = original.ReplicationsummaryClient +type ServicesClient = original.ServicesClient + +func NewAddomainservicemembersClient() AddomainservicemembersClient { + return original.NewAddomainservicemembersClient() +} +func NewAddomainservicemembersClientWithBaseURI(baseURI string) AddomainservicemembersClient { + return original.NewAddomainservicemembersClientWithBaseURI(baseURI) +} +func NewAddsservicemembersClient() AddsservicemembersClient { + return original.NewAddsservicemembersClient() +} +func NewAddsservicemembersClientWithBaseURI(baseURI string) AddsservicemembersClient { + return original.NewAddsservicemembersClientWithBaseURI(baseURI) +} +func NewAddsservicesClient() AddsservicesClient { + return original.NewAddsservicesClient() +} +func NewAddsservicesClientWithBaseURI(baseURI string) AddsservicesClient { + return original.NewAddsservicesClientWithBaseURI(baseURI) +} +func NewAlertsClient() AlertsClient { + return original.NewAlertsClient() +} +func NewAlertsClientWithBaseURI(baseURI string) AlertsClient { + return original.NewAlertsClientWithBaseURI(baseURI) +} +func New() BaseClient { + return original.New() +} +func NewWithBaseURI(baseURI string) BaseClient { + return original.NewWithBaseURI(baseURI) +} +func NewConfigurationClient() ConfigurationClient { + return original.NewConfigurationClient() +} +func NewConfigurationClientWithBaseURI(baseURI string) ConfigurationClient { + return original.NewConfigurationClientWithBaseURI(baseURI) +} +func NewFeedbackClient() FeedbackClient { + return original.NewFeedbackClient() +} +func NewFeedbackClientWithBaseURI(baseURI string) FeedbackClient { + return original.NewFeedbackClientWithBaseURI(baseURI) +} +func NewForestsummaryClient() ForestsummaryClient { + return original.NewForestsummaryClient() +} +func NewForestsummaryClientWithBaseURI(baseURI string) ForestsummaryClient { + return original.NewForestsummaryClientWithBaseURI(baseURI) +} +func NewMetricmetadataClient() MetricmetadataClient { + return original.NewMetricmetadataClient() +} +func NewMetricmetadataClientWithBaseURI(baseURI string) MetricmetadataClient { + return original.NewMetricmetadataClientWithBaseURI(baseURI) +} +func NewMetricsClient() MetricsClient { + return original.NewMetricsClient() +} +func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { + return original.NewMetricsClientWithBaseURI(baseURI) +} +func PossibleAlgorithmStepTypeValues() []AlgorithmStepType { + return original.PossibleAlgorithmStepTypeValues() +} +func PossibleAttributeDeltaOperationTypeValues() []AttributeDeltaOperationType { + return original.PossibleAttributeDeltaOperationTypeValues() +} +func PossibleAttributeMappingTypeValues() []AttributeMappingType { + return original.PossibleAttributeMappingTypeValues() +} +func PossibleDeltaOperationTypeValues() []DeltaOperationType { + return original.PossibleDeltaOperationTypeValues() +} +func PossibleHealthStatusValues() []HealthStatus { + return original.PossibleHealthStatusValues() +} +func PossibleLevelValues() []Level { + return original.PossibleLevelValues() +} +func PossibleMonitoringLevelValues() []MonitoringLevel { + return original.PossibleMonitoringLevelValues() +} +func PossiblePasswordOperationTypesValues() []PasswordOperationTypes { + return original.PossiblePasswordOperationTypesValues() +} +func PossibleRunStepOperationTypeValues() []RunStepOperationType { + return original.PossibleRunStepOperationTypeValues() +} +func PossibleServerDisabledReasonValues() []ServerDisabledReason { + return original.PossibleServerDisabledReasonValues() +} +func PossibleServiceTypeValues() []ServiceType { + return original.PossibleServiceTypeValues() +} +func PossibleStateValues() []State { + return original.PossibleStateValues() +} +func PossibleValueDeltaOperationTypeValues() []ValueDeltaOperationType { + return original.PossibleValueDeltaOperationTypeValues() +} +func PossibleValueTypeValues() []ValueType { + return original.PossibleValueTypeValues() +} +func NewOperationsClient() OperationsClient { + return original.NewOperationsClient() +} +func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI) +} +func NewPremiumCheckClient() PremiumCheckClient { + return original.NewPremiumCheckClient() +} +func NewPremiumCheckClientWithBaseURI(baseURI string) PremiumCheckClient { + return original.NewPremiumCheckClientWithBaseURI(baseURI) +} +func NewReplicationstatusClient() ReplicationstatusClient { + return original.NewReplicationstatusClient() +} +func NewReplicationstatusClientWithBaseURI(baseURI string) ReplicationstatusClient { + return original.NewReplicationstatusClientWithBaseURI(baseURI) +} +func NewReplicationsummaryClient() ReplicationsummaryClient { + return original.NewReplicationsummaryClient() +} +func NewReplicationsummaryClientWithBaseURI(baseURI string) ReplicationsummaryClient { + return original.NewReplicationsummaryClientWithBaseURI(baseURI) +} +func NewServicesClient() ServicesClient { + return original.NewServicesClient() +} +func NewServicesClientWithBaseURI(baseURI string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI) +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addomainservicemembers.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addomainservicemembers.go new file mode 100644 index 000000000000..15d5269c4692 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addomainservicemembers.go @@ -0,0 +1,124 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AddomainservicemembersClient is the REST APIs for Azure Active Drectory Connect Health +type AddomainservicemembersClient struct { + BaseClient +} + +// NewAddomainservicemembersClient creates an instance of the AddomainservicemembersClient client. +func NewAddomainservicemembersClient() AddomainservicemembersClient { + return NewAddomainservicemembersClientWithBaseURI(DefaultBaseURI) +} + +// NewAddomainservicemembersClientWithBaseURI creates an instance of the AddomainservicemembersClient client. +func NewAddomainservicemembersClientWithBaseURI(baseURI string) AddomainservicemembersClient { + return AddomainservicemembersClient{NewWithBaseURI(baseURI)} +} + +// GetServiceMembersV2 gets the details of the servers, for a given Active Directory Domain Service, that are onboarded +// to Azure Active Directory Connect Health. +// +// serviceName is the name of the service. isGroupbySite is indicates if the result should be grouped by site or +// not. filter is the server property filter to apply. query is the custom query. nextPartitionKey is the next +// partition key to query for. nextRowKey is the next row key to query for. takeCount is the take count , which +// specifies the number of elements that can be returned from a sequence. +func (client AddomainservicemembersClient) GetServiceMembersV2(ctx context.Context, serviceName string, isGroupbySite bool, filter string, query string, nextPartitionKey string, nextRowKey string, takeCount *int32) (result AddsServiceMembers, err error) { + req, err := client.GetServiceMembersV2Preparer(ctx, serviceName, isGroupbySite, filter, query, nextPartitionKey, nextRowKey, takeCount) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddomainservicemembersClient", "GetServiceMembersV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMembersV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddomainservicemembersClient", "GetServiceMembersV2", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMembersV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddomainservicemembersClient", "GetServiceMembersV2", resp, "Failure responding to request") + } + + return +} + +// GetServiceMembersV2Preparer prepares the GetServiceMembersV2 request. +func (client AddomainservicemembersClient) GetServiceMembersV2Preparer(ctx context.Context, serviceName string, isGroupbySite bool, filter string, query string, nextPartitionKey string, nextRowKey string, takeCount *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "isGroupbySite": autorest.Encode("query", isGroupbySite), + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(query) > 0 { + queryParameters["query"] = autorest.Encode("query", query) + } + if len(nextPartitionKey) > 0 { + queryParameters["nextPartitionKey"] = autorest.Encode("query", nextPartitionKey) + } + if len(nextRowKey) > 0 { + queryParameters["nextRowKey"] = autorest.Encode("query", nextRowKey) + } + if takeCount != nil { + queryParameters["takeCount"] = autorest.Encode("query", *takeCount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/addomainservicemembers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMembersV2Sender sends the GetServiceMembersV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AddomainservicemembersClient) GetServiceMembersV2Sender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMembersV2Responder handles the response to the GetServiceMembersV2 request. The method always +// closes the http.Response Body. +func (client AddomainservicemembersClient) GetServiceMembersV2Responder(resp *http.Response) (result AddsServiceMembers, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go new file mode 100644 index 000000000000..09b64788989e --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservicemembers.go @@ -0,0 +1,108 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AddsservicemembersClient is the REST APIs for Azure Active Drectory Connect Health +type AddsservicemembersClient struct { + BaseClient +} + +// NewAddsservicemembersClient creates an instance of the AddsservicemembersClient client. +func NewAddsservicemembersClient() AddsservicemembersClient { + return NewAddsservicemembersClientWithBaseURI(DefaultBaseURI) +} + +// NewAddsservicemembersClientWithBaseURI creates an instance of the AddsservicemembersClient client. +func NewAddsservicemembersClientWithBaseURI(baseURI string) AddsservicemembersClient { + return AddsservicemembersClient{NewWithBaseURI(baseURI)} +} + +// GetServiceMembers gets the details of the Active Directory Domain servers, for a given Active Directory Domain +// Service, that are onboarded to Azure Active Directory Connect Health. +// +// serviceName is the name of the service. filter is the server property filter to apply. +func (client AddsservicemembersClient) GetServiceMembers(ctx context.Context, serviceName string, filter string) (result AddsServiceMembers, err error) { + req, err := client.GetServiceMembersPreparer(ctx, serviceName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicemembersClient", "GetServiceMembers", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMembersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicemembersClient", "GetServiceMembers", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMembersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicemembersClient", "GetServiceMembers", resp, "Failure responding to request") + } + + return +} + +// GetServiceMembersPreparer prepares the GetServiceMembers request. +func (client AddsservicemembersClient) GetServiceMembersPreparer(ctx context.Context, serviceName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/addsservicemembers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMembersSender sends the GetServiceMembers request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicemembersClient) GetServiceMembersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMembersResponder handles the response to the GetServiceMembers request. The method always +// closes the http.Response Body. +func (client AddsservicemembersClient) GetServiceMembersResponder(resp *http.Response) (result AddsServiceMembers, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go new file mode 100644 index 000000000000..bf7acc7dceb6 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/addsservices.go @@ -0,0 +1,653 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AddsservicesClient is the REST APIs for Azure Active Drectory Connect Health +type AddsservicesClient struct { + BaseClient +} + +// NewAddsservicesClient creates an instance of the AddsservicesClient client. +func NewAddsservicesClient() AddsservicesClient { + return NewAddsservicesClientWithBaseURI(DefaultBaseURI) +} + +// NewAddsservicesClientWithBaseURI creates an instance of the AddsservicesClient client. +func NewAddsservicesClientWithBaseURI(baseURI string) AddsservicesClient { + return AddsservicesClient{NewWithBaseURI(baseURI)} +} + +// DeleteService deletes an Active Directory Domain Service which is onboarded to Azure Active Directory Connect +// Health. +// +// serviceName is the name of the service which needs to be deleted. confirm is indicates if the service will be +// permanently deleted or disabled. True indicates that the service will be permanently deleted and False indicates +// that the service will be marked disabled and then deleted after 30 days, if it is not re-registered. +func (client AddsservicesClient) DeleteService(ctx context.Context, serviceName string, confirm *bool) (result autorest.Response, err error) { + req, err := client.DeleteServicePreparer(ctx, serviceName, confirm) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "DeleteService", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteServiceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "DeleteService", resp, "Failure sending request") + return + } + + result, err = client.DeleteServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "DeleteService", resp, "Failure responding to request") + } + + return +} + +// DeleteServicePreparer prepares the DeleteService request. +func (client AddsservicesClient) DeleteServicePreparer(ctx context.Context, serviceName string, confirm *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if confirm != nil { + queryParameters["confirm"] = autorest.Encode("query", *confirm) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteServiceSender sends the DeleteService request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) DeleteServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteServiceResponder handles the response to the DeleteService request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetAddsServiceMetricsSum gets the sum of the metric values for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name +func (client AddsservicesClient) GetAddsServiceMetricsSum(ctx context.Context, serviceName string, metricName string, groupName string) (result Items, err error) { + req, err := client.GetAddsServiceMetricsSumPreparer(ctx, serviceName, metricName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetAddsServiceMetricsSum", nil, "Failure preparing request") + return + } + + resp, err := client.GetAddsServiceMetricsSumSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetAddsServiceMetricsSum", resp, "Failure sending request") + return + } + + result, err = client.GetAddsServiceMetricsSumResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetAddsServiceMetricsSum", resp, "Failure responding to request") + } + + return +} + +// GetAddsServiceMetricsSumPreparer prepares the GetAddsServiceMetricsSum request. +func (client AddsservicesClient) GetAddsServiceMetricsSumPreparer(ctx context.Context, serviceName string, metricName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}/sum", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAddsServiceMetricsSumSender sends the GetAddsServiceMetricsSum request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) GetAddsServiceMetricsSumSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAddsServiceMetricsSumResponder handles the response to the GetAddsServiceMetricsSum request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) GetAddsServiceMetricsSumResponder(resp *http.Response) (result Items, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConfiguration gets the service configurations. +// +// serviceName is the name of the service. grouping is the grouping for configurations. +func (client AddsservicesClient) GetConfiguration(ctx context.Context, serviceName string, grouping string) (result Tenant, err error) { + req, err := client.GetConfigurationPreparer(ctx, serviceName, grouping) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetConfiguration", resp, "Failure responding to request") + } + + return +} + +// GetConfigurationPreparer prepares the GetConfiguration request. +func (client AddsservicesClient) GetConfigurationPreparer(ctx context.Context, serviceName string, grouping string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + queryParameters := map[string]interface{}{} + if len(grouping) > 0 { + queryParameters["grouping"] = autorest.Encode("query", grouping) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/configuration", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConfigurationSender sends the GetConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) GetConfigurationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetConfigurationResponder handles the response to the GetConfiguration request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) GetConfigurationResponder(resp *http.Response) (result Tenant, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDimensions gets the dimensions for a given dimension type in a server. +// +// serviceName is the name of the service. dimension is the dimension type. +func (client AddsservicesClient) GetDimensions(ctx context.Context, serviceName string, dimension string) (result ListString, err error) { + req, err := client.GetDimensionsPreparer(ctx, serviceName, dimension) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetDimensions", nil, "Failure preparing request") + return + } + + resp, err := client.GetDimensionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetDimensions", resp, "Failure sending request") + return + } + + result, err = client.GetDimensionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetDimensions", resp, "Failure responding to request") + } + + return +} + +// GetDimensionsPreparer prepares the GetDimensions request. +func (client AddsservicesClient) GetDimensionsPreparer(ctx context.Context, serviceName string, dimension string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dimension": autorest.Encode("path", dimension), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/dimensions/{dimension}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDimensionsSender sends the GetDimensions request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) GetDimensionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetDimensionsResponder handles the response to the GetDimensions request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) GetDimensionsResponder(resp *http.Response) (result ListString, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetService gets the details of an Active Directory Domain Service for a tenant having Azure AD Premium license and +// is onboarded to Azure Active Directory Connect Health. +// +// serviceName is the name of the service. +func (client AddsservicesClient) GetService(ctx context.Context, serviceName string) (result Service, err error) { + req, err := client.GetServicePreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetService", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetService", resp, "Failure sending request") + return + } + + result, err = client.GetServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetService", resp, "Failure responding to request") + } + + return +} + +// GetServicePreparer prepares the GetService request. +func (client AddsservicesClient) GetServicePreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceSender sends the GetService request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) GetServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceResponder handles the response to the GetService request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) GetServiceResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServices gets the details of Active Directory Domain Service, for a tenant, that are onboarded to Azure Active +// Directory Connect Health. +// +// filter is the service property filter to apply. serviceType is the service type for the services onboarded to +// Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, +// the service type can either be AdFederationService or AadSyncService or AdDomainService. skipCount is the skip +// count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining +// elements. takeCount is the take count , which specifies the number of elements that can be returned from a +// sequence. +func (client AddsservicesClient) GetServices(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result Services, err error) { + req, err := client.GetServicesPreparer(ctx, filter, serviceType, skipCount, takeCount) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetServices", nil, "Failure preparing request") + return + } + + resp, err := client.GetServicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetServices", resp, "Failure sending request") + return + } + + result, err = client.GetServicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetServices", resp, "Failure responding to request") + } + + return +} + +// GetServicesPreparer prepares the GetServices request. +func (client AddsservicesClient) GetServicesPreparer(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(serviceType) > 0 { + queryParameters["serviceType"] = autorest.Encode("query", serviceType) + } + if skipCount != nil { + queryParameters["skipCount"] = autorest.Encode("query", *skipCount) + } + if takeCount != nil { + queryParameters["takeCount"] = autorest.Encode("query", *takeCount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/addsservices"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServicesSender sends the GetServices request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) GetServicesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServicesResponder handles the response to the GetServices request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) GetServicesResponder(resp *http.Response) (result Services, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServicesPremiumCheck gets the details of Active Directory Domain Services for a tenant having Azure AD Premium +// license and is onboarded to Azure Active Directory Connect Health. +// +// filter is the service property filter to apply. serviceType is the service type for the services onboarded to +// Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, +// the service type can either be AdFederationService or AadSyncService or AdDomainService. skipCount is the skip +// count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining +// elements. takeCount is the take count , which specifies the number of elements that can be returned from a +// sequence. +func (client AddsservicesClient) GetServicesPremiumCheck(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result Services, err error) { + req, err := client.GetServicesPremiumCheckPreparer(ctx, filter, serviceType, skipCount, takeCount) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetServicesPremiumCheck", nil, "Failure preparing request") + return + } + + resp, err := client.GetServicesPremiumCheckSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetServicesPremiumCheck", resp, "Failure sending request") + return + } + + result, err = client.GetServicesPremiumCheckResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "GetServicesPremiumCheck", resp, "Failure responding to request") + } + + return +} + +// GetServicesPremiumCheckPreparer prepares the GetServicesPremiumCheck request. +func (client AddsservicesClient) GetServicesPremiumCheckPreparer(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(serviceType) > 0 { + queryParameters["serviceType"] = autorest.Encode("query", serviceType) + } + if skipCount != nil { + queryParameters["skipCount"] = autorest.Encode("query", *skipCount) + } + if takeCount != nil { + queryParameters["takeCount"] = autorest.Encode("query", *takeCount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/addsservices/premiumCheck"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServicesPremiumCheckSender sends the GetServicesPremiumCheck request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) GetServicesPremiumCheckSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServicesPremiumCheckResponder handles the response to the GetServicesPremiumCheck request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) GetServicesPremiumCheckResponder(resp *http.Response) (result Services, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Postaddsservices onboards a service for a given tenant in Azure Active Directory Connect Health. +// +// service is the service object. +func (client AddsservicesClient) Postaddsservices(ctx context.Context, service Service) (result Service, err error) { + req, err := client.PostaddsservicesPreparer(ctx, service) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "Postaddsservices", nil, "Failure preparing request") + return + } + + resp, err := client.PostaddsservicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "Postaddsservices", resp, "Failure sending request") + return + } + + result, err = client.PostaddsservicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "Postaddsservices", resp, "Failure responding to request") + } + + return +} + +// PostaddsservicesPreparer prepares the Postaddsservices request. +func (client AddsservicesClient) PostaddsservicesPreparer(ctx context.Context, service Service) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/addsservices"), + autorest.WithJSON(service), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostaddsservicesSender sends the Postaddsservices request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) PostaddsservicesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PostaddsservicesResponder handles the response to the Postaddsservices request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) PostaddsservicesResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateService updates an Active Directory Domain Service properties of an onboarded service. +// +// serviceName is the name of the service which needs to be deleted. service is the service object. +func (client AddsservicesClient) UpdateService(ctx context.Context, serviceName string, service Service) (result Service, err error) { + req, err := client.UpdateServicePreparer(ctx, serviceName, service) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "UpdateService", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "UpdateService", resp, "Failure sending request") + return + } + + result, err = client.UpdateServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AddsservicesClient", "UpdateService", resp, "Failure responding to request") + } + + return +} + +// UpdateServicePreparer prepares the UpdateService request. +func (client AddsservicesClient) UpdateServicePreparer(ctx context.Context, serviceName string, service Service) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}", pathParameters), + autorest.WithJSON(service), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateServiceSender sends the UpdateService request. The method will close the +// http.Response Body if it receives an error. +func (client AddsservicesClient) UpdateServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateServiceResponder handles the response to the UpdateService request. The method always +// closes the http.Response Body. +func (client AddsservicesClient) UpdateServiceResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/alerts.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/alerts.go new file mode 100644 index 000000000000..6eb900356ae4 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/alerts.go @@ -0,0 +1,276 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/satori/go.uuid" + "net/http" +) + +// AlertsClient is the REST APIs for Azure Active Drectory Connect Health +type AlertsClient struct { + BaseClient +} + +// NewAlertsClient creates an instance of the AlertsClient client. +func NewAlertsClient() AlertsClient { + return NewAlertsClientWithBaseURI(DefaultBaseURI) +} + +// NewAlertsClientWithBaseURI creates an instance of the AlertsClient client. +func NewAlertsClientWithBaseURI(baseURI string) AlertsClient { + return AlertsClient{NewWithBaseURI(baseURI)} +} + +// GetAddsServiceMemberAlerts gets the details of an alert for a given Active Directory Domain Controller service and +// server combination. +// +// serviceMemberID is the server Id for which the laert details needs to be queried. serviceName is the name of the +// service. filter is the alert property filter to apply. state is the alert state to query for. from is the start +// date to query for. toParameter is the end date till when to query for. +func (client AlertsClient) GetAddsServiceMemberAlerts(ctx context.Context, serviceMemberID uuid.UUID, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (result Alerts, err error) { + req, err := client.GetAddsServiceMemberAlertsPreparer(ctx, serviceMemberID, serviceName, filter, state, from, toParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAddsServiceMemberAlerts", nil, "Failure preparing request") + return + } + + resp, err := client.GetAddsServiceMemberAlertsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAddsServiceMemberAlerts", resp, "Failure sending request") + return + } + + result, err = client.GetAddsServiceMemberAlertsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAddsServiceMemberAlerts", resp, "Failure responding to request") + } + + return +} + +// GetAddsServiceMemberAlertsPreparer prepares the GetAddsServiceMemberAlerts request. +func (client AlertsClient) GetAddsServiceMemberAlertsPreparer(ctx context.Context, serviceMemberID uuid.UUID, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(state) > 0 { + queryParameters["state"] = autorest.Encode("query", state) + } + if from != nil { + queryParameters["from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["to"] = autorest.Encode("query", *toParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers/{serviceMemberId}/alerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAddsServiceMemberAlertsSender sends the GetAddsServiceMemberAlerts request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) GetAddsServiceMemberAlertsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAddsServiceMemberAlertsResponder handles the response to the GetAddsServiceMemberAlerts request. The method always +// closes the http.Response Body. +func (client AlertsClient) GetAddsServiceMemberAlertsResponder(resp *http.Response) (result Alerts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAddsServicesAlerts gets the alerts for a given Active Directory Domain Service. +// +// serviceName is the name of the service. filter is the alert property filter to apply. state is the alert state +// to query for. from is the start date to query for. toParameter is the end date till when to query for. +func (client AlertsClient) GetAddsServicesAlerts(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (result Alerts, err error) { + req, err := client.GetAddsServicesAlertsPreparer(ctx, serviceName, filter, state, from, toParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAddsServicesAlerts", nil, "Failure preparing request") + return + } + + resp, err := client.GetAddsServicesAlertsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAddsServicesAlerts", resp, "Failure sending request") + return + } + + result, err = client.GetAddsServicesAlertsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAddsServicesAlerts", resp, "Failure responding to request") + } + + return +} + +// GetAddsServicesAlertsPreparer prepares the GetAddsServicesAlerts request. +func (client AlertsClient) GetAddsServicesAlertsPreparer(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(state) > 0 { + queryParameters["state"] = autorest.Encode("query", state) + } + if from != nil { + queryParameters["from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["to"] = autorest.Encode("query", *toParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/alerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAddsServicesAlertsSender sends the GetAddsServicesAlerts request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) GetAddsServicesAlertsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAddsServicesAlertsResponder handles the response to the GetAddsServicesAlerts request. The method always +// closes the http.Response Body. +func (client AlertsClient) GetAddsServicesAlertsResponder(resp *http.Response) (result Alerts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAlerts gets the alerts for a given service. +// +// serviceName is the name of the service. filter is the alert property filter to apply. state is the alert state +// to query for. from is the start date to query for. toParameter is the end date till when to query for. +func (client AlertsClient) GetAlerts(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (result Alerts, err error) { + req, err := client.GetAlertsPreparer(ctx, serviceName, filter, state, from, toParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAlerts", nil, "Failure preparing request") + return + } + + resp, err := client.GetAlertsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAlerts", resp, "Failure sending request") + return + } + + result, err = client.GetAlertsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.AlertsClient", "GetAlerts", resp, "Failure responding to request") + } + + return +} + +// GetAlertsPreparer prepares the GetAlerts request. +func (client AlertsClient) GetAlertsPreparer(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(state) > 0 { + queryParameters["state"] = autorest.Encode("query", state) + } + if from != nil { + queryParameters["from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["to"] = autorest.Encode("query", *toParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/alerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAlertsSender sends the GetAlerts request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) GetAlertsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAlertsResponder handles the response to the GetAlerts request. The method always +// closes the http.Response Body. +func (client AlertsClient) GetAlertsResponder(resp *http.Response) (result Alerts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/client.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/client.go new file mode 100644 index 000000000000..ac9ddd7f982c --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/client.go @@ -0,0 +1,119 @@ +// Package adhybridhealthservice implements the Azure ARM Adhybridhealthservice service API version 2014-01-01. +// +// REST APIs for Azure Active Drectory Connect Health +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Adhybridhealthservice + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Adhybridhealthservice. +type BaseClient struct { + autorest.Client + BaseURI string +} + +// New creates an instance of the BaseClient client. +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + } +} + +// ServicesGetBadPwdUserReport gets the bad password login attempt report for an user +// +// serviceName is the name of the service. dataSource is the source of data, if its test data or customer data. +func (client BaseClient) ServicesGetBadPwdUserReport(ctx context.Context, serviceName string, dataSource string) (result ErrorReportUsersEntries, err error) { + req, err := client.ServicesGetBadPwdUserReportPreparer(ctx, serviceName, dataSource) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.BaseClient", "ServicesGetBadPwdUserReport", nil, "Failure preparing request") + return + } + + resp, err := client.ServicesGetBadPwdUserReportSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.BaseClient", "ServicesGetBadPwdUserReport", resp, "Failure sending request") + return + } + + result, err = client.ServicesGetBadPwdUserReportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.BaseClient", "ServicesGetBadPwdUserReport", resp, "Failure responding to request") + } + + return +} + +// ServicesGetBadPwdUserReportPreparer prepares the ServicesGetBadPwdUserReport request. +func (client BaseClient) ServicesGetBadPwdUserReportPreparer(ctx context.Context, serviceName string, dataSource string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(dataSource) > 0 { + queryParameters["dataSource"] = autorest.Encode("query", dataSource) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/badpassword/details/user", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ServicesGetBadPwdUserReportSender sends the ServicesGetBadPwdUserReport request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ServicesGetBadPwdUserReportSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ServicesGetBadPwdUserReportResponder handles the response to the ServicesGetBadPwdUserReport request. The method always +// closes the http.Response Body. +func (client BaseClient) ServicesGetBadPwdUserReportResponder(resp *http.Response) (result ErrorReportUsersEntries, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/configuration.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/configuration.go new file mode 100644 index 000000000000..f2091ddea3a5 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/configuration.go @@ -0,0 +1,218 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ConfigurationClient is the REST APIs for Azure Active Drectory Connect Health +type ConfigurationClient struct { + BaseClient +} + +// NewConfigurationClient creates an instance of the ConfigurationClient client. +func NewConfigurationClient() ConfigurationClient { + return NewConfigurationClientWithBaseURI(DefaultBaseURI) +} + +// NewConfigurationClientWithBaseURI creates an instance of the ConfigurationClient client. +func NewConfigurationClientWithBaseURI(baseURI string) ConfigurationClient { + return ConfigurationClient{NewWithBaseURI(baseURI)} +} + +// GetTenant gets the details of a tenant onboarded to Azure Active Directory Connect Health. +func (client ConfigurationClient) GetTenant(ctx context.Context) (result Tenant, err error) { + req, err := client.GetTenantPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "GetTenant", nil, "Failure preparing request") + return + } + + resp, err := client.GetTenantSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "GetTenant", resp, "Failure sending request") + return + } + + result, err = client.GetTenantResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "GetTenant", resp, "Failure responding to request") + } + + return +} + +// GetTenantPreparer prepares the GetTenant request. +func (client ConfigurationClient) GetTenantPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/configuration"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTenantSender sends the GetTenant request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationClient) GetTenantSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetTenantResponder handles the response to the GetTenant request. The method always +// closes the http.Response Body. +func (client ConfigurationClient) GetTenantResponder(resp *http.Response) (result Tenant, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PatchTenant updates tenant properties for tenants onboarded to Azure Active Directory Connect Health. +// +// tenant is the tenant object with the properties set to the updated value. +func (client ConfigurationClient) PatchTenant(ctx context.Context, tenant Tenant) (result Tenant, err error) { + req, err := client.PatchTenantPreparer(ctx, tenant) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "PatchTenant", nil, "Failure preparing request") + return + } + + resp, err := client.PatchTenantSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "PatchTenant", resp, "Failure sending request") + return + } + + result, err = client.PatchTenantResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "PatchTenant", resp, "Failure responding to request") + } + + return +} + +// PatchTenantPreparer prepares the PatchTenant request. +func (client ConfigurationClient) PatchTenantPreparer(ctx context.Context, tenant Tenant) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/configuration"), + autorest.WithJSON(tenant), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchTenantSender sends the PatchTenant request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationClient) PatchTenantSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PatchTenantResponder handles the response to the PatchTenant request. The method always +// closes the http.Response Body. +func (client ConfigurationClient) PatchTenantResponder(resp *http.Response) (result Tenant, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PostTenantConfiguration onboards a tenant in Azure Active Directory Connect Health. +func (client ConfigurationClient) PostTenantConfiguration(ctx context.Context) (result Tenant, err error) { + req, err := client.PostTenantConfigurationPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "PostTenantConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.PostTenantConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "PostTenantConfiguration", resp, "Failure sending request") + return + } + + result, err = client.PostTenantConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ConfigurationClient", "PostTenantConfiguration", resp, "Failure responding to request") + } + + return +} + +// PostTenantConfigurationPreparer prepares the PostTenantConfiguration request. +func (client ConfigurationClient) PostTenantConfigurationPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/configuration"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostTenantConfigurationSender sends the PostTenantConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationClient) PostTenantConfigurationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PostTenantConfigurationResponder handles the response to the PostTenantConfiguration request. The method always +// closes the http.Response Body. +func (client ConfigurationClient) PostTenantConfigurationResponder(resp *http.Response) (result Tenant, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusForbidden), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/feedback.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/feedback.go new file mode 100644 index 000000000000..0f5fb7ac91de --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/feedback.go @@ -0,0 +1,106 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// FeedbackClient is the REST APIs for Azure Active Drectory Connect Health +type FeedbackClient struct { + BaseClient +} + +// NewFeedbackClient creates an instance of the FeedbackClient client. +func NewFeedbackClient() FeedbackClient { + return NewFeedbackClientWithBaseURI(DefaultBaseURI) +} + +// NewFeedbackClientWithBaseURI creates an instance of the FeedbackClient client. +func NewFeedbackClientWithBaseURI(baseURI string) FeedbackClient { + return FeedbackClient{NewWithBaseURI(baseURI)} +} + +// AddAlertFeedback adds an alert feedback submitted by customer. +// +// serviceName is the name of the service. alertFeedback is the alert feedback. +func (client FeedbackClient) AddAlertFeedback(ctx context.Context, serviceName string, alertFeedback AlertFeedback) (result AlertFeedback, err error) { + req, err := client.AddAlertFeedbackPreparer(ctx, serviceName, alertFeedback) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.FeedbackClient", "AddAlertFeedback", nil, "Failure preparing request") + return + } + + resp, err := client.AddAlertFeedbackSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.FeedbackClient", "AddAlertFeedback", resp, "Failure sending request") + return + } + + result, err = client.AddAlertFeedbackResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.FeedbackClient", "AddAlertFeedback", resp, "Failure responding to request") + } + + return +} + +// AddAlertFeedbackPreparer prepares the AddAlertFeedback request. +func (client FeedbackClient) AddAlertFeedbackPreparer(ctx context.Context, serviceName string, alertFeedback AlertFeedback) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/feedback", pathParameters), + autorest.WithJSON(alertFeedback), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddAlertFeedbackSender sends the AddAlertFeedback request. The method will close the +// http.Response Body if it receives an error. +func (client FeedbackClient) AddAlertFeedbackSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddAlertFeedbackResponder handles the response to the AddAlertFeedback request. The method always +// closes the http.Response Body. +func (client FeedbackClient) AddAlertFeedbackResponder(resp *http.Response) (result AlertFeedback, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/forestsummary.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/forestsummary.go new file mode 100644 index 000000000000..06f10ee21094 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/forestsummary.go @@ -0,0 +1,105 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ForestsummaryClient is the REST APIs for Azure Active Drectory Connect Health +type ForestsummaryClient struct { + BaseClient +} + +// NewForestsummaryClient creates an instance of the ForestsummaryClient client. +func NewForestsummaryClient() ForestsummaryClient { + return NewForestsummaryClientWithBaseURI(DefaultBaseURI) +} + +// NewForestsummaryClientWithBaseURI creates an instance of the ForestsummaryClient client. +func NewForestsummaryClientWithBaseURI(baseURI string) ForestsummaryClient { + return ForestsummaryClient{NewWithBaseURI(baseURI)} +} + +// GetForestSummary gets the forest summary for a given Active Directory Domain Service, that is onboarded to Azure +// Active Directory Connect Health. +// +// serviceName is the name of the service. +func (client ForestsummaryClient) GetForestSummary(ctx context.Context, serviceName string) (result ForestSummary, err error) { + req, err := client.GetForestSummaryPreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ForestsummaryClient", "GetForestSummary", nil, "Failure preparing request") + return + } + + resp, err := client.GetForestSummarySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ForestsummaryClient", "GetForestSummary", resp, "Failure sending request") + return + } + + result, err = client.GetForestSummaryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ForestsummaryClient", "GetForestSummary", resp, "Failure responding to request") + } + + return +} + +// GetForestSummaryPreparer prepares the GetForestSummary request. +func (client ForestsummaryClient) GetForestSummaryPreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/forestsummary", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetForestSummarySender sends the GetForestSummary request. The method will close the +// http.Response Body if it receives an error. +func (client ForestsummaryClient) GetForestSummarySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetForestSummaryResponder handles the response to the GetForestSummary request. The method always +// closes the http.Response Body. +func (client ForestsummaryClient) GetForestSummaryResponder(resp *http.Response) (result ForestSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/metricmetadata.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/metricmetadata.go new file mode 100644 index 000000000000..2f54843563fc --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/metricmetadata.go @@ -0,0 +1,253 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "net/http" +) + +// MetricmetadataClient is the REST APIs for Azure Active Drectory Connect Health +type MetricmetadataClient struct { + BaseClient +} + +// NewMetricmetadataClient creates an instance of the MetricmetadataClient client. +func NewMetricmetadataClient() MetricmetadataClient { + return NewMetricmetadataClientWithBaseURI(DefaultBaseURI) +} + +// NewMetricmetadataClientWithBaseURI creates an instance of the MetricmetadataClient client. +func NewMetricmetadataClientWithBaseURI(baseURI string) MetricmetadataClient { + return MetricmetadataClient{NewWithBaseURI(baseURI)} +} + +// GetAddsServiceSingleMetricMetadata gets the service related metrics information. +// +// serviceName is the name of the service. metricName is the metric name +func (client MetricmetadataClient) GetAddsServiceSingleMetricMetadata(ctx context.Context, serviceName string, metricName string) (result MetricMetadata, err error) { + req, err := client.GetAddsServiceSingleMetricMetadataPreparer(ctx, serviceName, metricName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetAddsServiceSingleMetricMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetAddsServiceSingleMetricMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetAddsServiceSingleMetricMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetAddsServiceSingleMetricMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetAddsServiceSingleMetricMetadata", resp, "Failure responding to request") + } + + return +} + +// GetAddsServiceSingleMetricMetadataPreparer prepares the GetAddsServiceSingleMetricMetadata request. +func (client MetricmetadataClient) GetAddsServiceSingleMetricMetadataPreparer(ctx context.Context, serviceName string, metricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata/{metricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAddsServiceSingleMetricMetadataSender sends the GetAddsServiceSingleMetricMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client MetricmetadataClient) GetAddsServiceSingleMetricMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAddsServiceSingleMetricMetadataResponder handles the response to the GetAddsServiceSingleMetricMetadata request. The method always +// closes the http.Response Body. +func (client MetricmetadataClient) GetAddsServiceSingleMetricMetadataResponder(resp *http.Response) (result MetricMetadata, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricMetadata gets the service related metrics information. +// +// serviceName is the name of the service. filter is the metric metadata property filter to apply. perfCounter is +// indicates if only performance counter metrics are requested. +func (client MetricmetadataClient) GetMetricMetadata(ctx context.Context, serviceName string, filter string, perfCounter *bool) (result MetricMetadataList, err error) { + req, err := client.GetMetricMetadataPreparer(ctx, serviceName, filter, perfCounter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetMetricMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetMetricMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetMetricMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetMetricMetadata", resp, "Failure responding to request") + } + + return +} + +// GetMetricMetadataPreparer prepares the GetMetricMetadata request. +func (client MetricmetadataClient) GetMetricMetadataPreparer(ctx context.Context, serviceName string, filter string, perfCounter *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if perfCounter != nil { + queryParameters["perfCounter"] = autorest.Encode("query", *perfCounter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricMetadataSender sends the GetMetricMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client MetricmetadataClient) GetMetricMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricMetadataResponder handles the response to the GetMetricMetadata request. The method always +// closes the http.Response Body. +func (client MetricmetadataClient) GetMetricMetadataResponder(resp *http.Response) (result MetricMetadataList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricsForService gets the service related metrics for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name groupKey is +// the group key fromDate is the start date. toDate is the end date. +func (client MetricmetadataClient) GetMetricsForService(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { + req, err := client.GetMetricsForServicePreparer(ctx, serviceName, metricName, groupName, groupKey, fromDate, toDate) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetMetricsForService", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsForServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetMetricsForService", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsForServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricmetadataClient", "GetMetricsForService", resp, "Failure responding to request") + } + + return +} + +// GetMetricsForServicePreparer prepares the GetMetricsForService request. +func (client MetricmetadataClient) GetMetricsForServicePreparer(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(groupKey) > 0 { + queryParameters["groupKey"] = autorest.Encode("query", groupKey) + } + if fromDate != nil { + queryParameters["fromDate"] = autorest.Encode("query", *fromDate) + } + if toDate != nil { + queryParameters["toDate"] = autorest.Encode("query", *toDate) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata/{metricName}/groups/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsForServiceSender sends the GetMetricsForService request. The method will close the +// http.Response Body if it receives an error. +func (client MetricmetadataClient) GetMetricsForServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsForServiceResponder handles the response to the GetMetricsForService request. The method always +// closes the http.Response Body. +func (client MetricmetadataClient) GetMetricsForServiceResponder(resp *http.Response) (result MetricSets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/metrics.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/metrics.go new file mode 100644 index 000000000000..20f8593106c1 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/metrics.go @@ -0,0 +1,106 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// MetricsClient is the REST APIs for Azure Active Drectory Connect Health +type MetricsClient struct { + BaseClient +} + +// NewMetricsClient creates an instance of the MetricsClient client. +func NewMetricsClient() MetricsClient { + return NewMetricsClientWithBaseURI(DefaultBaseURI) +} + +// NewMetricsClientWithBaseURI creates an instance of the MetricsClient client. +func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { + return MetricsClient{NewWithBaseURI(baseURI)} +} + +// GetAddsServiceMetricsAverage gets the average of the metric values for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name +func (client MetricsClient) GetAddsServiceMetricsAverage(ctx context.Context, serviceName string, metricName string, groupName string) (result Items, err error) { + req, err := client.GetAddsServiceMetricsAveragePreparer(ctx, serviceName, metricName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricsClient", "GetAddsServiceMetricsAverage", nil, "Failure preparing request") + return + } + + resp, err := client.GetAddsServiceMetricsAverageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricsClient", "GetAddsServiceMetricsAverage", resp, "Failure sending request") + return + } + + result, err = client.GetAddsServiceMetricsAverageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.MetricsClient", "GetAddsServiceMetricsAverage", resp, "Failure responding to request") + } + + return +} + +// GetAddsServiceMetricsAveragePreparer prepares the GetAddsServiceMetricsAverage request. +func (client MetricsClient) GetAddsServiceMetricsAveragePreparer(ctx context.Context, serviceName string, metricName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}/average", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAddsServiceMetricsAverageSender sends the GetAddsServiceMetricsAverage request. The method will close the +// http.Response Body if it receives an error. +func (client MetricsClient) GetAddsServiceMetricsAverageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAddsServiceMetricsAverageResponder handles the response to the GetAddsServiceMetricsAverage request. The method always +// closes the http.Response Body. +func (client MetricsClient) GetAddsServiceMetricsAverageResponder(resp *http.Response) (result Items, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go new file mode 100644 index 000000000000..8505c9225583 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/models.go @@ -0,0 +1,1590 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/satori/go.uuid" +) + +// AlgorithmStepType enumerates the values for algorithm step type. +type AlgorithmStepType string + +const ( + // ConnectorFilter ... + ConnectorFilter AlgorithmStepType = "ConnectorFilter" + // Deprovisioning ... + Deprovisioning AlgorithmStepType = "Deprovisioning" + // ExportFlow ... + ExportFlow AlgorithmStepType = "ExportFlow" + // ImportFlow ... + ImportFlow AlgorithmStepType = "ImportFlow" + // Join ... + Join AlgorithmStepType = "Join" + // MvDeletion ... + MvDeletion AlgorithmStepType = "MvDeletion" + // MvObjectTypeChange ... + MvObjectTypeChange AlgorithmStepType = "MvObjectTypeChange" + // Projection ... + Projection AlgorithmStepType = "Projection" + // Provisioning ... + Provisioning AlgorithmStepType = "Provisioning" + // Recall ... + Recall AlgorithmStepType = "Recall" + // Staging ... + Staging AlgorithmStepType = "Staging" + // Undefined ... + Undefined AlgorithmStepType = "Undefined" + // ValidateConnectorFilter ... + ValidateConnectorFilter AlgorithmStepType = "ValidateConnectorFilter" +) + +// PossibleAlgorithmStepTypeValues returns an array of possible values for the AlgorithmStepType const type. +func PossibleAlgorithmStepTypeValues() []AlgorithmStepType { + return []AlgorithmStepType{ConnectorFilter, Deprovisioning, ExportFlow, ImportFlow, Join, MvDeletion, MvObjectTypeChange, Projection, Provisioning, Recall, Staging, Undefined, ValidateConnectorFilter} +} + +// AttributeDeltaOperationType enumerates the values for attribute delta operation type. +type AttributeDeltaOperationType string + +const ( + // AttributeDeltaOperationTypeAdd ... + AttributeDeltaOperationTypeAdd AttributeDeltaOperationType = "Add" + // AttributeDeltaOperationTypeDelete ... + AttributeDeltaOperationTypeDelete AttributeDeltaOperationType = "Delete" + // AttributeDeltaOperationTypeReplace ... + AttributeDeltaOperationTypeReplace AttributeDeltaOperationType = "Replace" + // AttributeDeltaOperationTypeUndefined ... + AttributeDeltaOperationTypeUndefined AttributeDeltaOperationType = "Undefined" + // AttributeDeltaOperationTypeUpdate ... + AttributeDeltaOperationTypeUpdate AttributeDeltaOperationType = "Update" +) + +// PossibleAttributeDeltaOperationTypeValues returns an array of possible values for the AttributeDeltaOperationType const type. +func PossibleAttributeDeltaOperationTypeValues() []AttributeDeltaOperationType { + return []AttributeDeltaOperationType{AttributeDeltaOperationTypeAdd, AttributeDeltaOperationTypeDelete, AttributeDeltaOperationTypeReplace, AttributeDeltaOperationTypeUndefined, AttributeDeltaOperationTypeUpdate} +} + +// AttributeMappingType enumerates the values for attribute mapping type. +type AttributeMappingType string + +const ( + // Constant ... + Constant AttributeMappingType = "Constant" + // Direct ... + Direct AttributeMappingType = "Direct" + // DnPart ... + DnPart AttributeMappingType = "DnPart" + // Script ... + Script AttributeMappingType = "Script" +) + +// PossibleAttributeMappingTypeValues returns an array of possible values for the AttributeMappingType const type. +func PossibleAttributeMappingTypeValues() []AttributeMappingType { + return []AttributeMappingType{Constant, Direct, DnPart, Script} +} + +// DeltaOperationType enumerates the values for delta operation type. +type DeltaOperationType string + +const ( + // DeltaOperationTypeAdd ... + DeltaOperationTypeAdd DeltaOperationType = "Add" + // DeltaOperationTypeDeletAdd ... + DeltaOperationTypeDeletAdd DeltaOperationType = "DeletAdd" + // DeltaOperationTypeDelete ... + DeltaOperationTypeDelete DeltaOperationType = "Delete" + // DeltaOperationTypeNone ... + DeltaOperationTypeNone DeltaOperationType = "None" + // DeltaOperationTypeObsolete ... + DeltaOperationTypeObsolete DeltaOperationType = "Obsolete" + // DeltaOperationTypeReplace ... + DeltaOperationTypeReplace DeltaOperationType = "Replace" + // DeltaOperationTypeUndefined ... + DeltaOperationTypeUndefined DeltaOperationType = "Undefined" + // DeltaOperationTypeUpdate ... + DeltaOperationTypeUpdate DeltaOperationType = "Update" +) + +// PossibleDeltaOperationTypeValues returns an array of possible values for the DeltaOperationType const type. +func PossibleDeltaOperationTypeValues() []DeltaOperationType { + return []DeltaOperationType{DeltaOperationTypeAdd, DeltaOperationTypeDeletAdd, DeltaOperationTypeDelete, DeltaOperationTypeNone, DeltaOperationTypeObsolete, DeltaOperationTypeReplace, DeltaOperationTypeUndefined, DeltaOperationTypeUpdate} +} + +// HealthStatus enumerates the values for health status. +type HealthStatus string + +const ( + // Error ... + Error HealthStatus = "Error" + // Healthy ... + Healthy HealthStatus = "Healthy" + // Missing ... + Missing HealthStatus = "Missing" + // NotMonitored ... + NotMonitored HealthStatus = "NotMonitored" + // Warning ... + Warning HealthStatus = "Warning" +) + +// PossibleHealthStatusValues returns an array of possible values for the HealthStatus const type. +func PossibleHealthStatusValues() []HealthStatus { + return []HealthStatus{Error, Healthy, Missing, NotMonitored, Warning} +} + +// Level enumerates the values for level. +type Level string + +const ( + // LevelError ... + LevelError Level = "Error" + // LevelPreWarning ... + LevelPreWarning Level = "PreWarning" + // LevelWarning ... + LevelWarning Level = "Warning" +) + +// PossibleLevelValues returns an array of possible values for the Level const type. +func PossibleLevelValues() []Level { + return []Level{LevelError, LevelPreWarning, LevelWarning} +} + +// MonitoringLevel enumerates the values for monitoring level. +type MonitoringLevel string + +const ( + // Full ... + Full MonitoringLevel = "Full" + // Off ... + Off MonitoringLevel = "Off" + // Partial ... + Partial MonitoringLevel = "Partial" +) + +// PossibleMonitoringLevelValues returns an array of possible values for the MonitoringLevel const type. +func PossibleMonitoringLevelValues() []MonitoringLevel { + return []MonitoringLevel{Full, Off, Partial} +} + +// PasswordOperationTypes enumerates the values for password operation types. +type PasswordOperationTypes string + +const ( + // PasswordOperationTypesChange ... + PasswordOperationTypesChange PasswordOperationTypes = "Change" + // PasswordOperationTypesSet ... + PasswordOperationTypesSet PasswordOperationTypes = "Set" + // PasswordOperationTypesUndefined ... + PasswordOperationTypesUndefined PasswordOperationTypes = "Undefined" +) + +// PossiblePasswordOperationTypesValues returns an array of possible values for the PasswordOperationTypes const type. +func PossiblePasswordOperationTypesValues() []PasswordOperationTypes { + return []PasswordOperationTypes{PasswordOperationTypesChange, PasswordOperationTypesSet, PasswordOperationTypesUndefined} +} + +// RunStepOperationType enumerates the values for run step operation type. +type RunStepOperationType string + +const ( + // RunStepOperationTypeApplyRules ... + RunStepOperationTypeApplyRules RunStepOperationType = "ApplyRules" + // RunStepOperationTypeDeltaImport ... + RunStepOperationTypeDeltaImport RunStepOperationType = "DeltaImport" + // RunStepOperationTypeDeltaSynchronization ... + RunStepOperationTypeDeltaSynchronization RunStepOperationType = "DeltaSynchronization" + // RunStepOperationTypeExport ... + RunStepOperationTypeExport RunStepOperationType = "Export" + // RunStepOperationTypeFullExport ... + RunStepOperationTypeFullExport RunStepOperationType = "FullExport" + // RunStepOperationTypeFullImport ... + RunStepOperationTypeFullImport RunStepOperationType = "FullImport" + // RunStepOperationTypeFullImportReevaluateRules ... + RunStepOperationTypeFullImportReevaluateRules RunStepOperationType = "FullImportReevaluateRules" + // RunStepOperationTypeFullSynchornization ... + RunStepOperationTypeFullSynchornization RunStepOperationType = "FullSynchornization" + // RunStepOperationTypeUndefined ... + RunStepOperationTypeUndefined RunStepOperationType = "Undefined" +) + +// PossibleRunStepOperationTypeValues returns an array of possible values for the RunStepOperationType const type. +func PossibleRunStepOperationTypeValues() []RunStepOperationType { + return []RunStepOperationType{RunStepOperationTypeApplyRules, RunStepOperationTypeDeltaImport, RunStepOperationTypeDeltaSynchronization, RunStepOperationTypeExport, RunStepOperationTypeFullExport, RunStepOperationTypeFullImport, RunStepOperationTypeFullImportReevaluateRules, RunStepOperationTypeFullSynchornization, RunStepOperationTypeUndefined} +} + +// ServerDisabledReason enumerates the values for server disabled reason. +type ServerDisabledReason string + +const ( + // DeletedFromPortal ... + DeletedFromPortal ServerDisabledReason = "DeletedFromPortal" + // DisabledDueToInactivity ... + DisabledDueToInactivity ServerDisabledReason = "DisabledDueToInactivity" + // GdprStopCollection ... + GdprStopCollection ServerDisabledReason = "GdprStopCollection" + // None ... + None ServerDisabledReason = "None" +) + +// PossibleServerDisabledReasonValues returns an array of possible values for the ServerDisabledReason const type. +func PossibleServerDisabledReasonValues() []ServerDisabledReason { + return []ServerDisabledReason{DeletedFromPortal, DisabledDueToInactivity, GdprStopCollection, None} +} + +// ServiceType enumerates the values for service type. +type ServiceType string + +const ( + // ServiceTypeAadConnectSync ... + ServiceTypeAadConnectSync ServiceType = "AadConnectSync" + // ServiceTypeDirSync ... + ServiceTypeDirSync ServiceType = "DirSync" + // ServiceTypeUndefined ... + ServiceTypeUndefined ServiceType = "Undefined" +) + +// PossibleServiceTypeValues returns an array of possible values for the ServiceType const type. +func PossibleServiceTypeValues() []ServiceType { + return []ServiceType{ServiceTypeAadConnectSync, ServiceTypeDirSync, ServiceTypeUndefined} +} + +// State enumerates the values for state. +type State string + +const ( + // Active ... + Active State = "Active" + // ResolvedByPositiveResult ... + ResolvedByPositiveResult State = "ResolvedByPositiveResult" + // ResolvedByStateChange ... + ResolvedByStateChange State = "ResolvedByStateChange" + // ResolvedByTimer ... + ResolvedByTimer State = "ResolvedByTimer" + // ResolvedManually ... + ResolvedManually State = "ResolvedManually" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Active, ResolvedByPositiveResult, ResolvedByStateChange, ResolvedByTimer, ResolvedManually} +} + +// ValueDeltaOperationType enumerates the values for value delta operation type. +type ValueDeltaOperationType string + +const ( + // ValueDeltaOperationTypeAdd ... + ValueDeltaOperationTypeAdd ValueDeltaOperationType = "Add" + // ValueDeltaOperationTypeDelete ... + ValueDeltaOperationTypeDelete ValueDeltaOperationType = "Delete" + // ValueDeltaOperationTypeUndefined ... + ValueDeltaOperationTypeUndefined ValueDeltaOperationType = "Undefined" + // ValueDeltaOperationTypeUpdate ... + ValueDeltaOperationTypeUpdate ValueDeltaOperationType = "Update" +) + +// PossibleValueDeltaOperationTypeValues returns an array of possible values for the ValueDeltaOperationType const type. +func PossibleValueDeltaOperationTypeValues() []ValueDeltaOperationType { + return []ValueDeltaOperationType{ValueDeltaOperationTypeAdd, ValueDeltaOperationTypeDelete, ValueDeltaOperationTypeUndefined, ValueDeltaOperationTypeUpdate} +} + +// ValueType enumerates the values for value type. +type ValueType string + +const ( + // ValueTypeBinary ... + ValueTypeBinary ValueType = "Binary" + // ValueTypeBoolean ... + ValueTypeBoolean ValueType = "Boolean" + // ValueTypeDn ... + ValueTypeDn ValueType = "Dn" + // ValueTypeInteger ... + ValueTypeInteger ValueType = "Integer" + // ValueTypeString ... + ValueTypeString ValueType = "String" + // ValueTypeUndefined ... + ValueTypeUndefined ValueType = "Undefined" +) + +// PossibleValueTypeValues returns an array of possible values for the ValueType const type. +func PossibleValueTypeValues() []ValueType { + return []ValueType{ValueTypeBinary, ValueTypeBoolean, ValueTypeDn, ValueTypeInteger, ValueTypeString, ValueTypeUndefined} +} + +// AdditionalInformation the addtional information for a property. +type AdditionalInformation struct { + // TitleName - The title name for the property. + TitleName *string `json:"titleName,omitempty"` + // TitleValue - The title value for the property. + TitleValue *string `json:"titleValue,omitempty"` + // Properties - The list of properties which are included in the aditional information. + Properties interface{} `json:"properties,omitempty"` +} + +// AddsServiceMember the server details for ADDS service. +type AddsServiceMember struct { + // DomainName - The domain name. + DomainName *string `json:"domainName,omitempty"` + // SiteName - The site name. + SiteName *string `json:"siteName,omitempty"` + // AddsRoles - The list of ADDS roles. + AddsRoles *[]string `json:"addsRoles,omitempty"` + // GcReachable - Indicates if the global catalog for this domain is reachable or not. + GcReachable *bool `json:"gcReachable,omitempty"` + // PdcReachable - Indicates if the primary domain controller is reachable or not. + PdcReachable *bool `json:"pdcReachable,omitempty"` + // SysvolState - Indicates if the SYSVOL state is healthy or not. + SysvolState *bool `json:"sysvolState,omitempty"` + // DcTypes - The list of domain controller types. + DcTypes *[]string `json:"dcTypes,omitempty"` +} + +// AddsServiceMembers the list of ADDS service members. +type AddsServiceMembers struct { + autorest.Response `json:"-"` + Value *[]AddsServiceMember `json:"value,omitempty"` +} + +// Agent the agent details. +type Agent struct { + // TenantID - The tenant Id. + TenantID *string `json:"tenantId,omitempty"` + // MachineID - The machine Id. + MachineID *string `json:"machineId,omitempty"` + // Credential - The agent credential details. + Credential interface{} `json:"credential,omitempty"` + // MachineName - The machine name. + MachineName *string `json:"machineName,omitempty"` + // AgentVersion - The agent version. + AgentVersion *string `json:"agentVersion,omitempty"` + // CreatedDate - The date and time, in UTC, when the agent was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // Key - The connector hash key. + Key *string `json:"key,omitempty"` +} + +// Alert the alert details indicating an issue with service or server. +type Alert struct { + // AlertID - The alert Id. + AlertID *uuid.UUID `json:"alertId,omitempty"` + // Level - The alert level which indicates the severity of the alert. Possible values include: 'LevelWarning', 'LevelError', 'LevelPreWarning' + Level Level `json:"level,omitempty"` + // State - The alert state which can be either active or resolved with multile resolution types. Possible values include: 'Active', 'ResolvedByPositiveResult', 'ResolvedManually', 'ResolvedByTimer', 'ResolvedByStateChange' + State State `json:"state,omitempty"` + // ShortName - The alert short name. + ShortName *string `json:"shortName,omitempty"` + // DisplayName - The display name for the alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - The alert description. + Description *string `json:"description,omitempty"` + // Remediation - The alert remediation. + Remediation *string `json:"remediation,omitempty"` + // RelatedLinks - The help links to get more information related to the alert. + RelatedLinks *[]HelpLink `json:"relatedLinks,omitempty"` + // Scope - The scope of the alert. Indicates if it is a service or a server related alert. + Scope *string `json:"scope,omitempty"` + // AdditionalInformation - Additional information related to the alert. + AdditionalInformation *[]AdditionalInformation `json:"additionalInformation,omitempty"` + // CreatedDate - The date and time,in UTC,when the alert was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // ResolvedDate - The date and time, in UTC, when the alert was resolved. + ResolvedDate *date.Time `json:"resolvedDate,omitempty"` + // LastUpdated - The date and time, in UTC, when the alert was last updated. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // MonitoringRoleType - The monitoring role type for which the alert was raised. + MonitoringRoleType *string `json:"monitoringRoleType,omitempty"` + // ActiveAlertProperties - The active alert properties. + ActiveAlertProperties interface{} `json:"activeAlertProperties,omitempty"` + // ResolvedAlertProperties - The active alert properties. + ResolvedAlertProperties interface{} `json:"resolvedAlertProperties,omitempty"` + // TenantID - The tenant Id. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // ServiceID - The service Id. + ServiceID *uuid.UUID `json:"serviceId,omitempty"` + // ServiceMemberID - The server Id. + ServiceMemberID *uuid.UUID `json:"serviceMemberId,omitempty"` +} + +// AlertFeedback the alert feedback details. +type AlertFeedback struct { + autorest.Response `json:"-"` + // Level - The alert level which indicates the severity of the alert. + Level *string `json:"level,omitempty"` + // State - The alert state which can be either active or resolved with multile resolution types. + State *string `json:"state,omitempty"` + // ShortName - The alert short name. + ShortName *string `json:"shortName,omitempty"` + // Feedback - The feedback for the alert which indicates if the customer likes or dislikes the alert. + Feedback *string `json:"feedback,omitempty"` + // Comment - Additional comments related to the alert. + Comment *string `json:"comment,omitempty"` + // ConsentedToShare - Indicates if the alert feedback can be shared from product team. + ConsentedToShare *bool `json:"consentedToShare,omitempty"` + // ServiceMemberID - The server Id of the alert. + ServiceMemberID *string `json:"serviceMemberId,omitempty"` + // CreatedDate - The date and time,in UTC,when the alert was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` +} + +// AlertFeedbacks the list of alert feedback. +type AlertFeedbacks struct { + autorest.Response `json:"-"` + Value *[]AlertFeedback `json:"value,omitempty"` +} + +// Alerts the list of alerts for a service. +type Alerts struct { + autorest.Response `json:"-"` + Value *[]Alert `json:"value,omitempty"` +} + +// AssociatedObject object that hold sync object details. +type AssociatedObject struct { + // DisplayName - The display name of the object. + DisplayName *string `json:"displayName,omitempty"` + // DistinguishedName - The distinguished name of the object. + DistinguishedName *string `json:"distinguishedName,omitempty"` + // LastDirSyncTime - The last dirSync time. + LastDirSyncTime *date.Time `json:"lastDirSyncTime,omitempty"` + // Mail - The email of the object. + Mail *string `json:"mail,omitempty"` + // ObjectGUID - The object guid. + ObjectGUID *string `json:"objectGuid,omitempty"` + // ObjectType - The object type. + ObjectType *string `json:"objectType,omitempty"` + // OnpremisesUserPrincipalName - The On-premises UPN. + OnpremisesUserPrincipalName *string `json:"onpremisesUserPrincipalName,omitempty"` + // ProxyAddresses - The proxy addresses. + ProxyAddresses *string `json:"proxyAddresses,omitempty"` + // SourceAnchor - The source anchor. + SourceAnchor *string `json:"sourceAnchor,omitempty"` + // SourceOfAuthority - The source of authority. + SourceOfAuthority *string `json:"sourceOfAuthority,omitempty"` + // TimeOccured - The time of the error. + TimeOccured *date.Time `json:"timeOccured,omitempty"` + // UserPrincipalName - The UPN. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` +} + +// AttributeDelta the delta attributes. +type AttributeDelta struct { + // Values - The delta values. + Values *[]ValueDelta `json:"values,omitempty"` + // Name - The name of the attribute delta. + Name *string `json:"name,omitempty"` + // OperationType - The attribute delta operation type. Possible values include: 'AttributeDeltaOperationTypeUndefined', 'AttributeDeltaOperationTypeAdd', 'AttributeDeltaOperationTypeReplace', 'AttributeDeltaOperationTypeUpdate', 'AttributeDeltaOperationTypeDelete' + OperationType AttributeDeltaOperationType `json:"operationType,omitempty"` + // ValueType - The value type. Possible values include: 'ValueTypeUndefined', 'ValueTypeDn', 'ValueTypeBinary', 'ValueTypeString', 'ValueTypeInteger', 'ValueTypeBoolean' + ValueType ValueType `json:"valueType,omitempty"` + // MultiValued - Indicates if the attribute delta is multivalued or not. + MultiValued *bool `json:"multiValued,omitempty"` +} + +// AttributeMapping the attribute mapping details. +type AttributeMapping struct { + // MappingSource - The mapping source. + MappingSource *AttributeMppingSource `json:"mappingSource,omitempty"` + // Type - The attribute mapping type. Possible values include: 'Constant', 'Direct', 'DnPart', 'Script' + Type AttributeMappingType `json:"type,omitempty"` + // DestinationAttribute - The destination attribute. + DestinationAttribute *string `json:"destinationAttribute,omitempty"` + // ContextID - The context Id. + ContextID *string `json:"contextId,omitempty"` +} + +// AttributeMppingSource the attribute mapping source. +type AttributeMppingSource struct { + // SourceAttribute - The source attribute. + SourceAttribute *[]string `json:"sourceAttribute,omitempty"` + // DnPart - The value for dn part. + DnPart *int32 `json:"dnPart,omitempty"` + // ScriptContext - The script context. + ScriptContext *string `json:"scriptContext,omitempty"` + // ConstantValue - The constant value. + ConstantValue *string `json:"constantValue,omitempty"` +} + +// Bool ... +type Bool struct { + autorest.Response `json:"-"` + Value *bool `json:"value,omitempty"` +} + +// ChangeNotReimported the changes which are not re-imported. +type ChangeNotReimported struct { + // Delta - The delta changes that is not re-imported. + Delta *ChangeNotReimportedDelta `json:"delta,omitempty"` + // Entry - The object entry in a change that is not re-imported. + Entry *ChangeNotReimportedEntry `json:"entry,omitempty"` +} + +// ChangeNotReimportedDelta the delta in a change that is not re-imported. +type ChangeNotReimportedDelta struct { + // Anchor - The anchor. + Anchor *string `json:"anchor,omitempty"` + // DnAttributes - The delta attributes for distinguished names. + DnAttributes *[]AttributeDelta `json:"dnAttributes,omitempty"` + // Attributes - The attributes. + Attributes *[]AttributeDelta `json:"attributes,omitempty"` + // OperationType - The operation type. Possible values include: 'DeltaOperationTypeUndefined', 'DeltaOperationTypeNone', 'DeltaOperationTypeAdd', 'DeltaOperationTypeReplace', 'DeltaOperationTypeUpdate', 'DeltaOperationTypeDelete', 'DeltaOperationTypeObsolete', 'DeltaOperationTypeDeletAdd' + OperationType DeltaOperationType `json:"operationType,omitempty"` +} + +// ChangeNotReimportedEntry the object entry in a change that is not re-imported. +type ChangeNotReimportedEntry struct { + // Anchor - The anchor. + Anchor *string `json:"anchor,omitempty"` + // ParentAnchor - The parent anchor. + ParentAnchor *string `json:"parentAnchor,omitempty"` + // PrimaryObjectClass - The primary object class. + PrimaryObjectClass *string `json:"primaryObjectClass,omitempty"` + // ObjectClasses - The olist of object classes. + ObjectClasses *[]string `json:"objectClasses,omitempty"` + // DnAttributes - The delta attributes for distinguished names. + DnAttributes *[]AttributeDelta `json:"dnAttributes,omitempty"` + // Attributes - The attributes. + Attributes *[]AttributeDelta `json:"attributes,omitempty"` + // Dn - The distinguished name. + Dn *string `json:"dn,omitempty"` +} + +// Connector the connect details. +type Connector struct { + // ID - The connector Id. + ID *string `json:"id,omitempty"` + // Name - The connector name. + Name *string `json:"name,omitempty"` + // Version - The connector version + Version *int32 `json:"version,omitempty"` + // Type - The connector type. + Type *string `json:"type,omitempty"` + // Description - The connector description. + Description *string `json:"description,omitempty"` + // SchemaXML - The schema xml for the connector. + SchemaXML *string `json:"schemaXml,omitempty"` + // PasswordManagementSettings - The password management settings of the connector. + PasswordManagementSettings interface{} `json:"passwordManagementSettings,omitempty"` + // PasswordHashSyncConfiguration - The password hash synchronization configuration of the connector. + PasswordHashSyncConfiguration interface{} `json:"passwordHashSyncConfiguration,omitempty"` + // TimeCreated - The date and time when this connector was created. + TimeCreated *date.Time `json:"timeCreated,omitempty"` + // TimeLastModified - The date and time when this connector was last modified. + TimeLastModified *date.Time `json:"timeLastModified,omitempty"` + // Partitions - The partitions of the connector. + Partitions *[]Partition `json:"partitions,omitempty"` + // RunProfiles - The run profiles of the connector. + RunProfiles *[]RunProfiles `json:"runProfiles,omitempty"` + // ClassesIncluded - The class inclusion list of the connector. + ClassesIncluded *[]string `json:"classesIncluded,omitempty"` + // AttributesIncluded - The attribute inclusion list of the connector. + AttributesIncluded *[]string `json:"attributesIncluded,omitempty"` +} + +// ConnectorConnectionError the connector connection error. +type ConnectorConnectionError struct { + // ID - The error Id. + ID *string `json:"id,omitempty"` + // RunStepResultID - The run step result Id. + RunStepResultID *string `json:"runStepResultId,omitempty"` + // ConnectorID - The connector Id. + ConnectorID *string `json:"connectorId,omitempty"` + // Type - The type of error. + Type *string `json:"type,omitempty"` + // ErrorCode - The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // Message - The message for the connection error. + Message *string `json:"message,omitempty"` + // TimeOccured - The time when the connection error occured. + TimeOccured *date.Time `json:"timeOccured,omitempty"` + // Server - The server where the connection error happened. + Server *string `json:"server,omitempty"` +} + +// ConnectorConnectionErrors the list of connector connection errors. +type ConnectorConnectionErrors struct { + Value *[]ConnectorConnectionError `json:"value,omitempty"` +} + +// ConnectorObjectError the connector object error. +type ConnectorObjectError struct { + // ID - The error Id. + ID *string `json:"id,omitempty"` + // RunStepResultID - The run step result Id. + RunStepResultID *string `json:"runStepResultId,omitempty"` + // ConnectorID - The connector Id. + ConnectorID *string `json:"connectorId,omitempty"` + // Type - The type of error. + Type *string `json:"type,omitempty"` + // ErrorCode - The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // Message - The message for the object error. + Message *string `json:"message,omitempty"` + // EntryNumber - The entry number for object error occured. + EntryNumber *int32 `json:"entryNumber,omitempty"` + // LineNumber - The line number for the object error. + LineNumber *int32 `json:"lineNumber,omitempty"` + // ColumnNumber - The column number for the object error. + ColumnNumber *int32 `json:"columnNumber,omitempty"` + // Dn - The distingished name of the object. + Dn *string `json:"dn,omitempty"` + // Anchor - The name for the anchor of the object. + Anchor *string `json:"anchor,omitempty"` + // AttributeName - The attribute name of the object. + AttributeName *string `json:"attributeName,omitempty"` + // ServerErrorDetail - The server side error details. + ServerErrorDetail *string `json:"serverErrorDetail,omitempty"` + // Values - The value corresponding to attribute name. + Values *[]string `json:"values,omitempty"` +} + +// ConnectorObjectErrors the list of connector object errors. +type ConnectorObjectErrors struct { + Value *[]ConnectorObjectError `json:"value,omitempty"` +} + +// Connectors the list of connects for a service. +type Connectors struct { + autorest.Response `json:"-"` + Value *[]Connector `json:"value,omitempty"` +} + +// Credential the credential for a given server. +type Credential struct { + autorest.Response `json:"-"` + // Identifier - The credential identifier. + Identifier *string `json:"identifier,omitempty"` + // Type - The type of credential. + Type *string `json:"type,omitempty"` + // CredentialData - The credential data. + CredentialData *[]string `json:"credentialData,omitempty"` +} + +// DataFreshnessDetail the data freshness details for the server. +type DataFreshnessDetail struct { + autorest.Response `json:"-"` + // ServiceID - The service Id to whom the server is onboarded to. + ServiceID *string `json:"serviceId,omitempty"` + // LastDataUploadTime - The date time , in UTC, when data was last uploaded by the server. + LastDataUploadTime *date.Time `json:"lastDataUploadTime,omitempty"` +} + +// Display displays the details related to operations supported by Azure Active Directory Connect Health. +type Display struct { + // Description - The description for the operation. + Description *string `json:"description,omitempty"` + // Operation - The details of the operation. + Operation *string `json:"operation,omitempty"` + // Provider - The provider name. + Provider *string `json:"provider,omitempty"` +} + +// ErrorCount the error count details. +type ErrorCount struct { + // ErrorBucket - The error bucket. + ErrorBucket *string `json:"errorBucket,omitempty"` + // Count - The error count. + Count *int32 `json:"count,omitempty"` + // Trucated - Indicates if the error count is truncated or not. + Trucated *bool `json:"trucated,omitempty"` +} + +// ErrorCounts the list of error counts. +type ErrorCounts struct { + autorest.Response `json:"-"` + Value *[]ErrorCount `json:"value,omitempty"` +} + +// ErrorDetail the error details. +type ErrorDetail struct { + // Description - The error description. + Description *string `json:"description,omitempty"` + // KbURL - The knowledge base article url which contains more information about the error. + KbURL *string `json:"kbUrl,omitempty"` + // Detail - Additional details related to the error. + Detail *string `json:"detail,omitempty"` + // ObjectsWithSyncError - The list of objects with sync errors. + ObjectsWithSyncError *ObjectWithSyncError `json:"objectsWithSyncError,omitempty"` + // ObjectWithSyncError - The object with sync error. + ObjectWithSyncError *MergedExportError `json:"objectWithSyncError,omitempty"` +} + +// ErrorReportUsersEntries the list of bad password log in attempt entries. +type ErrorReportUsersEntries struct { + autorest.Response `json:"-"` + Value *[]ErrorReportUsersEntry `json:"value,omitempty"` +} + +// ErrorReportUsersEntry the bad password login attempt details. +type ErrorReportUsersEntry struct { + // UserID - The user ID value. + UserID *string `json:"userId,omitempty"` + // IPAddress - The Ip address corresponding to the last error event. + IPAddress *string `json:"ipAddress,omitempty"` + // LastUpdated - The date and time when the last error event was logged. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // UniqueIDAddresses - The list of unique IP addresses. + UniqueIDAddresses *string `json:"uniqueIdAddresses,omitempty"` + // TotalErrorAttempts - The total count of specific error events. + TotalErrorAttempts *int32 `json:"totalErrorAttempts,omitempty"` +} + +// ExportError the export error details. +type ExportError struct { + // ID - The error Id. + ID *string `json:"id,omitempty"` + // RunStepResultID - The run step result Id. + RunStepResultID *string `json:"runStepResultId,omitempty"` + // ConnectorID - The connector Id. + ConnectorID *string `json:"connectorId,omitempty"` + // Type - The type of error. + Type *string `json:"type,omitempty"` + // ErrorCode - The error code. + ErrorCode *string `json:"errorCode,omitempty"` + // Message - The export error message. + Message *string `json:"message,omitempty"` + // ServverErrorDetail - The server error detail. + ServverErrorDetail *string `json:"servverErrorDetail,omitempty"` + // TimeFirstOccured - The date and time when the export error first occured. + TimeFirstOccured *date.Time `json:"timeFirstOccured,omitempty"` + // RetryCount - The retry count. + RetryCount *int32 `json:"retryCount,omitempty"` + // CsObjectID - The cloud object Id. + CsObjectID *string `json:"csObjectId,omitempty"` + // Dn - The distinguished name. + Dn *string `json:"dn,omitempty"` + // MinLimit - The minimum limit. + MinLimit *string `json:"minLimit,omitempty"` + // MaxLimit - The maximum limit. + MaxLimit *string `json:"maxLimit,omitempty"` + // CloudAnchor - The name of the cloud anchor. + CloudAnchor *string `json:"cloudAnchor,omitempty"` + // AttributeName - The attribute name. + AttributeName *string `json:"attributeName,omitempty"` + // AttributeValue - The attribute value. + AttributeValue *string `json:"attributeValue,omitempty"` + // AttributeMultiValue - Indicates if the attribute is multi valued or not. + AttributeMultiValue *bool `json:"attributeMultiValue,omitempty"` + // ObjectIDConflict - The object Id with which there was an attribute conflict. + ObjectIDConflict *string `json:"objectIdConflict,omitempty"` + // SamAccountName - The SAM account name. + SamAccountName *string `json:"samAccountName,omitempty"` + // AdObjectType - The AD object type + AdObjectType *string `json:"adObjectType,omitempty"` + // AdObjectGUID - The AD object guid. + AdObjectGUID *string `json:"adObjectGuid,omitempty"` + // AdDisplayName - The display name for the AD object. + AdDisplayName *string `json:"adDisplayName,omitempty"` + // AdSourceOfAuthority - The source of authority for the AD object. + AdSourceOfAuthority *string `json:"adSourceOfAuthority,omitempty"` + // AdSourceAnchor - The AD source anchor. + AdSourceAnchor *string `json:"adSourceAnchor,omitempty"` + // AdUserPrincipalName - The user principal name for the AD object. + AdUserPrincipalName *string `json:"adUserPrincipalName,omitempty"` + // AdDistinguishedName - The distinguished name for the AD object. + AdDistinguishedName *string `json:"adDistinguishedName,omitempty"` + // AdMail - The email for the AD object. + AdMail *string `json:"adMail,omitempty"` + // TimeOccured - The date and time of occurance. + TimeOccured *date.Time `json:"timeOccured,omitempty"` + // AadObjectType - The AAD side object type. + AadObjectType *string `json:"aadObjectType,omitempty"` + // AadObjectGUID - The AAD side object guid. + AadObjectGUID *string `json:"aadObjectGuid,omitempty"` + // AadDisplayName - The AAD side display name + AadDisplayName *string `json:"aadDisplayName,omitempty"` + // AadSourceOfAuthority - The AAD side source of authority for the object. + AadSourceOfAuthority *string `json:"aadSourceOfAuthority,omitempty"` + // AadUserPrincipalName - The AAD side user principal name. + AadUserPrincipalName *string `json:"aadUserPrincipalName,omitempty"` + // AadDistringuishedName - The AAD side distinguished name for the object. + AadDistringuishedName *string `json:"aadDistringuishedName,omitempty"` + // AadMail - The AAD side email for the object. + AadMail *string `json:"aadMail,omitempty"` + // LastDirSyncTime - The date and time of last sync run. + LastDirSyncTime *date.Time `json:"lastDirSyncTime,omitempty"` + // ModifiedAttributeValue - The modified atttribute value. + ModifiedAttributeValue *string `json:"modifiedAttributeValue,omitempty"` +} + +// ExportErrors the list of export errors. +type ExportErrors struct { + Value *[]ExportError `json:"value,omitempty"` +} + +// ExportStatus the details of the export status. +type ExportStatus struct { + // ServiceID - The id of the service for whom the export status is being reported. + ServiceID *uuid.UUID `json:"serviceId,omitempty"` + // ServiceMemberID - The server Id for whom the export status is being reported. + ServiceMemberID *uuid.UUID `json:"serviceMemberId,omitempty"` + // EndTime - The date and time when the export ended. + EndTime *date.Time `json:"endTime,omitempty"` + // RunStepResultID - The run step result Id. + RunStepResultID *string `json:"runStepResultId,omitempty"` +} + +// ExportStatuses the list of export statuses. +type ExportStatuses struct { + autorest.Response `json:"-"` + Value *[]ExportStatus `json:"value,omitempty"` +} + +// ExtensionErrorInfo the extension error details. +type ExtensionErrorInfo struct { + // ExtensionName - The extension name. + ExtensionName *string `json:"extensionName,omitempty"` + // ExtensionContext - The extension context. + ExtensionContext *string `json:"extensionContext,omitempty"` + // CallStack - The call stack for the error. + CallStack *string `json:"callStack,omitempty"` +} + +// ForestSummary the forest summary for an ADDS domain. +type ForestSummary struct { + autorest.Response `json:"-"` + // ForestName - The forest name. + ForestName *string `json:"forestName,omitempty"` + // DomainCount - The domain count. + DomainCount *int32 `json:"domainCount,omitempty"` + // SiteCount - The site count. + SiteCount *int32 `json:"siteCount,omitempty"` + // MoniteredDcCount - The number of domain controllers that are monitored by Azure Active Directory Connect Health. + MoniteredDcCount *int32 `json:"moniteredDcCount,omitempty"` + // TotalDcCount - The total domain controllers. + TotalDcCount *int32 `json:"totalDcCount,omitempty"` + // Domains - The list of domain controller names. + Domains *[]string `json:"domains,omitempty"` + // Sites - The list of site names. + Sites *[]string `json:"sites,omitempty"` +} + +// GlobalConfiguration the global configuration settings. +type GlobalConfiguration struct { + autorest.Response `json:"-"` + // Version - The version for the global configuration. + Version *int32 `json:"version,omitempty"` + // SchemaXML - The schema for the configuration. + SchemaXML *string `json:"schemaXml,omitempty"` + // PasswordSyncEnabled - Indicates if password sync is enabled or not. + PasswordSyncEnabled *bool `json:"passwordSyncEnabled,omitempty"` + // NumSavedPwdEvents - The number of saved password events. + NumSavedPwdEvents *int32 `json:"numSavedPwdEvents,omitempty"` + // FeatureSet - The list of additional feature sets. + FeatureSet interface{} `json:"featureSet,omitempty"` +} + +// HelpLink the help link which contains more information related to an alert. +type HelpLink struct { + // Title - The title for the link. + Title *string `json:"title,omitempty"` + // URL - The url for the help document. + URL *string `json:"url,omitempty"` +} + +// Hotfix the details of the hotfix installed in the server. +type Hotfix struct { + // KbName - The name of the hotfix KB. + KbName *string `json:"kbName,omitempty"` + // Link - The link to the KB Article. + Link *string `json:"link,omitempty"` + // InstalledDate - The date and time, in UTC, when the KB was installed in the server. + InstalledDate *date.Time `json:"installedDate,omitempty"` +} + +// Hotfixes the list of hotfixes installed in the server. +type Hotfixes struct { + Value *[]Hotfix `json:"value,omitempty"` +} + +// ImportError the import error details. +type ImportError struct { + // ID - The error Id. + ID *string `json:"id,omitempty"` + // RunStepResultID - The run step result Id. + RunStepResultID *string `json:"runStepResultId,omitempty"` + // ConnectorID - The connector Id. + ConnectorID *string `json:"connectorId,omitempty"` + // Type - The type of error. + Type *string `json:"type,omitempty"` + // TimeOccurred - The time when the import error occurred. + TimeOccurred *date.Time `json:"timeOccurred,omitempty"` + // TimeFirstOccurred - The time when the import error first occurred. + TimeFirstOccurred *date.Time `json:"timeFirstOccurred,omitempty"` + // RetryCount - The retry count. + RetryCount *int32 `json:"retryCount,omitempty"` + // AlgorithmStepType - The operation type specific to error reporting. Possible values include: 'Undefined', 'Staging', 'ConnectorFilter', 'Join', 'Projection', 'ImportFlow', 'Provisioning', 'ValidateConnectorFilter', 'Deprovisioning', 'ExportFlow', 'MvDeletion', 'Recall', 'MvObjectTypeChange' + AlgorithmStepType AlgorithmStepType `json:"algorithmStepType,omitempty"` + // ChangeNotReimported - The change details that is not re-imported. + ChangeNotReimported *ChangeNotReimported `json:"changeNotReimported,omitempty"` + // ExtensionErrorInfo - The extension error information. + ExtensionErrorInfo *ExtensionErrorInfo `json:"extensionErrorInfo,omitempty"` + // RuleErrorInfo - The error details in legacy rule processing. + RuleErrorInfo *RuleErrorInfo `json:"ruleErrorInfo,omitempty"` + // CsObjectID - The object Id. + CsObjectID *string `json:"csObjectId,omitempty"` + // Dn - The distinguished name. + Dn *string `json:"dn,omitempty"` +} + +// ImportErrors the list of import errors. +type ImportErrors struct { + Value *[]ImportError `json:"value,omitempty"` +} + +// InboundReplicationNeighbor the replication summary for the domain controller inbound neighbor. +type InboundReplicationNeighbor struct { + // SourceDomainController - The name of the source domain controller. + SourceDomainController *string `json:"sourceDomainController,omitempty"` + // ConsecutiveFailureCount - The number of consecutive faulire counts. + ConsecutiveFailureCount *string `json:"consecutiveFailureCount,omitempty"` + // NamingContext - The naming context. + NamingContext *string `json:"namingContext,omitempty"` + // Status - The health status for the domain controller. Possible values include: 'Healthy', 'Warning', 'Error', 'NotMonitored', 'Missing' + Status HealthStatus `json:"status,omitempty"` + // LastAttemptedSync - The last time a sync was attempted on the domain controller. + LastAttemptedSync *date.Time `json:"lastAttemptedSync,omitempty"` + // LastSuccessfulSync - The last time when a successful sync happened. + LastSuccessfulSync *date.Time `json:"lastSuccessfulSync,omitempty"` + // LastErrorCode - The last error code. + LastErrorCode *int32 `json:"lastErrorCode,omitempty"` + // LastErrorMessage - The error message of the last error. + LastErrorMessage *string `json:"lastErrorMessage,omitempty"` + // ErrorTitle - The error title. + ErrorTitle *string `json:"errorTitle,omitempty"` + // ErrorDescription - The error description. + ErrorDescription *string `json:"errorDescription,omitempty"` + // FixLink - The link for the fix of the error. + FixLink *string `json:"fixLink,omitempty"` + // FixDetails - The details of the fix. + FixDetails *string `json:"fixDetails,omitempty"` + // AdditionalInfo - The additional details. + AdditionalInfo *string `json:"additionalInfo,omitempty"` +} + +// InboundReplicationNeighbors the list of replication summary for the domain controller inbound neighbor. +type InboundReplicationNeighbors struct { + Value *[]InboundReplicationNeighbor `json:"value,omitempty"` +} + +// Item the key value pair for properties. +type Item struct { + // Key - The key for the property. + Key *string `json:"key,omitempty"` + // Value - The value for the key. + Value *string `json:"value,omitempty"` +} + +// Items the list of key value properties. +type Items struct { + autorest.Response `json:"-"` + Value *[]Item `json:"value,omitempty"` +} + +// ListString ... +type ListString struct { + autorest.Response `json:"-"` + Value *[]string `json:"value,omitempty"` +} + +// MergedExportError the merged export error. +type MergedExportError struct { + // ID - The internal Id for the export error. + ID *string `json:"id,omitempty"` + // IDSet - Indicates if the Id has been set externally or not. + IDSet *bool `json:"idSet,omitempty"` + // IncomingObjectDisplayName - The incoming object display name. + IncomingObjectDisplayName *string `json:"incomingObjectDisplayName,omitempty"` + // IncomingObjectType - The incoming object type. + IncomingObjectType *string `json:"incomingObjectType,omitempty"` + // UserPrincipalName - The user principal name + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // Type - The type of the error. + Type *string `json:"type,omitempty"` + // AttributeName - The attribute name. + AttributeName *string `json:"attributeName,omitempty"` + // AttributeValue - The attribute value. + AttributeValue *string `json:"attributeValue,omitempty"` + // TimeOccurred - The date and time when the error occurred. + TimeOccurred *date.Time `json:"timeOccurred,omitempty"` + // TimeFirstOccurred - The time when the error first occurred. + TimeFirstOccurred *date.Time `json:"timeFirstOccurred,omitempty"` + // CsObjectID - the cs object Id. + CsObjectID *string `json:"csObjectId,omitempty"` + // Dn - the DN of the object. + Dn *string `json:"dn,omitempty"` + // IncomingObject - The incoming object details. + IncomingObject *AssociatedObject `json:"incomingObject,omitempty"` + // ExistingObject - The existing object + ExistingObject *AssociatedObject `json:"existingObject,omitempty"` + // ModifiedOrRemovedAttributeValue - The modified or removed attribute vlaue. + ModifiedOrRemovedAttributeValue *string `json:"modifiedOrRemovedAttributeValue,omitempty"` + // RunStepResultID - The run step result Id. + RunStepResultID *uuid.UUID `json:"runStepResultId,omitempty"` + // SamAccountName - The sam account name. + SamAccountName *string `json:"samAccountName,omitempty"` + // ServerErrorDetail - The server error details. + ServerErrorDetail *string `json:"serverErrorDetail,omitempty"` + // ServiceID - The service Id. + ServiceID *uuid.UUID `json:"serviceId,omitempty"` + // ServiceMemberID - The server Id. + ServiceMemberID *uuid.UUID `json:"serviceMemberId,omitempty"` +} + +// MergedExportErrors the list of export errors. +type MergedExportErrors struct { + autorest.Response `json:"-"` + Value *[]ExportError `json:"value,omitempty"` +} + +// MetricGroup the metric group details. +type MetricGroup struct { + // Key - The key for the group. + Key *string `json:"key,omitempty"` + // DisplayName - The display name for the group. + DisplayName *string `json:"displayName,omitempty"` + // InvisibleForUI - indicates if the metric group is displayed in Azure Active Directory Connect Health UI. + InvisibleForUI *bool `json:"invisibleForUi,omitempty"` +} + +// MetricMetadata the metric meta data +type MetricMetadata struct { + autorest.Response `json:"-"` + // MetricsPRocessorClassName - The name of the class which retrieve and process the metric. + MetricsPRocessorClassName *string `json:"metricsPRocessorClassName,omitempty"` + // MetricName - The metric name + MetricName *string `json:"metricName,omitempty"` + // Groupings - The groupings for the metrics. + Groupings *[]MetricGroup `json:"groupings,omitempty"` + // DisplayName - The display name for the metric. + DisplayName *string `json:"displayName,omitempty"` + // ValueKind - Indicates if the metrics is a rate,value, percent or duration type. + ValueKind *string `json:"valueKind,omitempty"` + // MinValue - The minimun value. + MinValue *int32 `json:"minValue,omitempty"` + // MaxValue - The maximum value. + MaxValue *int32 `json:"maxValue,omitempty"` + // Kind - Indicates whether the dashboard to represent the metric is a line, bar,pie, area or donut chart. + Kind *string `json:"kind,omitempty"` + // IsDefault - Indicates if the metric is a default metric or not. + IsDefault *bool `json:"isDefault,omitempty"` + // IsPerfCounter - Indicates if the metric is a performance counter metric or not. + IsPerfCounter *bool `json:"isPerfCounter,omitempty"` + // IsDevOps - Indicates if the metric is visible to DevOps or not. + IsDevOps *bool `json:"isDevOps,omitempty"` +} + +// MetricMetadataList the list of metric metadata. +type MetricMetadataList struct { + autorest.Response `json:"-"` + Value *[]MetricMetadata `json:"value,omitempty"` +} + +// MetricSet the set of metric values. Example of a MetricSet are Values of token requests for a Server1 or +// RelyingParty1. +type MetricSet struct { + // SetName - The name of the set. + SetName *string `json:"setName,omitempty"` + // Values - The list of the metric values. + Values *[]int32 `json:"values,omitempty"` +} + +// MetricSets the metrics data represented set. +type MetricSets struct { + autorest.Response `json:"-"` + // Sets - The list of metric set. + Sets *[]MetricSet `json:"sets,omitempty"` + // TimeStamps - The list of timestamps for each metric in the metric set. + TimeStamps *[]date.Time `json:"timeStamps,omitempty"` +} + +// ModuleConfiguration the module configuration as required by the Agent service. +type ModuleConfiguration struct { + // AgentService - The name of agent service. + AgentService *string `json:"agentService,omitempty"` + // ModuleName - The name of the module for which the configuration is applicable. + ModuleName *string `json:"moduleName,omitempty"` + // Properties - The key value pairs of properties required for configuration. + Properties map[string]*string `json:"properties"` +} + +// MarshalJSON is the custom marshaler for ModuleConfiguration. +func (mc ModuleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.AgentService != nil { + objectMap["agentService"] = mc.AgentService + } + if mc.ModuleName != nil { + objectMap["moduleName"] = mc.ModuleName + } + if mc.Properties != nil { + objectMap["properties"] = mc.Properties + } + return json.Marshal(objectMap) +} + +// ModuleConfigurations the list of module configurations. +type ModuleConfigurations struct { + Value *[]ModuleConfiguration `json:"value,omitempty"` +} + +// ObjectWithSyncError the objects withg sync errors. +type ObjectWithSyncError struct { + // SourceOfAuthority - The source of authority. + SourceOfAuthority *string `json:"sourceOfAuthority,omitempty"` + // DisplayName - The display name. + DisplayName *string `json:"displayName,omitempty"` + // ObjectType - The object type. + ObjectType *string `json:"objectType,omitempty"` + // AttributeName - The attribute name. + AttributeName *string `json:"attributeName,omitempty"` + // AttributeValue - The attribute value. + AttributeValue *string `json:"attributeValue,omitempty"` + // ModififedValue - The modified value. + ModififedValue *string `json:"modififedValue,omitempty"` + // UserPrincipalName - The user principal name. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // ObjectGUID - The object guid. + ObjectGUID *string `json:"objectGuid,omitempty"` + // AttributeMultiValues - Indicates if the atttibute is multi-valued or not. + AttributeMultiValues *bool `json:"attributeMultiValues,omitempty"` + // MinLimit - The minimum limit. + MinLimit *string `json:"minLimit,omitempty"` + // MaxLimit - The maximum limit. + MaxLimit *string `json:"maxLimit,omitempty"` + // DistinguishedName - The distinguished name. + DistinguishedName *string `json:"distinguishedName,omitempty"` + // Mail - The email. + Mail *string `json:"mail,omitempty"` + // TimeOccured - The date and time of occurance. + TimeOccured *date.Time `json:"timeOccured,omitempty"` + // ErrorType - The error type. + ErrorType *string `json:"errorType,omitempty"` + // SourceAnchor - The source anchor. + SourceAnchor *string `json:"sourceAnchor,omitempty"` +} + +// Operation the details of the operation. +type Operation struct { + // Name - The name of the operation. + Name *string `json:"name,omitempty"` + // Display - The display details for the operation. + Display interface{} `json:"display,omitempty"` +} + +// OperationListResponse lists all of the available REST API operations for Azure Active Directory Connect Health. +type OperationListResponse struct { + autorest.Response `json:"-"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` + // Value - List of operations supported by the Microsoft.ADHybridhHealthService resource provider. + Value *[]Operation `json:"value,omitempty"` + // ContinuationToken - The continuation token to get next set of operations. + ContinuationToken *string `json:"continuationToken,omitempty"` +} + +// Partition describes the partition in Synchronization service. +type Partition struct { + // ID - The partition Id. + ID *string `json:"id,omitempty"` + // Dn - The distinguished name for the partition. + Dn *string `json:"dn,omitempty"` + // Enabled - Indicates if the partition object is selected or not. + Enabled *bool `json:"enabled,omitempty"` + // TimeCreated - The date and time when the partition is created. + TimeCreated *date.Time `json:"timeCreated,omitempty"` + // TimeLastModified - The time and date when the partition was last modified. + TimeLastModified *date.Time `json:"timeLastModified,omitempty"` + // PartitionScope - The scope of the partition. + PartitionScope *PartitionScope `json:"partitionScope,omitempty"` + // Name - The name of the partition. + Name *string `json:"name,omitempty"` + // IsDomain - Indicates if the partition is a domain or not. + IsDomain *bool `json:"isDomain,omitempty"` + // Type - The partition type. + Type *string `json:"type,omitempty"` +} + +// PartitionScope the connector partition scope. +type PartitionScope struct { + // IsDefault - Indicates if the partition scope is default or not. + IsDefault *bool `json:"isDefault,omitempty"` + // ObjectClasses - The in-scope object classes. + ObjectClasses *[]string `json:"objectClasses,omitempty"` + // ContainersIncluded - The list of containers included. + ContainersIncluded *[]string `json:"containersIncluded,omitempty"` + // ContainersExcluded - The list of containers excluded. + ContainersExcluded *[]string `json:"containersExcluded,omitempty"` +} + +// PasswordHashSyncConfiguration the password has synchronization configuration settings. +type PasswordHashSyncConfiguration struct { + // Enabled - Indicates if the password hash synchronization configuration settings is enabled. + Enabled *bool `json:"enabled,omitempty"` + // Target - The target. + Target *string `json:"target,omitempty"` +} + +// PasswordManagementSettings the password management settings. +type PasswordManagementSettings struct { + // Enabled - Indicates if the password extension is enabled. + Enabled *bool `json:"enabled,omitempty"` + // ExtensionFilePath - The file path of the password management extension. + ExtensionFilePath *string `json:"extensionFilePath,omitempty"` + // ConnectTo - Connection point of password management. + ConnectTo *string `json:"connectTo,omitempty"` + // ConnectionTimeout - Connection timeoit for password extension. + ConnectionTimeout *int32 `json:"connectionTimeout,omitempty"` + // User - User to execute password extension. + User *string `json:"user,omitempty"` + // SupportedPasswordOperations - The supported password operations. Possible values include: 'PasswordOperationTypesUndefined', 'PasswordOperationTypesSet', 'PasswordOperationTypesChange' + SupportedPasswordOperations PasswordOperationTypes `json:"supportedPasswordOperations,omitempty"` + // MaximumRetryCount - The maximum number of retries. + MaximumRetryCount *int32 `json:"maximumRetryCount,omitempty"` + // RetryIntervalInSeconds - The time between retries. + RetryIntervalInSeconds *int32 `json:"retryIntervalInSeconds,omitempty"` + // RequiresSecureConnection - Indicates if a secure connection is required for password management. + RequiresSecureConnection *bool `json:"requiresSecureConnection,omitempty"` + // UnlockAccount - Indicates if accounts should be unloacked when resetting password. + UnlockAccount *bool `json:"unlockAccount,omitempty"` +} + +// ReplicationStatus replication summary for a domain controller. +type ReplicationStatus struct { + autorest.Response `json:"-"` + // ForestName - The forest name. + ForestName *string `json:"forestName,omitempty"` + // TotalDcCount - The total numbe of domain controllers for a given forest. + TotalDcCount *int32 `json:"totalDcCount,omitempty"` + // ErrorDcCount - The total number of domain controllers with error in a given forest. + ErrorDcCount *int32 `json:"errorDcCount,omitempty"` +} + +// ReplicationSummary the replication summary for a domain controller. +type ReplicationSummary struct { + autorest.Response `json:"-"` + // TargetServer - The domain controller name. + TargetServer *string `json:"targetServer,omitempty"` + // Site - The site name for a given domain controller. + Site *string `json:"site,omitempty"` + // Domain - The domain name for a given domain controller. + Domain *string `json:"domain,omitempty"` + // Status - The health status for a domain controller. Possible values include: 'Healthy', 'Warning', 'Error', 'NotMonitored', 'Missing' + Status HealthStatus `json:"status,omitempty"` + // LastAttemptedSync - The last time when a sync was attempted for a given domain controller. + LastAttemptedSync *date.Time `json:"lastAttemptedSync,omitempty"` + // LastSuccessfulSync - The time when the last successful sync happened for a given domain controller. + LastSuccessfulSync *date.Time `json:"lastSuccessfulSync,omitempty"` + // ServiceID - The service Id. + ServiceID *uuid.UUID `json:"serviceId,omitempty"` + // ServiceMemberID - The serviceMemberId. + ServiceMemberID *uuid.UUID `json:"serviceMemberId,omitempty"` + // InboundNeighborCollection - List of individual domain controller neighbor's inbound replication status. + InboundNeighborCollection *[]InboundReplicationNeighbor `json:"inboundNeighborCollection,omitempty"` +} + +// ReplicationSummaryList the list of replication summary details. +type ReplicationSummaryList struct { + Value *[]ReplicationSummary `json:"value,omitempty"` +} + +// RuleErrorInfo the error details in legacy rule processing. +type RuleErrorInfo struct { + // AttributeMapping - The attribute mapping details. + AttributeMapping *AttributeMapping `json:"attributeMapping,omitempty"` + // ConnectorID - The connector Id. + ConnectorID *string `json:"connectorId,omitempty"` + // ConnectorName - The connector name. + ConnectorName *string `json:"connectorName,omitempty"` + // CsObjectID - The object Id. + CsObjectID *string `json:"csObjectId,omitempty"` + // Dn - The distinguished name. + Dn *string `json:"dn,omitempty"` +} + +// RunProfile describes the run profile. +type RunProfile struct { + // ID - The run profile Id. + ID *string `json:"id,omitempty"` + // Name - The run profile name + Name *string `json:"name,omitempty"` + // RunSteps - The run steps of the run profile. + RunSteps *[]RunStep `json:"runSteps,omitempty"` +} + +// RunProfiles the list of run profiles. +type RunProfiles struct { + Value *[]RunProfile `json:"value,omitempty"` +} + +// RunStep the run step for a run profile. +type RunStep struct { + // BatchSize - The batch size used by the run step. + BatchSize *int32 `json:"batchSize,omitempty"` + // ObjectProcessLimit - The obect processing limit. + ObjectProcessLimit *int32 `json:"objectProcessLimit,omitempty"` + // ObjectDeleteLimit - The object deletion limit. + ObjectDeleteLimit *int32 `json:"objectDeleteLimit,omitempty"` + // PageSize - The page size of the run step. + PageSize *int32 `json:"pageSize,omitempty"` + // PartitionID - The Id of the partition that a current run setp operation is executing. + PartitionID *string `json:"partitionId,omitempty"` + // RunStepOperationType - The run step operation types. Possible values include: 'RunStepOperationTypeUndefined', 'RunStepOperationTypeFullImport', 'RunStepOperationTypeDeltaImport', 'RunStepOperationTypeFullSynchornization', 'RunStepOperationTypeDeltaSynchronization', 'RunStepOperationTypeApplyRules', 'RunStepOperationTypeExport', 'RunStepOperationTypeFullExport', 'RunStepOperationTypeFullImportReevaluateRules' + RunStepOperationType RunStepOperationType `json:"runStepOperationType,omitempty"` +} + +// Service the details of the service for a given onboarded tenant. +type Service struct { + autorest.Response `json:"-"` + // ContinuationToken - The page-continuation token to use with a paged version of this API. + ContinuationToken *string `json:"continuationToken,omitempty"` + // TotalCount - The total number of services onboarded for a given tenant. + TotalCount *int32 `json:"totalCount,omitempty"` + // NextLink - The link used to get the next page of the operation. + NextLink *string `json:"nextLink,omitempty"` + // Value - The service properties. + Value *[]ServiceProperties `json:"value,omitempty"` +} + +// ServiceConfiguration the service configuration +type ServiceConfiguration struct { + autorest.Response `json:"-"` + // Version - The version of the sync service. + Version *string `json:"version,omitempty"` + // ServiceType - The service type of the server. Possible values include: 'ServiceTypeUndefined', 'ServiceTypeAadConnectSync', 'ServiceTypeDirSync' + ServiceType ServiceType `json:"serviceType,omitempty"` + // ServiceAccount - The service account. + ServiceAccount *string `json:"serviceAccount,omitempty"` + // SQLServer - The SQL server information. + SQLServer *string `json:"sqlServer,omitempty"` + // SQLVersion - The SQL version. + SQLVersion *string `json:"sqlVersion,omitempty"` + // SQLEdition - The SQL edition + SQLEdition *string `json:"sqlEdition,omitempty"` + // SQLInstance - The SQL instance details. + SQLInstance *string `json:"sqlInstance,omitempty"` + // SQLDatabase - The SQL database. + SQLDatabase *string `json:"sqlDatabase,omitempty"` + // SQLDatabaseSize - The SQL database size. + SQLDatabaseSize *int32 `json:"sqlDatabaseSize,omitempty"` +} + +// ServiceMember the details of the server for a given onboarded service. +type ServiceMember struct { + autorest.Response `json:"-"` + // ContinuationToken - The page-continuation token to use with a paged version of this API. + ContinuationToken *string `json:"continuationToken,omitempty"` + // TotalCount - The total number of servers onboarded for a given service. + TotalCount *int32 `json:"totalCount,omitempty"` + // NextLink - The link used to get the next page of the operation. + NextLink *string `json:"nextLink,omitempty"` + // Value - The server properties. + Value *[]ServiceMemberProperties `json:"value,omitempty"` +} + +// ServiceMemberProperties the server properties for a given service. +type ServiceMemberProperties struct { + // ServiceMemberID - The id of the server. + ServiceMemberID *string `json:"serviceMemberId,omitempty"` + // ServiceID - The service id to whom this server belongs. + ServiceID *string `json:"serviceId,omitempty"` + // TenantID - The tenant id to whom this server belongs. + TenantID *string `json:"tenantId,omitempty"` + // ActiveAlerts - The total number of alerts that are currently active for the server. + ActiveAlerts *int32 `json:"activeAlerts,omitempty"` + // AdditionalInformation - The additional information, if any, for the server. + AdditionalInformation *string `json:"additionalInformation,omitempty"` + // CreatedDate - The date time , in UTC, when the server was onboaraded to Azure Active Directory Connect Health. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // Dimensions - The server specific configuration related dimensions. + Dimensions interface{} `json:"dimensions,omitempty"` + // Disabled - Indicates if the server is disabled or not. + Disabled *bool `json:"disabled,omitempty"` + // DisabledReason - The reason for disabling the server. Possible values include: 'None', 'GdprStopCollection', 'DeletedFromPortal', 'DisabledDueToInactivity' + DisabledReason ServerDisabledReason `json:"disabledReason,omitempty"` + // InstalledQfe - The list of installed QFEs for the server. + InstalledQfe interface{} `json:"installedQfe,omitempty"` + // LastDisabled - The date and time , in UTC, when the server was last disabled. + LastDisabled *date.Time `json:"lastDisabled,omitempty"` + // LastReboot - The date and time, in UTC, when the server was last rebooted. + LastReboot *date.Time `json:"lastReboot,omitempty"` + // LastServerReportedMonitoringLevelChange - The date and time, in UTC, when the server's data monitoring configuration was last changed. + LastServerReportedMonitoringLevelChange *date.Time `json:"lastServerReportedMonitoringLevelChange,omitempty"` + // LastUpdated - The date and time, in UTC, when the server proeprties were last updated. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // MachineID - The id of the machine. + MachineID *string `json:"machineId,omitempty"` + // MachineName - The name of the server. + MachineName *string `json:"machineName,omitempty"` + // MonitoringConfigurationsComputed - The monitoring configuration of the server which determines what activities are monitored by Azure Active Directory Connect Health. + MonitoringConfigurationsComputed interface{} `json:"monitoringConfigurationsComputed,omitempty"` + // MonitoringConfigurationsCustomized - The customized monitoring configuration of the server which determines what activities are monitored by Azure Active Directory Connect Health. + MonitoringConfigurationsCustomized interface{} `json:"monitoringConfigurationsCustomized,omitempty"` + // OsName - The name of the operating system installed in the machine. + OsName *string `json:"osName,omitempty"` + // OsVersion - The version of the operating system installed in the machine. + OsVersion *string `json:"osVersion,omitempty"` + // Properties - Server specific properties. + Properties interface{} `json:"properties,omitempty"` + // RecommendedQfes - The list of recommended hotfixes for the server. + RecommendedQfes interface{} `json:"recommendedQfes,omitempty"` + // ResolvedAlerts - The total count of alerts that are resolved for this server. + ResolvedAlerts *int32 `json:"resolvedAlerts,omitempty"` + // Role - The service role that is being monitored in the server. + Role *string `json:"role,omitempty"` + // ServerReportedMonitoringLevel - The monitoring level reported by the server. Possible values include: 'Partial', 'Full', 'Off' + ServerReportedMonitoringLevel MonitoringLevel `json:"serverReportedMonitoringLevel,omitempty"` + // Status - The health status of the server. + Status *string `json:"status,omitempty"` +} + +// ServiceMembers the list of servers that are onboarded for a given service. +type ServiceMembers struct { + autorest.Response `json:"-"` + Value *[]ServiceMember `json:"value,omitempty"` +} + +// ServiceProperties the service properties for a given service. +type ServiceProperties struct { + // ID - The id of the service. + ID *string `json:"id,omitempty"` + // ActiveAlerts - The count of alerts that are currently active for the service. + ActiveAlerts *int32 `json:"activeAlerts,omitempty"` + // AdditionalInformation - The additional information related to the service. + AdditionalInformation *string `json:"additionalInformation,omitempty"` + // CreatedDate - The date and time, in UTC, when the service was onboarded to Azure Active Directory Connect Health. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // CustomNotificationEmails - The list of additional emails that are configured to recieve notifications about the service. + CustomNotificationEmails *[]string `json:"customNotificationEmails,omitempty"` + // Disabled - Indicates if the service is disabled or not. + Disabled *bool `json:"disabled,omitempty"` + // DisplayName - The display name of the service. + DisplayName *string `json:"displayName,omitempty"` + // Health - The health of the service. + Health *string `json:"health,omitempty"` + // LastDisable - The date and time, in UTC, when the service was last disabled. + LastDisable *date.Time `json:"lastDisable,omitempty"` + // LastUpdated - The date or time , in UTC, when the service properties were last updated. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // MonitoringConfigurationsComputed - The monitoring configuration of the service which determines what activities are monitored by Azure Active Directory Connect Health. + MonitoringConfigurationsComputed interface{} `json:"monitoringConfigurationsComputed,omitempty"` + // MonitoringConfigurationsCustomized - The customized monitoring configuration of the service which determines what activities are monitored by Azure Active Directory Connect Health. + MonitoringConfigurationsCustomized interface{} `json:"monitoringConfigurationsCustomized,omitempty"` + // NotificationEmailEnabled - Indicates if email notification is enabled or not. + NotificationEmailEnabled *bool `json:"notificationEmailEnabled,omitempty"` + // NotificationEmailEnabledForGlobalAdmins - Indicates if email notification is enabled for global administrators of the tenant. + NotificationEmailEnabledForGlobalAdmins *bool `json:"notificationEmailEnabledForGlobalAdmins,omitempty"` + // NotificationEmails - The list of emails to whom service notifications will be sent. + NotificationEmails *[]string `json:"notificationEmails,omitempty"` + // OriginalDisabledState - Gets the original disable state. + OriginalDisabledState *bool `json:"originalDisabledState,omitempty"` + // ResolvedAlerts - The total count of alerts that has been resolved for the service. + ResolvedAlerts *int32 `json:"resolvedAlerts,omitempty"` + // ServiceID - The id of the service. + ServiceID *string `json:"serviceId,omitempty"` + // ServiceName - The name of the service. + ServiceName *string `json:"serviceName,omitempty"` + // Signature - The signature of the service. + Signature *string `json:"signature,omitempty"` + // SimpleProperties - List of service specific configuration properties. + SimpleProperties interface{} `json:"simpleProperties,omitempty"` + // TenantID - The id of the tenant to which the service is registered to. + TenantID *string `json:"tenantId,omitempty"` + // Type - The service type for the services onboarded to Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be AdFederationService or AadSyncService or AdDomainService. + Type *string `json:"type,omitempty"` +} + +// Services the list of services for a given onboarded tenant. +type Services struct { + autorest.Response `json:"-"` + Value *[]Service `json:"value,omitempty"` +} + +// TabularExportError the details for export error. +type TabularExportError struct { + // ServiceID - The service Id. + ServiceID *uuid.UUID `json:"serviceId,omitempty"` + // ServiceMemberID - The server Id. + ServiceMemberID *uuid.UUID `json:"serviceMemberId,omitempty"` + // MergedEntityID - The merged entity Id. + MergedEntityID *uuid.UUID `json:"mergedEntityId,omitempty"` + // TabularExportErrorData - The export error data. + TabularExportErrorData *string `json:"tabularExportErrorData,omitempty"` +} + +// Tenant the details of the onboarded tenant. +type Tenant struct { + autorest.Response `json:"-"` + // TenantID - The Id of the tenant. + TenantID *string `json:"tenantId,omitempty"` + // AadLicense - The Azure Active Directory license of the tenant. + AadLicense *string `json:"aadLicense,omitempty"` + // AadPremium - Indicate if the tenant has Azure Active Directory Premium license or not. + AadPremium *bool `json:"aadPremium,omitempty"` + // AgentAutoUpdate - Indicates if the tenant is configured to automatically receive updates for Azure Active Directory Connect Health client side features. + AgentAutoUpdate *bool `json:"agentAutoUpdate,omitempty"` + // AlertSuppressionTimeInMins - The time in minutues after which an alert will be autosupressed. + AlertSuppressionTimeInMins *date.Time `json:"alertSuppressionTimeInMins,omitempty"` + // ConsentedToMicrosoftDevOps - Indicates if the tenant data can be seen by Microsoft through Azure portal. + ConsentedToMicrosoftDevOps *bool `json:"consentedToMicrosoftDevOps,omitempty"` + // CountryLetterCode - The country letter code of the tenant. + CountryLetterCode *string `json:"countryLetterCode,omitempty"` + // CreatedDate - The date, in UTC, when the tenant was onboarded to Azure Active Directory Connect Health. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // DevOpsTTL - The date and time, in UTC, till when the tenant data can be seen by Microsoft through Azure portal. + DevOpsTTL *date.Time `json:"devOpsTtl,omitempty"` + // Disabled - Indicates if the tenant is disabled in Azure Active Directory Connect Health. + Disabled *bool `json:"disabled,omitempty"` + // DisabledReason - The reason due to which the tenant was disabled in Azure Active Directory Connect Health. + DisabledReason *string `json:"disabledReason,omitempty"` + // GlobalAdminsEmail - The list of golbal administrators for the tenant. + GlobalAdminsEmail interface{} `json:"globalAdminsEmail,omitempty"` + // InitialDomain - The initial domain of the tenant. + InitialDomain *string `json:"initialDomain,omitempty"` + // LastDisabled - The date and time, in UTC, when the tenant was last disabled in Azure Active Directory Connect Health. + LastDisabled *date.Time `json:"lastDisabled,omitempty"` + // LastVerified - The date and time, in UTC, when the tenant onboarding status in Azure Active Directory Connect Health was last verified. + LastVerified *date.Time `json:"lastVerified,omitempty"` + // Onboarded - Indicates if the tenant is already onboarded to Azure Active Directory Connect Health. + Onboarded *bool `json:"onboarded,omitempty"` + // PksCertificate - The certificate associated with the tenant to onboard data to Azure Active Directory Connect Health. + PksCertificate interface{} `json:"pksCertificate,omitempty"` + // PrivatePreviewTenant - Indicates if the tenant has signed up for private preview of Azure Active Directory Connect Health features. + PrivatePreviewTenant *bool `json:"privatePreviewTenant,omitempty"` + // TenantInQuarantine - Indicates if data collection for this tenant is disabled or not. + TenantInQuarantine *bool `json:"tenantInQuarantine,omitempty"` + // TenantName - The name of the tenant. + TenantName *string `json:"tenantName,omitempty"` +} + +// TenantOnboardingDetails the tenant onboarding details. +type TenantOnboardingDetails struct { + // TenantOnboarded - Indicates if the tenant is onboarded to Azure Active Directory Connect Health or not. + TenantOnboarded *bool `json:"tenantOnboarded,omitempty"` + // OnboardingDisplayURL - The display url, to help tenant navigate or onboard to Azure Active Directory Connect Health blade, based on tenant onboarding status. + OnboardingDisplayURL *string `json:"onboardingDisplayUrl,omitempty"` +} + +// ValueDelta the value of the delta. +type ValueDelta struct { + // OperationType - The operation type. Possible values include: 'ValueDeltaOperationTypeUndefined', 'ValueDeltaOperationTypeAdd', 'ValueDeltaOperationTypeUpdate', 'ValueDeltaOperationTypeDelete' + OperationType ValueDeltaOperationType `json:"operationType,omitempty"` + // Value - The value of the delta. + Value *string `json:"value,omitempty"` +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/operations.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/operations.go new file mode 100644 index 000000000000..6178d7627c28 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/operations.go @@ -0,0 +1,98 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the REST APIs for Azure Active Drectory Connect Health +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient() OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI)} +} + +// List lists the available Azure Data Factory API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResponse, err error) { + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/premiumcheck.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/premiumcheck.go new file mode 100644 index 000000000000..909bea3aae69 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/premiumcheck.go @@ -0,0 +1,118 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// PremiumCheckClient is the REST APIs for Azure Active Drectory Connect Health +type PremiumCheckClient struct { + BaseClient +} + +// NewPremiumCheckClient creates an instance of the PremiumCheckClient client. +func NewPremiumCheckClient() PremiumCheckClient { + return NewPremiumCheckClientWithBaseURI(DefaultBaseURI) +} + +// NewPremiumCheckClientWithBaseURI creates an instance of the PremiumCheckClient client. +func NewPremiumCheckClientWithBaseURI(baseURI string) PremiumCheckClient { + return PremiumCheckClient{NewWithBaseURI(baseURI)} +} + +// GetServicesPremiumCheck gets the details of services for a tenant having Azure AD Premium license and is onboarded +// to Azure Active Directory Connect Health. +// +// filter is the service property filter to apply. serviceType is the service type for the services onboarded to +// Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, +// the service type can either be AdFederationService or AadSyncService or AdDomainService. skipCount is the skip +// count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining +// elements. takeCount is the take count , which specifies the number of elements that can be returned from a +// sequence. +func (client PremiumCheckClient) GetServicesPremiumCheck(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result Services, err error) { + req, err := client.GetServicesPremiumCheckPreparer(ctx, filter, serviceType, skipCount, takeCount) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.PremiumCheckClient", "GetServicesPremiumCheck", nil, "Failure preparing request") + return + } + + resp, err := client.GetServicesPremiumCheckSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.PremiumCheckClient", "GetServicesPremiumCheck", resp, "Failure sending request") + return + } + + result, err = client.GetServicesPremiumCheckResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.PremiumCheckClient", "GetServicesPremiumCheck", resp, "Failure responding to request") + } + + return +} + +// GetServicesPremiumCheckPreparer prepares the GetServicesPremiumCheck request. +func (client PremiumCheckClient) GetServicesPremiumCheckPreparer(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(serviceType) > 0 { + queryParameters["serviceType"] = autorest.Encode("query", serviceType) + } + if skipCount != nil { + queryParameters["skipCount"] = autorest.Encode("query", *skipCount) + } + if takeCount != nil { + queryParameters["takeCount"] = autorest.Encode("query", *takeCount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/services/premiumCheck"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServicesPremiumCheckSender sends the GetServicesPremiumCheck request. The method will close the +// http.Response Body if it receives an error. +func (client PremiumCheckClient) GetServicesPremiumCheckSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServicesPremiumCheckResponder handles the response to the GetServicesPremiumCheck request. The method always +// closes the http.Response Body. +func (client PremiumCheckClient) GetServicesPremiumCheckResponder(resp *http.Response) (result Services, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/replicationstatus.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/replicationstatus.go new file mode 100644 index 000000000000..c49dd4263b7b --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/replicationstatus.go @@ -0,0 +1,105 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ReplicationstatusClient is the REST APIs for Azure Active Drectory Connect Health +type ReplicationstatusClient struct { + BaseClient +} + +// NewReplicationstatusClient creates an instance of the ReplicationstatusClient client. +func NewReplicationstatusClient() ReplicationstatusClient { + return NewReplicationstatusClientWithBaseURI(DefaultBaseURI) +} + +// NewReplicationstatusClientWithBaseURI creates an instance of the ReplicationstatusClient client. +func NewReplicationstatusClientWithBaseURI(baseURI string) ReplicationstatusClient { + return ReplicationstatusClient{NewWithBaseURI(baseURI)} +} + +// GetReplicationStatus gets Replication status for a given Active Directory Domain Service, that is onboarded to Azure +// Active Directory Connect Health. +// +// serviceName is the name of the service. +func (client ReplicationstatusClient) GetReplicationStatus(ctx context.Context, serviceName string) (result ReplicationStatus, err error) { + req, err := client.GetReplicationStatusPreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReplicationstatusClient", "GetReplicationStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetReplicationStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReplicationstatusClient", "GetReplicationStatus", resp, "Failure sending request") + return + } + + result, err = client.GetReplicationStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReplicationstatusClient", "GetReplicationStatus", resp, "Failure responding to request") + } + + return +} + +// GetReplicationStatusPreparer prepares the GetReplicationStatus request. +func (client ReplicationstatusClient) GetReplicationStatusPreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetReplicationStatusSender sends the GetReplicationStatus request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationstatusClient) GetReplicationStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetReplicationStatusResponder handles the response to the GetReplicationStatus request. The method always +// closes the http.Response Body. +func (client ReplicationstatusClient) GetReplicationStatusResponder(resp *http.Response) (result ReplicationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/replicationsummary.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/replicationsummary.go new file mode 100644 index 000000000000..00b6f66b947f --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/replicationsummary.go @@ -0,0 +1,120 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ReplicationsummaryClient is the REST APIs for Azure Active Drectory Connect Health +type ReplicationsummaryClient struct { + BaseClient +} + +// NewReplicationsummaryClient creates an instance of the ReplicationsummaryClient client. +func NewReplicationsummaryClient() ReplicationsummaryClient { + return NewReplicationsummaryClientWithBaseURI(DefaultBaseURI) +} + +// NewReplicationsummaryClientWithBaseURI creates an instance of the ReplicationsummaryClient client. +func NewReplicationsummaryClientWithBaseURI(baseURI string) ReplicationsummaryClient { + return ReplicationsummaryClient{NewWithBaseURI(baseURI)} +} + +// GetReplicationSummaryv2 gets complete domain controller list along with replication details for a given Active +// Directory Domain Service, that is onboarded to Azure Active Directory Connect Health. +// +// serviceName is the name of the service. isGroupbySite is indicates if the result should be grouped by site or +// not. query is the custom query. nextPartitionKey is the next partition key to query for. filter is the server +// property filter to apply. nextRowKey is the next row key to query for. takeCount is the take count , which +// specifies the number of elements that can be returned from a sequence. +func (client ReplicationsummaryClient) GetReplicationSummaryv2(ctx context.Context, serviceName string, isGroupbySite bool, query string, nextPartitionKey string, filter string, nextRowKey string, takeCount *int32) (result ReplicationSummary, err error) { + req, err := client.GetReplicationSummaryv2Preparer(ctx, serviceName, isGroupbySite, query, nextPartitionKey, filter, nextRowKey, takeCount) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReplicationsummaryClient", "GetReplicationSummaryv2", nil, "Failure preparing request") + return + } + + resp, err := client.GetReplicationSummaryv2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReplicationsummaryClient", "GetReplicationSummaryv2", resp, "Failure sending request") + return + } + + result, err = client.GetReplicationSummaryv2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ReplicationsummaryClient", "GetReplicationSummaryv2", resp, "Failure responding to request") + } + + return +} + +// GetReplicationSummaryv2Preparer prepares the GetReplicationSummaryv2 request. +func (client ReplicationsummaryClient) GetReplicationSummaryv2Preparer(ctx context.Context, serviceName string, isGroupbySite bool, query string, nextPartitionKey string, filter string, nextRowKey string, takeCount *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "isGroupbySite": autorest.Encode("query", isGroupbySite), + "nextPartitionKey": autorest.Encode("query", nextPartitionKey), + "query": autorest.Encode("query", query), + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(nextRowKey) > 0 { + queryParameters["nextRowKey"] = autorest.Encode("query", nextRowKey) + } + if takeCount != nil { + queryParameters["takeCount"] = autorest.Encode("query", *takeCount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationsummary", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetReplicationSummaryv2Sender sends the GetReplicationSummaryv2 request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsummaryClient) GetReplicationSummaryv2Sender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetReplicationSummaryv2Responder handles the response to the GetReplicationSummaryv2 request. The method always +// closes the http.Response Body. +func (client ReplicationsummaryClient) GetReplicationSummaryv2Responder(resp *http.Response) (result ReplicationSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/services.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/services.go new file mode 100644 index 000000000000..6da04c848582 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/services.go @@ -0,0 +1,2139 @@ +package adhybridhealthservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/satori/go.uuid" + "net/http" +) + +// ServicesClient is the REST APIs for Azure Active Drectory Connect Health +type ServicesClient struct { + BaseClient +} + +// NewServicesClient creates an instance of the ServicesClient client. +func NewServicesClient() ServicesClient { + return NewServicesClientWithBaseURI(DefaultBaseURI) +} + +// NewServicesClientWithBaseURI creates an instance of the ServicesClient client. +func NewServicesClientWithBaseURI(baseURI string) ServicesClient { + return ServicesClient{NewWithBaseURI(baseURI)} +} + +// AddServiceMembers onboards a server, for a given service, to Azure Active Directory Connect Health Service. +// +// serviceName is the name of the service under which the server is to be onboarded. serviceMember is the server +// object. +func (client ServicesClient) AddServiceMembers(ctx context.Context, serviceName string, serviceMember ServiceMember) (result ServiceMember, err error) { + req, err := client.AddServiceMembersPreparer(ctx, serviceName, serviceMember) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "AddServiceMembers", nil, "Failure preparing request") + return + } + + resp, err := client.AddServiceMembersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "AddServiceMembers", resp, "Failure sending request") + return + } + + result, err = client.AddServiceMembersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "AddServiceMembers", resp, "Failure responding to request") + } + + return +} + +// AddServiceMembersPreparer prepares the AddServiceMembers request. +func (client ServicesClient) AddServiceMembersPreparer(ctx context.Context, serviceName string, serviceMember ServiceMember) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers", pathParameters), + autorest.WithJSON(serviceMember), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddServiceMembersSender sends the AddServiceMembers request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) AddServiceMembersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddServiceMembersResponder handles the response to the AddServiceMembers request. The method always +// closes the http.Response Body. +func (client ServicesClient) AddServiceMembersResponder(resp *http.Response) (result ServiceMember, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckServiceFeatureAvailibility checks if the service has all the pre-requisites met to use a feature. +// +// serviceName is the name of the service. featureName is the name of the feature. +func (client ServicesClient) CheckServiceFeatureAvailibility(ctx context.Context, serviceName string, featureName string) (result Bool, err error) { + req, err := client.CheckServiceFeatureAvailibilityPreparer(ctx, serviceName, featureName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "CheckServiceFeatureAvailibility", nil, "Failure preparing request") + return + } + + resp, err := client.CheckServiceFeatureAvailibilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "CheckServiceFeatureAvailibility", resp, "Failure sending request") + return + } + + result, err = client.CheckServiceFeatureAvailibilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "CheckServiceFeatureAvailibility", resp, "Failure responding to request") + } + + return +} + +// CheckServiceFeatureAvailibilityPreparer prepares the CheckServiceFeatureAvailibility request. +func (client ServicesClient) CheckServiceFeatureAvailibilityPreparer(ctx context.Context, serviceName string, featureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "featureName": autorest.Encode("path", featureName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/checkServiceFeatureAvailibility/{featureName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckServiceFeatureAvailibilitySender sends the CheckServiceFeatureAvailibility request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CheckServiceFeatureAvailibilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckServiceFeatureAvailibilityResponder handles the response to the CheckServiceFeatureAvailibility request. The method always +// closes the http.Response Body. +func (client ServicesClient) CheckServiceFeatureAvailibilityResponder(resp *http.Response) (result Bool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckTenantWhitelistingForFeature checks if the tenant, to which a service is registered, is whitelisted to use a +// feature. +// +// serviceName is the name of the service. featureName is the name of the feature. +func (client ServicesClient) CheckTenantWhitelistingForFeature(ctx context.Context, serviceName string, featureName string) (result Bool, err error) { + req, err := client.CheckTenantWhitelistingForFeaturePreparer(ctx, serviceName, featureName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "CheckTenantWhitelistingForFeature", nil, "Failure preparing request") + return + } + + resp, err := client.CheckTenantWhitelistingForFeatureSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "CheckTenantWhitelistingForFeature", resp, "Failure sending request") + return + } + + result, err = client.CheckTenantWhitelistingForFeatureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "CheckTenantWhitelistingForFeature", resp, "Failure responding to request") + } + + return +} + +// CheckTenantWhitelistingForFeaturePreparer prepares the CheckTenantWhitelistingForFeature request. +func (client ServicesClient) CheckTenantWhitelistingForFeaturePreparer(ctx context.Context, serviceName string, featureName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "featureName": autorest.Encode("path", featureName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/TenantWhitelisting/{featureName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckTenantWhitelistingForFeatureSender sends the CheckTenantWhitelistingForFeature request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CheckTenantWhitelistingForFeatureSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckTenantWhitelistingForFeatureResponder handles the response to the CheckTenantWhitelistingForFeature request. The method always +// closes the http.Response Body. +func (client ServicesClient) CheckTenantWhitelistingForFeatureResponder(resp *http.Response) (result Bool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteService deletes a service which is onboarded to Azure Active Directory Connect Health. +// +// serviceName is the name of the service which needs to be deleted. confirm is indicates if the service will be +// permanently deleted or disabled. True indicates that the service will be permanently deleted and False indicates +// that the service will be marked disabled and then deleted after 30 days, if it is not re-registered. +func (client ServicesClient) DeleteService(ctx context.Context, serviceName string, confirm *bool) (result autorest.Response, err error) { + req, err := client.DeleteServicePreparer(ctx, serviceName, confirm) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteService", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteServiceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteService", resp, "Failure sending request") + return + } + + result, err = client.DeleteServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteService", resp, "Failure responding to request") + } + + return +} + +// DeleteServicePreparer prepares the DeleteService request. +func (client ServicesClient) DeleteServicePreparer(ctx context.Context, serviceName string, confirm *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if confirm != nil { + queryParameters["confirm"] = autorest.Encode("query", *confirm) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteServiceSender sends the DeleteService request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) DeleteServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteServiceResponder handles the response to the DeleteService request. The method always +// closes the http.Response Body. +func (client ServicesClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteServiceMember deletes a server that has been onboarded to Azure Active Directory Connect Health Service. +// +// serviceName is the name of the service. serviceMemberID is the server Id. confirm is indicates if the server +// will be permanently deleted or disabled. True indicates that the server will be permanently deleted and False +// indicates that the server will be marked disabled and then deleted after 30 days, if it is not re-registered. +func (client ServicesClient) DeleteServiceMember(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, confirm *bool) (result autorest.Response, err error) { + req, err := client.DeleteServiceMemberPreparer(ctx, serviceName, serviceMemberID, confirm) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteServiceMember", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteServiceMemberSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteServiceMember", resp, "Failure sending request") + return + } + + result, err = client.DeleteServiceMemberResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteServiceMember", resp, "Failure responding to request") + } + + return +} + +// DeleteServiceMemberPreparer prepares the DeleteServiceMember request. +func (client ServicesClient) DeleteServiceMemberPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, confirm *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if confirm != nil { + queryParameters["confirm"] = autorest.Encode("query", *confirm) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteServiceMemberSender sends the DeleteServiceMember request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) DeleteServiceMemberSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteServiceMemberResponder handles the response to the DeleteServiceMember request. The method always +// closes the http.Response Body. +func (client ServicesClient) DeleteServiceMemberResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteServiceMemberData deletes the data uploaded by the server to Azure Active Directory Connect Health Service. +// +// serviceName is the name of the service. serviceMemberID is the server Id. +func (client ServicesClient) DeleteServiceMemberData(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (result autorest.Response, err error) { + req, err := client.DeleteServiceMemberDataPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteServiceMemberData", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteServiceMemberDataSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteServiceMemberData", resp, "Failure sending request") + return + } + + result, err = client.DeleteServiceMemberDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "DeleteServiceMemberData", resp, "Failure responding to request") + } + + return +} + +// DeleteServiceMemberDataPreparer prepares the DeleteServiceMemberData request. +func (client ServicesClient) DeleteServiceMemberDataPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/data", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteServiceMemberDataSender sends the DeleteServiceMemberData request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) DeleteServiceMemberDataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteServiceMemberDataResponder handles the response to the DeleteServiceMemberData request. The method always +// closes the http.Response Body. +func (client ServicesClient) DeleteServiceMemberDataResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetConnectors gets the connector details for a service. +// +// serviceName is the name of the service. serviceMemberID is the server Id. +func (client ServicesClient) GetConnectors(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (result Connectors, err error) { + req, err := client.GetConnectorsPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetConnectors", nil, "Failure preparing request") + return + } + + resp, err := client.GetConnectorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetConnectors", resp, "Failure sending request") + return + } + + result, err = client.GetConnectorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetConnectors", resp, "Failure responding to request") + } + + return +} + +// GetConnectorsPreparer prepares the GetConnectors request. +func (client ServicesClient) GetConnectorsPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/service/{serviceName}/servicemembers/{serviceMemberId}/connectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConnectorsSender sends the GetConnectors request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetConnectorsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetConnectorsResponder handles the response to the GetConnectors request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetConnectorsResponder(resp *http.Response) (result Connectors, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetExportStatus gets the export status. +// +// serviceName is the name of the service. +func (client ServicesClient) GetExportStatus(ctx context.Context, serviceName string) (result ExportStatuses, err error) { + req, err := client.GetExportStatusPreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetExportStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetExportStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetExportStatus", resp, "Failure sending request") + return + } + + result, err = client.GetExportStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetExportStatus", resp, "Failure responding to request") + } + + return +} + +// GetExportStatusPreparer prepares the GetExportStatus request. +func (client ServicesClient) GetExportStatusPreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/exportstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExportStatusSender sends the GetExportStatus request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetExportStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetExportStatusResponder handles the response to the GetExportStatus request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetExportStatusResponder(resp *http.Response) (result ExportStatuses, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGlobalConfiguration gets the global configuration. +// +// serviceName is the name of the service. serviceMemberID is the server id. +func (client ServicesClient) GetGlobalConfiguration(ctx context.Context, serviceName string, serviceMemberID string) (result GlobalConfiguration, err error) { + req, err := client.GetGlobalConfigurationPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetGlobalConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetGlobalConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetGlobalConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetGlobalConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetGlobalConfiguration", resp, "Failure responding to request") + } + + return +} + +// GetGlobalConfigurationPreparer prepares the GetGlobalConfiguration request. +func (client ServicesClient) GetGlobalConfigurationPreparer(ctx context.Context, serviceName string, serviceMemberID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/globalconfiguration", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGlobalConfigurationSender sends the GetGlobalConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetGlobalConfigurationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetGlobalConfigurationResponder handles the response to the GetGlobalConfiguration request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetGlobalConfigurationResponder(resp *http.Response) (result GlobalConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetLatestAadExportErrorCount gets the count of latest AAD export errors. +// +// serviceName is the name of the service. +func (client ServicesClient) GetLatestAadExportErrorCount(ctx context.Context, serviceName string) (result ErrorCounts, err error) { + req, err := client.GetLatestAadExportErrorCountPreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetLatestAadExportErrorCount", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatestAadExportErrorCountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetLatestAadExportErrorCount", resp, "Failure sending request") + return + } + + result, err = client.GetLatestAadExportErrorCountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetLatestAadExportErrorCount", resp, "Failure responding to request") + } + + return +} + +// GetLatestAadExportErrorCountPreparer prepares the GetLatestAadExportErrorCount request. +func (client ServicesClient) GetLatestAadExportErrorCountPreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/exporterrors/counts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLatestAadExportErrorCountSender sends the GetLatestAadExportErrorCount request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetLatestAadExportErrorCountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetLatestAadExportErrorCountResponder handles the response to the GetLatestAadExportErrorCount request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetLatestAadExportErrorCountResponder(resp *http.Response) (result ErrorCounts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetLatestAadExportErrorsV2 gets the categorized export errors. +// +// serviceName is the name of the service. errorBucket is the error category to query for. nextLink is the next +// link to get next step of data. +func (client ServicesClient) GetLatestAadExportErrorsV2(ctx context.Context, serviceName string, errorBucket string, nextLink string) (result MergedExportErrors, err error) { + req, err := client.GetLatestAadExportErrorsV2Preparer(ctx, serviceName, errorBucket, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetLatestAadExportErrorsV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatestAadExportErrorsV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetLatestAadExportErrorsV2", resp, "Failure sending request") + return + } + + result, err = client.GetLatestAadExportErrorsV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetLatestAadExportErrorsV2", resp, "Failure responding to request") + } + + return +} + +// GetLatestAadExportErrorsV2Preparer prepares the GetLatestAadExportErrorsV2 request. +func (client ServicesClient) GetLatestAadExportErrorsV2Preparer(ctx context.Context, serviceName string, errorBucket string, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "errorBucket": autorest.Encode("query", errorBucket), + } + if len(nextLink) > 0 { + queryParameters["nextLink"] = autorest.Encode("query", nextLink) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/exporterrors/listV2", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLatestAadExportErrorsV2Sender sends the GetLatestAadExportErrorsV2 request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetLatestAadExportErrorsV2Sender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetLatestAadExportErrorsV2Responder handles the response to the GetLatestAadExportErrorsV2 request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetLatestAadExportErrorsV2Responder(resp *http.Response) (result MergedExportErrors, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricMetadata gets the service related metrics information. +// +// serviceName is the name of the service. filter is the metric metadata property filter to apply. perfCounter is +// indicates if only performance counter metrics are requested. +func (client ServicesClient) GetMetricMetadata(ctx context.Context, serviceName string, filter string, perfCounter *bool) (result MetricMetadataList, err error) { + req, err := client.GetMetricMetadataPreparer(ctx, serviceName, filter, perfCounter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetMetricMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadata", resp, "Failure responding to request") + } + + return +} + +// GetMetricMetadataPreparer prepares the GetMetricMetadata request. +func (client ServicesClient) GetMetricMetadataPreparer(ctx context.Context, serviceName string, filter string, perfCounter *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if perfCounter != nil { + queryParameters["perfCounter"] = autorest.Encode("query", *perfCounter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricMetadataSender sends the GetMetricMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetMetricMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricMetadataResponder handles the response to the GetMetricMetadata request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetMetricMetadataResponder(resp *http.Response) (result MetricMetadataList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricsAverage gets the average of the metric values for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name +func (client ServicesClient) GetMetricsAverage(ctx context.Context, serviceName string, metricName string, groupName string) (result Items, err error) { + req, err := client.GetMetricsAveragePreparer(ctx, serviceName, metricName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsAverage", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsAverageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsAverage", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsAverageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsAverage", resp, "Failure responding to request") + } + + return +} + +// GetMetricsAveragePreparer prepares the GetMetricsAverage request. +func (client ServicesClient) GetMetricsAveragePreparer(ctx context.Context, serviceName string, metricName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}/average", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsAverageSender sends the GetMetricsAverage request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetMetricsAverageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsAverageResponder handles the response to the GetMetricsAverage request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetMetricsAverageResponder(resp *http.Response) (result Items, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricsForService gets the service related metrics for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name groupKey is +// the group key fromDate is the start date. toDate is the end date. +func (client ServicesClient) GetMetricsForService(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { + req, err := client.GetMetricsForServicePreparer(ctx, serviceName, metricName, groupName, groupKey, fromDate, toDate) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsForService", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsForServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsForService", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsForServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsForService", resp, "Failure responding to request") + } + + return +} + +// GetMetricsForServicePreparer prepares the GetMetricsForService request. +func (client ServicesClient) GetMetricsForServicePreparer(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(groupKey) > 0 { + queryParameters["groupKey"] = autorest.Encode("query", groupKey) + } + if fromDate != nil { + queryParameters["fromDate"] = autorest.Encode("query", *fromDate) + } + if toDate != nil { + queryParameters["toDate"] = autorest.Encode("query", *toDate) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata/{metricName}/groups/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsForServiceSender sends the GetMetricsForService request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetMetricsForServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsForServiceResponder handles the response to the GetMetricsForService request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetMetricsForServiceResponder(resp *http.Response) (result MetricSets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricsForServiceMember gets the server related metrics for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name +// serviceMemberID is the server id. groupKey is the group key fromDate is the start date. toDate is the end date. +func (client ServicesClient) GetMetricsForServiceMember(ctx context.Context, serviceName string, metricName string, groupName string, serviceMemberID uuid.UUID, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { + req, err := client.GetMetricsForServiceMemberPreparer(ctx, serviceName, metricName, groupName, serviceMemberID, groupKey, fromDate, toDate) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsForServiceMember", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsForServiceMemberSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsForServiceMember", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsForServiceMemberResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsForServiceMember", resp, "Failure responding to request") + } + + return +} + +// GetMetricsForServiceMemberPreparer prepares the GetMetricsForServiceMember request. +func (client ServicesClient) GetMetricsForServiceMemberPreparer(ctx context.Context, serviceName string, metricName string, groupName string, serviceMemberID uuid.UUID, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(groupKey) > 0 { + queryParameters["groupKey"] = autorest.Encode("query", groupKey) + } + if fromDate != nil { + queryParameters["fromDate"] = autorest.Encode("query", *fromDate) + } + if toDate != nil { + queryParameters["toDate"] = autorest.Encode("query", *toDate) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/metrics/{metricName}/groups/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsForServiceMemberSender sends the GetMetricsForServiceMember request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetMetricsForServiceMemberSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsForServiceMemberResponder handles the response to the GetMetricsForServiceMember request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetMetricsForServiceMemberResponder(resp *http.Response) (result MetricSets, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetricsSum gets the sum of the metric values for a given metric and group combination. +// +// serviceName is the name of the service. metricName is the metric name groupName is the group name +func (client ServicesClient) GetMetricsSum(ctx context.Context, serviceName string, metricName string, groupName string) (result Items, err error) { + req, err := client.GetMetricsSumPreparer(ctx, serviceName, metricName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsSum", nil, "Failure preparing request") + return + } + + resp, err := client.GetMetricsSumSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsSum", resp, "Failure sending request") + return + } + + result, err = client.GetMetricsSumResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricsSum", resp, "Failure responding to request") + } + + return +} + +// GetMetricsSumPreparer prepares the GetMetricsSum request. +func (client ServicesClient) GetMetricsSumPreparer(ctx context.Context, serviceName string, metricName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}/sum", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetricsSumSender sends the GetMetricsSum request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetMetricsSumSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMetricsSumResponder handles the response to the GetMetricsSum request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetMetricsSumResponder(resp *http.Response) (result Items, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPeralertfeedback gets a list of all alert feedback for a given tenant and alert type. +// +// serviceName is the name of the service. shortName is the name of the alert. +func (client ServicesClient) GetPeralertfeedback(ctx context.Context, serviceName string, shortName string) (result AlertFeedbacks, err error) { + req, err := client.GetPeralertfeedbackPreparer(ctx, serviceName, shortName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetPeralertfeedback", nil, "Failure preparing request") + return + } + + resp, err := client.GetPeralertfeedbackSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetPeralertfeedback", resp, "Failure sending request") + return + } + + result, err = client.GetPeralertfeedbackResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetPeralertfeedback", resp, "Failure responding to request") + } + + return +} + +// GetPeralertfeedbackPreparer prepares the GetPeralertfeedback request. +func (client ServicesClient) GetPeralertfeedbackPreparer(ctx context.Context, serviceName string, shortName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + "shortName": autorest.Encode("path", shortName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/{shortName}/alertfeedback", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPeralertfeedbackSender sends the GetPeralertfeedback request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetPeralertfeedbackSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetPeralertfeedbackResponder handles the response to the GetPeralertfeedback request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetPeralertfeedbackResponder(resp *http.Response) (result AlertFeedbacks, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetService gets the details of a service for a tenant having Azure AD Premium license and is onboarded to Azure +// Active Directory Connect Health. +// +// serviceName is the name of the service. +func (client ServicesClient) GetService(ctx context.Context, serviceName string) (result Service, err error) { + req, err := client.GetServicePreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetService", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetService", resp, "Failure sending request") + return + } + + result, err = client.GetServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetService", resp, "Failure responding to request") + } + + return +} + +// GetServicePreparer prepares the GetService request. +func (client ServicesClient) GetServicePreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceSender sends the GetService request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceResponder handles the response to the GetService request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceConfiguration gets the service configuration. +// +// serviceName is the name of the service. serviceMemberID is the server Id. +func (client ServicesClient) GetServiceConfiguration(ctx context.Context, serviceName string, serviceMemberID string) (result ServiceConfiguration, err error) { + req, err := client.GetServiceConfigurationPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetServiceConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceConfiguration", resp, "Failure responding to request") + } + + return +} + +// GetServiceConfigurationPreparer prepares the GetServiceConfiguration request. +func (client ServicesClient) GetServiceConfigurationPreparer(ctx context.Context, serviceName string, serviceMemberID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/serviceconfiguration", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceConfigurationSender sends the GetServiceConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceConfigurationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceConfigurationResponder handles the response to the GetServiceConfiguration request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceConfigurationResponder(resp *http.Response) (result ServiceConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMember gets the details of a server, for a given service, that are onboarded to Azure Active Directory +// Connect Health Service. +// +// serviceName is the name of the service. serviceMemberID is the server Id. +func (client ServicesClient) GetServiceMember(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (result ServiceMember, err error) { + req, err := client.GetServiceMemberPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMember", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMemberSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMember", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMemberResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMember", resp, "Failure responding to request") + } + + return +} + +// GetServiceMemberPreparer prepares the GetServiceMember request. +func (client ServicesClient) GetServiceMemberPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMemberSender sends the GetServiceMember request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMemberSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMemberResponder handles the response to the GetServiceMember request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMemberResponder(resp *http.Response) (result ServiceMember, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMemberAlerts gets the details of an alert for a given service and server combination. +// +// serviceMemberID is the server Id for which the laert details needs to be queried. serviceName is the name of the +// service. filter is the alert property filter to apply. state is the alert state to query for. from is the start +// date to query for. toParameter is the end date till when to query for. +func (client ServicesClient) GetServiceMemberAlerts(ctx context.Context, serviceMemberID uuid.UUID, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (result Alerts, err error) { + req, err := client.GetServiceMemberAlertsPreparer(ctx, serviceMemberID, serviceName, filter, state, from, toParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberAlerts", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMemberAlertsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberAlerts", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMemberAlertsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberAlerts", resp, "Failure responding to request") + } + + return +} + +// GetServiceMemberAlertsPreparer prepares the GetServiceMemberAlerts request. +func (client ServicesClient) GetServiceMemberAlertsPreparer(ctx context.Context, serviceMemberID uuid.UUID, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(state) > 0 { + queryParameters["state"] = autorest.Encode("query", state) + } + if from != nil { + queryParameters["from"] = autorest.Encode("query", *from) + } + if toParameter != nil { + queryParameters["to"] = autorest.Encode("query", *toParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/alerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMemberAlertsSender sends the GetServiceMemberAlerts request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMemberAlertsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMemberAlertsResponder handles the response to the GetServiceMemberAlerts request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMemberAlertsResponder(resp *http.Response) (result Alerts, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMemberCredentials gets the credentials of the server which is needed by the agent to connect to Azure +// Active Directory Connect Health Service. +// +// serviceName is the name of the service. serviceMemberID is the server Id. filter is the property filter to +// apply. +func (client ServicesClient) GetServiceMemberCredentials(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, filter string) (result Credential, err error) { + req, err := client.GetServiceMemberCredentialsPreparer(ctx, serviceName, serviceMemberID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMemberCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberCredentials", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMemberCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberCredentials", resp, "Failure responding to request") + } + + return +} + +// GetServiceMemberCredentialsPreparer prepares the GetServiceMemberCredentials request. +func (client ServicesClient) GetServiceMemberCredentialsPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/credentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMemberCredentialsSender sends the GetServiceMemberCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMemberCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMemberCredentialsResponder handles the response to the GetServiceMemberCredentials request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMemberCredentialsResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMemberDataFreshness gets the last time when the server uploaded data to Azure Active Directory Connect +// Health Service. +// +// serviceName is the name of the service. serviceMemberID is the server Id. +func (client ServicesClient) GetServiceMemberDataFreshness(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (result DataFreshnessDetail, err error) { + req, err := client.GetServiceMemberDataFreshnessPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberDataFreshness", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMemberDataFreshnessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberDataFreshness", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMemberDataFreshnessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberDataFreshness", resp, "Failure responding to request") + } + + return +} + +// GetServiceMemberDataFreshnessPreparer prepares the GetServiceMemberDataFreshness request. +func (client ServicesClient) GetServiceMemberDataFreshnessPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/datafreshness", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMemberDataFreshnessSender sends the GetServiceMemberDataFreshness request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMemberDataFreshnessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMemberDataFreshnessResponder handles the response to the GetServiceMemberDataFreshness request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMemberDataFreshnessResponder(resp *http.Response) (result DataFreshnessDetail, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMemberExportStatus gets the export status. +// +// serviceName is the name of the service. serviceMemberID is the server Id. +func (client ServicesClient) GetServiceMemberExportStatus(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (result ExportStatuses, err error) { + req, err := client.GetServiceMemberExportStatusPreparer(ctx, serviceName, serviceMemberID) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberExportStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMemberExportStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberExportStatus", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMemberExportStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMemberExportStatus", resp, "Failure responding to request") + } + + return +} + +// GetServiceMemberExportStatusPreparer prepares the GetServiceMemberExportStatus request. +func (client ServicesClient) GetServiceMemberExportStatusPreparer(ctx context.Context, serviceName string, serviceMemberID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceMemberId": autorest.Encode("path", serviceMemberID), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers/{serviceMemberId}/exportstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMemberExportStatusSender sends the GetServiceMemberExportStatus request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMemberExportStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMemberExportStatusResponder handles the response to the GetServiceMemberExportStatus request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMemberExportStatusResponder(resp *http.Response) (result ExportStatuses, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMembers gets the details of the servers, for a given service, that are onboarded to Azure Active Directory +// Connect Health Service. +// +// serviceName is the name of the service. filter is the server property filter to apply. dimensionType is the +// server specific dimension. dimensionSignature is the value of the dimension. +func (client ServicesClient) GetServiceMembers(ctx context.Context, serviceName string, filter string, dimensionType string, dimensionSignature string) (result ServiceMembers, err error) { + req, err := client.GetServiceMembersPreparer(ctx, serviceName, filter, dimensionType, dimensionSignature) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMembers", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMembersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMembers", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMembersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMembers", resp, "Failure responding to request") + } + + return +} + +// GetServiceMembersPreparer prepares the GetServiceMembers request. +func (client ServicesClient) GetServiceMembersPreparer(ctx context.Context, serviceName string, filter string, dimensionType string, dimensionSignature string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(dimensionType) > 0 { + queryParameters["dimensionType"] = autorest.Encode("query", dimensionType) + } + if len(dimensionSignature) > 0 { + queryParameters["dimensionSignature"] = autorest.Encode("query", dimensionSignature) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/servicemembers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMembersSender sends the GetServiceMembers request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMembersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMembersResponder handles the response to the GetServiceMembers request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMembersResponder(resp *http.Response) (result ServiceMembers, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServiceMonitoringConfigurations gets the service level monitoring configurations. +// +// serviceName is the name of the service. +func (client ServicesClient) GetServiceMonitoringConfigurations(ctx context.Context, serviceName string) (result Items, err error) { + req, err := client.GetServiceMonitoringConfigurationsPreparer(ctx, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMonitoringConfigurations", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceMonitoringConfigurationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMonitoringConfigurations", resp, "Failure sending request") + return + } + + result, err = client.GetServiceMonitoringConfigurationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServiceMonitoringConfigurations", resp, "Failure responding to request") + } + + return +} + +// GetServiceMonitoringConfigurationsPreparer prepares the GetServiceMonitoringConfigurations request. +func (client ServicesClient) GetServiceMonitoringConfigurationsPreparer(ctx context.Context, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServiceMonitoringConfigurationsSender sends the GetServiceMonitoringConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServiceMonitoringConfigurationsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServiceMonitoringConfigurationsResponder handles the response to the GetServiceMonitoringConfigurations request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServiceMonitoringConfigurationsResponder(resp *http.Response) (result Items, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServices gets the details of services, for a tenant, that are onboarded to Azure Active Directory Connect Health. +// +// filter is the service property filter to apply. serviceType is the service type for the services onboarded to +// Azure Active Directory Connect Health. Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, +// the service type can either be AdFederationService or AadSyncService or AdDomainService. skipCount is the skip +// count, which specifies the number of elements that can be bypassed from a sequence and then return the remaining +// elements. takeCount is the take count , which specifies the number of elements that can be returned from a +// sequence. +func (client ServicesClient) GetServices(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result Services, err error) { + req, err := client.GetServicesPreparer(ctx, filter, serviceType, skipCount, takeCount) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServices", nil, "Failure preparing request") + return + } + + resp, err := client.GetServicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServices", resp, "Failure sending request") + return + } + + result, err = client.GetServicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetServices", resp, "Failure responding to request") + } + + return +} + +// GetServicesPreparer prepares the GetServices request. +func (client ServicesClient) GetServicesPreparer(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(serviceType) > 0 { + queryParameters["serviceType"] = autorest.Encode("query", serviceType) + } + if skipCount != nil { + queryParameters["skipCount"] = autorest.Encode("query", *skipCount) + } + if takeCount != nil { + queryParameters["takeCount"] = autorest.Encode("query", *takeCount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/services"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServicesSender sends the GetServices request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetServicesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetServicesResponder handles the response to the GetServices request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetServicesResponder(resp *http.Response) (result Services, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSingleMetricMetadata gets the service related metrics information. +// +// serviceName is the name of the service. metricName is the metric name +func (client ServicesClient) GetSingleMetricMetadata(ctx context.Context, serviceName string, metricName string) (result MetricMetadata, err error) { + req, err := client.GetSingleMetricMetadataPreparer(ctx, serviceName, metricName) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetSingleMetricMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetSingleMetricMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetSingleMetricMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetSingleMetricMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetSingleMetricMetadata", resp, "Failure responding to request") + } + + return +} + +// GetSingleMetricMetadataPreparer prepares the GetSingleMetricMetadata request. +func (client ServicesClient) GetSingleMetricMetadataPreparer(ctx context.Context, serviceName string, metricName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "metricName": autorest.Encode("path", metricName), + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata/{metricName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSingleMetricMetadataSender sends the GetSingleMetricMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetSingleMetricMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSingleMetricMetadataResponder handles the response to the GetSingleMetricMetadata request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetSingleMetricMetadataResponder(resp *http.Response) (result MetricMetadata, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PostServices onboards a service for a given tenant in Azure Active Directory Connect Health. +// +// service is the service object. +func (client ServicesClient) PostServices(ctx context.Context, service Service) (result Service, err error) { + req, err := client.PostServicesPreparer(ctx, service) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "PostServices", nil, "Failure preparing request") + return + } + + resp, err := client.PostServicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "PostServices", resp, "Failure sending request") + return + } + + result, err = client.PostServicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "PostServices", resp, "Failure responding to request") + } + + return +} + +// PostServicesPreparer prepares the PostServices request. +func (client ServicesClient) PostServicesPreparer(ctx context.Context, service Service) (*http.Request, error) { + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ADHybridHealthService/services"), + autorest.WithJSON(service), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostServicesSender sends the PostServices request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) PostServicesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PostServicesResponder handles the response to the PostServices request. The method always +// closes the http.Response Body. +func (client ServicesClient) PostServicesResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateService updates the service properties of an onboarded service. +// +// serviceName is the name of the service which needs to be deleted. service is the service object. +func (client ServicesClient) UpdateService(ctx context.Context, serviceName string, service Service) (result Service, err error) { + req, err := client.UpdateServicePreparer(ctx, serviceName, service) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateService", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateService", resp, "Failure sending request") + return + } + + result, err = client.UpdateServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateService", resp, "Failure responding to request") + } + + return +} + +// UpdateServicePreparer prepares the UpdateService request. +func (client ServicesClient) UpdateServicePreparer(ctx context.Context, serviceName string, service Service) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}", pathParameters), + autorest.WithJSON(service), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateServiceSender sends the UpdateService request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) UpdateServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateServiceResponder handles the response to the UpdateService request. The method always +// closes the http.Response Body. +func (client ServicesClient) UpdateServiceResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateServiceMonitoringConfiguration updates the service level monitoring configuration. +// +// serviceName is the name of the service. configurationSetting is the mnitoring configuration to update +func (client ServicesClient) UpdateServiceMonitoringConfiguration(ctx context.Context, serviceName string, configurationSetting Item) (result autorest.Response, err error) { + req, err := client.UpdateServiceMonitoringConfigurationPreparer(ctx, serviceName, configurationSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateServiceMonitoringConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateServiceMonitoringConfigurationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateServiceMonitoringConfiguration", resp, "Failure sending request") + return + } + + result, err = client.UpdateServiceMonitoringConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateServiceMonitoringConfiguration", resp, "Failure responding to request") + } + + return +} + +// UpdateServiceMonitoringConfigurationPreparer prepares the UpdateServiceMonitoringConfiguration request. +func (client ServicesClient) UpdateServiceMonitoringConfigurationPreparer(ctx context.Context, serviceName string, configurationSetting Item) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceName": autorest.Encode("path", serviceName), + } + + const APIVersion = "2014-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfiguration", pathParameters), + autorest.WithJSON(configurationSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateServiceMonitoringConfigurationSender sends the UpdateServiceMonitoringConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) UpdateServiceMonitoringConfigurationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateServiceMonitoringConfigurationResponder handles the response to the UpdateServiceMonitoringConfiguration request. The method always +// closes the http.Response Body. +func (client ServicesClient) UpdateServiceMonitoringConfigurationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/version.go b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/version.go new file mode 100644 index 000000000000..66686c73c069 --- /dev/null +++ b/services/adhybridhealthservice/mgmt/2014-01-01/adhybridhealthservice/version.go @@ -0,0 +1,30 @@ +package adhybridhealthservice + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " adhybridhealthservice/2014-01-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}