diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index 8a0ec00f449d..226c29e1b959 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/preview/security/mgm type AdvancedThreatProtectionClient = original.AdvancedThreatProtectionClient type AlertsClient = original.AlertsClient +type AllowedConnectionsClient = original.AllowedConnectionsClient type AutoProvisioningSettingsClient = original.AutoProvisioningSettingsClient const ( @@ -66,6 +67,13 @@ const ( AutoProvisionOn AutoProvision = original.AutoProvisionOn ) +type ConnectionType = original.ConnectionType + +const ( + External ConnectionType = original.External + Internal ConnectionType = original.Internal +) + type ExternalSecuritySolutionKind = original.ExternalSecuritySolutionKind const ( @@ -147,6 +155,11 @@ type AlertList = original.AlertList type AlertListIterator = original.AlertListIterator type AlertListPage = original.AlertListPage type AlertProperties = original.AlertProperties +type AllowedConnectionsList = original.AllowedConnectionsList +type AllowedConnectionsListIterator = original.AllowedConnectionsListIterator +type AllowedConnectionsListPage = original.AllowedConnectionsListPage +type AllowedConnectionsResource = original.AllowedConnectionsResource +type AllowedConnectionsResourceProperties = original.AllowedConnectionsResourceProperties type AscLocation = original.AscLocation type AscLocationList = original.AscLocationList type AscLocationListIterator = original.AscLocationListIterator @@ -168,6 +181,8 @@ type ComplianceListIterator = original.ComplianceListIterator type ComplianceListPage = original.ComplianceListPage type ComplianceProperties = original.ComplianceProperties type ComplianceSegment = original.ComplianceSegment +type ConnectableResource = original.ConnectableResource +type ConnectedResource = original.ConnectedResource type ConnectedWorkspace = original.ConnectedWorkspace type Contact = original.Contact type ContactList = original.ContactList @@ -236,14 +251,6 @@ type TaskListIterator = original.TaskListIterator type TaskListPage = original.TaskListPage type TaskParameters = original.TaskParameters type TaskProperties = original.TaskProperties -type TopologyList = original.TopologyList -type TopologyListIterator = original.TopologyListIterator -type TopologyListPage = original.TopologyListPage -type TopologyResource = original.TopologyResource -type TopologyResourceProperties = original.TopologyResourceProperties -type TopologySingleResource = original.TopologySingleResource -type TopologySingleResourceChild = original.TopologySingleResourceChild -type TopologySingleResourceParent = original.TopologySingleResourceParent type WorkspaceSetting = original.WorkspaceSetting type WorkspaceSettingList = original.WorkspaceSettingList type WorkspaceSettingListIterator = original.WorkspaceSettingListIterator @@ -253,7 +260,6 @@ type OperationsClient = original.OperationsClient type PricingsClient = original.PricingsClient type SettingsClient = original.SettingsClient type TasksClient = original.TasksClient -type TopologyClient = original.TopologyClient type WorkspaceSettingsClient = original.WorkspaceSettingsClient func NewAdvancedThreatProtectionClient(subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { @@ -268,6 +274,12 @@ func NewAlertsClient(subscriptionID string, ascLocation string) AlertsClient { func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsClient { return original.NewAlertsClientWithBaseURI(baseURI, subscriptionID, ascLocation) } +func NewAllowedConnectionsClient(subscriptionID string, ascLocation string) AllowedConnectionsClient { + return original.NewAllowedConnectionsClient(subscriptionID, ascLocation) +} +func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AllowedConnectionsClient { + return original.NewAllowedConnectionsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewAutoProvisioningSettingsClient(subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { return original.NewAutoProvisioningSettingsClient(subscriptionID, ascLocation) } @@ -334,6 +346,9 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { func PossibleAutoProvisionValues() []AutoProvision { return original.PossibleAutoProvisionValues() } +func PossibleConnectionTypeValues() []ConnectionType { + return original.PossibleConnectionTypeValues() +} func PossibleExternalSecuritySolutionKindValues() []ExternalSecuritySolutionKind { return original.PossibleExternalSecuritySolutionKindValues() } @@ -385,12 +400,6 @@ func NewTasksClient(subscriptionID string, ascLocation string) TasksClient { func NewTasksClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TasksClient { return original.NewTasksClientWithBaseURI(baseURI, subscriptionID, ascLocation) } -func NewTopologyClient(subscriptionID string, ascLocation string) TopologyClient { - return original.NewTopologyClient(subscriptionID, ascLocation) -} -func NewTopologyClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TopologyClient { - return original.NewTopologyClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/services/preview/security/mgmt/2017-08-01-preview/security/topology.go b/services/preview/security/mgmt/2017-08-01-preview/security/allowedconnections.go similarity index 53% rename from services/preview/security/mgmt/2017-08-01-preview/security/topology.go rename to services/preview/security/mgmt/2017-08-01-preview/security/allowedconnections.go index f489d565b27b..9402668a0128 100644 --- a/services/preview/security/mgmt/2017-08-01-preview/security/topology.go +++ b/services/preview/security/mgmt/2017-08-01-preview/security/allowedconnections.go @@ -25,27 +25,27 @@ import ( "net/http" ) -// TopologyClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type TopologyClient struct { +// AllowedConnectionsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AllowedConnectionsClient struct { BaseClient } -// NewTopologyClient creates an instance of the TopologyClient client. -func NewTopologyClient(subscriptionID string, ascLocation string) TopologyClient { - return NewTopologyClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +// NewAllowedConnectionsClient creates an instance of the AllowedConnectionsClient client. +func NewAllowedConnectionsClient(subscriptionID string, ascLocation string) AllowedConnectionsClient { + return NewAllowedConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) } -// NewTopologyClientWithBaseURI creates an instance of the TopologyClient client. -func NewTopologyClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) TopologyClient { - return TopologyClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +// NewAllowedConnectionsClientWithBaseURI creates an instance of the AllowedConnectionsClient client. +func NewAllowedConnectionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AllowedConnectionsClient { + return AllowedConnectionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Get gets a specific topology component. +// Get gets a specific allowed connections component. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -// topologyResourceName - name of a topology resources collection. -func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, topologyResourceName string) (result TopologyResource, err error) { +// connectionType - the type of allowed connections (Internal, External) +func (client AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (result AllowedConnectionsResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, @@ -53,37 +53,37 @@ func (client TopologyClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.TopologyClient", "Get", err.Error()) + return result, validation.NewError("security.AllowedConnectionsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, topologyResourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, connectionType) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.TopologyClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName string, topologyResourceName string) (*http.Request, error) { +func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, connectionType ConnectionType) (*http.Request, error) { pathParameters := map[string]interface{}{ - "ascLocation": autorest.Encode("path", client.AscLocation), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "topologyResourceName": autorest.Encode("path", topologyResourceName), + "ascLocation": autorest.Encode("path", client.AscLocation), + "connectionType": autorest.Encode("path", connectionType), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2015-06-01-preview" @@ -94,21 +94,21 @@ func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client TopologyClient) GetSender(req *http.Request) (*http.Response, error) { +func (client AllowedConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client TopologyClient) GetResponder(resp *http.Response) (result TopologyResource, err error) { +func (client AllowedConnectionsClient) GetResponder(resp *http.Response) (result AllowedConnectionsResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -119,38 +119,38 @@ func (client TopologyClient) GetResponder(resp *http.Response) (result TopologyR return } -// List gets a list that allows to build a topology view of a subscription. -func (client TopologyClient) List(ctx context.Context) (result TopologyListPage, err error) { +// List gets a list of allowed connections for the subscription. +func (client AllowedConnectionsClient) List(ctx context.Context) (result AllowedConnectionsListPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.TopologyClient", "List", err.Error()) + return result, validation.NewError("security.AllowedConnectionsClient", "List", err.Error()) } result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { - result.tl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.TopologyClient", "List", resp, "Failure sending request") + result.ACL.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "List", resp, "Failure sending request") return } - result.tl, err = client.ListResponder(resp) + result.ACL, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client TopologyClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client AllowedConnectionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -163,21 +163,21 @@ func (client TopologyClient) ListPreparer(ctx context.Context) (*http.Request, e preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections", pathParameters), 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 TopologyClient) ListSender(req *http.Request) (*http.Response, error) { +func (client AllowedConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client TopologyClient) ListResponder(resp *http.Response) (result TopologyList, err error) { +func (client AllowedConnectionsClient) ListResponder(resp *http.Response) (result AllowedConnectionsList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -189,10 +189,10 @@ func (client TopologyClient) ListResponder(resp *http.Response) (result Topology } // listNextResults retrieves the next set of results, if any. -func (client TopologyClient) listNextResults(lastResults TopologyList) (result TopologyList, err error) { - req, err := lastResults.topologyListPreparer() +func (client AllowedConnectionsClient) listNextResults(lastResults AllowedConnectionsList) (result AllowedConnectionsList, err error) { + req, err := lastResults.allowedConnectionsListPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "security.TopologyClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -200,53 +200,53 @@ func (client TopologyClient) listNextResults(lastResults TopologyList) (result T resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.TopologyClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client TopologyClient) ListComplete(ctx context.Context) (result TopologyListIterator, err error) { +func (client AllowedConnectionsClient) ListComplete(ctx context.Context) (result AllowedConnectionsListIterator, err error) { result.page, err = client.List(ctx) return } -// ListByHomeRegion gets a list that allows to build a topology view of a subscription and location. -func (client TopologyClient) ListByHomeRegion(ctx context.Context) (result TopologyListPage, err error) { +// ListByHomeRegion gets a list of allowed connections for the subscription and location. +func (client AllowedConnectionsClient) ListByHomeRegion(ctx context.Context) (result AllowedConnectionsListPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.TopologyClient", "ListByHomeRegion", err.Error()) + return result, validation.NewError("security.AllowedConnectionsClient", "ListByHomeRegion", err.Error()) } result.fn = client.listByHomeRegionNextResults req, err := client.ListByHomeRegionPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "ListByHomeRegion", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "ListByHomeRegion", nil, "Failure preparing request") return } resp, err := client.ListByHomeRegionSender(req) if err != nil { - result.tl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.TopologyClient", "ListByHomeRegion", resp, "Failure sending request") + result.ACL.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "ListByHomeRegion", resp, "Failure sending request") return } - result.tl, err = client.ListByHomeRegionResponder(resp) + result.ACL, err = client.ListByHomeRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "ListByHomeRegion", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "ListByHomeRegion", resp, "Failure responding to request") } return } // ListByHomeRegionPreparer prepares the ListByHomeRegion request. -func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { +func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -260,21 +260,21 @@ func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context) (*htt preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByHomeRegionSender sends the ListByHomeRegion request. The method will close the // http.Response Body if it receives an error. -func (client TopologyClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { +func (client AllowedConnectionsClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByHomeRegionResponder handles the response to the ListByHomeRegion request. The method always // closes the http.Response Body. -func (client TopologyClient) ListByHomeRegionResponder(resp *http.Response) (result TopologyList, err error) { +func (client AllowedConnectionsClient) ListByHomeRegionResponder(resp *http.Response) (result AllowedConnectionsList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -286,10 +286,10 @@ func (client TopologyClient) ListByHomeRegionResponder(resp *http.Response) (res } // listByHomeRegionNextResults retrieves the next set of results, if any. -func (client TopologyClient) listByHomeRegionNextResults(lastResults TopologyList) (result TopologyList, err error) { - req, err := lastResults.topologyListPreparer() +func (client AllowedConnectionsClient) listByHomeRegionNextResults(lastResults AllowedConnectionsList) (result AllowedConnectionsList, err error) { + req, err := lastResults.allowedConnectionsListPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "security.TopologyClient", "listByHomeRegionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "listByHomeRegionNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -297,17 +297,17 @@ func (client TopologyClient) listByHomeRegionNextResults(lastResults TopologyLis resp, err := client.ListByHomeRegionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.TopologyClient", "listByHomeRegionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "listByHomeRegionNextResults", resp, "Failure sending next results request") } result, err = client.ListByHomeRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.TopologyClient", "listByHomeRegionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "security.AllowedConnectionsClient", "listByHomeRegionNextResults", resp, "Failure responding to next results request") } return } // ListByHomeRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client TopologyClient) ListByHomeRegionComplete(ctx context.Context) (result TopologyListIterator, err error) { +func (client AllowedConnectionsClient) ListByHomeRegionComplete(ctx context.Context) (result AllowedConnectionsListIterator, err error) { result.page, err = client.ListByHomeRegion(ctx) return } diff --git a/services/preview/security/mgmt/2017-08-01-preview/security/models.go b/services/preview/security/mgmt/2017-08-01-preview/security/models.go index e8a69db480c3..beff3b53c085 100644 --- a/services/preview/security/mgmt/2017-08-01-preview/security/models.go +++ b/services/preview/security/mgmt/2017-08-01-preview/security/models.go @@ -88,6 +88,21 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } +// ConnectionType enumerates the values for connection type. +type ConnectionType string + +const ( + // External ... + External ConnectionType = "External" + // Internal ... + Internal ConnectionType = "Internal" +) + +// PossibleConnectionTypeValues returns an array of possible values for the ConnectionType const type. +func PossibleConnectionTypeValues() []ConnectionType { + return []ConnectionType{External, Internal} +} + // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -762,6 +777,210 @@ func (ap AlertProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AllowedConnectionsList list of allowed connections +type AllowedConnectionsList struct { + autorest.Response `json:"-"` + Value *[]AllowedConnectionsResource `json:"value,omitempty"` + // NextLink - The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AllowedConnectionsListIterator provides access to a complete listing of AllowedConnectionsResource values. +type AllowedConnectionsListIterator struct { + i int + page AllowedConnectionsListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AllowedConnectionsListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AllowedConnectionsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AllowedConnectionsListIterator) Response() AllowedConnectionsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AllowedConnectionsListIterator) Value() AllowedConnectionsResource { + if !iter.page.NotDone() { + return AllowedConnectionsResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ACL AllowedConnectionsList) IsEmpty() bool { + return ACL.Value == nil || len(*ACL.Value) == 0 +} + +// allowedConnectionsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ACL AllowedConnectionsList) allowedConnectionsListPreparer() (*http.Request, error) { + if ACL.NextLink == nil || len(to.String(ACL.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ACL.NextLink))) +} + +// AllowedConnectionsListPage contains a page of AllowedConnectionsResource values. +type AllowedConnectionsListPage struct { + fn func(AllowedConnectionsList) (AllowedConnectionsList, error) + ACL AllowedConnectionsList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AllowedConnectionsListPage) Next() error { + next, err := page.fn(page.ACL) + if err != nil { + return err + } + page.ACL = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AllowedConnectionsListPage) NotDone() bool { + return !page.ACL.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AllowedConnectionsListPage) Response() AllowedConnectionsList { + return page.ACL +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AllowedConnectionsListPage) Values() []AllowedConnectionsResource { + if page.ACL.IsEmpty() { + return nil + } + return *page.ACL.Value +} + +// AllowedConnectionsResource describes an allowed connections resource +type AllowedConnectionsResource struct { + autorest.Response `json:"-"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` + *AllowedConnectionsResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AllowedConnectionsResource. +func (acr AllowedConnectionsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acr.ID != nil { + objectMap["id"] = acr.ID + } + if acr.Name != nil { + objectMap["name"] = acr.Name + } + if acr.Type != nil { + objectMap["type"] = acr.Type + } + if acr.Location != nil { + objectMap["location"] = acr.Location + } + if acr.AllowedConnectionsResourceProperties != nil { + objectMap["properties"] = acr.AllowedConnectionsResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AllowedConnectionsResource struct. +func (acr *AllowedConnectionsResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + acr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + acr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + acr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + acr.Location = &location + } + case "properties": + if v != nil { + var allowedConnectionsResourceProperties AllowedConnectionsResourceProperties + err = json.Unmarshal(*v, &allowedConnectionsResourceProperties) + if err != nil { + return err + } + acr.AllowedConnectionsResourceProperties = &allowedConnectionsResourceProperties + } + } + } + + return nil +} + +// AllowedConnectionsResourceProperties describes properties of an allowed connections resource +type AllowedConnectionsResourceProperties struct { + // CalculatedDateTime - The UTC time on which the allowed connections resource was calculated + CalculatedDateTime *date.Time `json:"calculatedDateTime,omitempty"` + // ConnectableResources - List of connectable resources + ConnectableResources *[]ConnectableResource `json:"connectableResources,omitempty"` +} + // AscLocation the ASC location of the subscription is in the "name" field type AscLocation struct { autorest.Response `json:"-"` @@ -1660,6 +1879,26 @@ type ComplianceSegment struct { Percentage *float64 `json:"percentage,omitempty"` } +// ConnectableResource describes properties of a connectable resource +type ConnectableResource struct { + // ID - The Azure resource id + ID *string `json:"id,omitempty"` + // InboundConnectedResources - The list of Azure resources that the resource has inbound allowed connection from + InboundConnectedResources *[]ConnectedResource `json:"inboundConnectedResources,omitempty"` + // OutboundConnectedResources - The list of Azure resources that the resource has outbound allowed connection to + OutboundConnectedResources *[]ConnectedResource `json:"outboundConnectedResources,omitempty"` +} + +// ConnectedResource describes properties of a connected resource +type ConnectedResource struct { + // ConnectedResourceID - The Azure resource id of the connected resource + ConnectedResourceID *string `json:"connectedResourceId,omitempty"` + // TCPPorts - The allowed tcp ports + TCPPorts *string `json:"tcpPorts,omitempty"` + // UDPPorts - The allowed udp ports + UDPPorts *string `json:"udpPorts,omitempty"` +} + // ConnectedWorkspace ... type ConnectedWorkspace struct { // ID - Azure resource ID of the connected OMS workspace @@ -3919,242 +4158,6 @@ type TaskProperties struct { SubState *string `json:"subState,omitempty"` } -// TopologyList ... -type TopologyList struct { - autorest.Response `json:"-"` - Value *[]TopologyResource `json:"value,omitempty"` - // NextLink - The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// TopologyListIterator provides access to a complete listing of TopologyResource values. -type TopologyListIterator struct { - i int - page TopologyListPage -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *TopologyListIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter TopologyListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter TopologyListIterator) Response() TopologyList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter TopologyListIterator) Value() TopologyResource { - if !iter.page.NotDone() { - return TopologyResource{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (tl TopologyList) IsEmpty() bool { - return tl.Value == nil || len(*tl.Value) == 0 -} - -// topologyListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (tl TopologyList) topologyListPreparer() (*http.Request, error) { - if tl.NextLink == nil || len(to.String(tl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(tl.NextLink))) -} - -// TopologyListPage contains a page of TopologyResource values. -type TopologyListPage struct { - fn func(TopologyList) (TopologyList, error) - tl TopologyList -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *TopologyListPage) Next() error { - next, err := page.fn(page.tl) - if err != nil { - return err - } - page.tl = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page TopologyListPage) NotDone() bool { - return !page.tl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page TopologyListPage) Response() TopologyList { - return page.tl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page TopologyListPage) Values() []TopologyResource { - if page.tl.IsEmpty() { - return nil - } - return *page.tl.Value -} - -// TopologyResource ... -type TopologyResource struct { - autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Location where the resource is stored - Location *string `json:"location,omitempty"` - *TopologyResourceProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for TopologyResource. -func (tr TopologyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.ID != nil { - objectMap["id"] = tr.ID - } - if tr.Name != nil { - objectMap["name"] = tr.Name - } - if tr.Type != nil { - objectMap["type"] = tr.Type - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - if tr.TopologyResourceProperties != nil { - objectMap["properties"] = tr.TopologyResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TopologyResource struct. -func (tr *TopologyResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - tr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - tr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - tr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - tr.Location = &location - } - case "properties": - if v != nil { - var topologyResourceProperties TopologyResourceProperties - err = json.Unmarshal(*v, &topologyResourceProperties) - if err != nil { - return err - } - tr.TopologyResourceProperties = &topologyResourceProperties - } - } - } - - return nil -} - -// TopologyResourceProperties ... -type TopologyResourceProperties struct { - // CalculatedDateTime - The UTC time on which the topology was calculated - CalculatedDateTime *date.Time `json:"calculatedDateTime,omitempty"` - // TopologyResources - Azure resources which are part of this topology resource - TopologyResources *[]TopologySingleResource `json:"topologyResources,omitempty"` -} - -// TopologySingleResource ... -type TopologySingleResource struct { - // ResourceID - Azure resource id - ResourceID *string `json:"resourceId,omitempty"` - // Severity - The security severity of the resource - Severity *string `json:"severity,omitempty"` - // RecommendationsExist - Indicates if the resource has security recommendations - RecommendationsExist *bool `json:"recommendationsExist,omitempty"` - // NetworkZones - Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.) - NetworkZones *string `json:"networkZones,omitempty"` - // TopologyScore - Score of the resource based on its security severity - TopologyScore *int32 `json:"topologyScore,omitempty"` - // Location - The location of this resource - Location *string `json:"location,omitempty"` - // Parents - Azure resources connected to this resource which are in higher level in the topology view - Parents *[]TopologySingleResourceParent `json:"parents,omitempty"` - // Children - Azure resources connected to this resource which are in lower level in the topology view - Children *[]TopologySingleResourceChild `json:"children,omitempty"` -} - -// TopologySingleResourceChild ... -type TopologySingleResourceChild struct { - // ResourceID - Azure resource id which serves as child resource in topology view - ResourceID *string `json:"resourceId,omitempty"` -} - -// TopologySingleResourceParent ... -type TopologySingleResourceParent struct { - // ResourceID - Azure resource id which serves as parent resource in topology view - ResourceID *string `json:"resourceId,omitempty"` -} - // WorkspaceSetting configures where to store the OMS agent data for workspaces under a scope type WorkspaceSetting struct { autorest.Response `json:"-"`