Skip to content

Commit

Permalink
CodeGen from PR 18640 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Update AlertRules.json (Azure#18640)
  • Loading branch information
SDKAuto committed Apr 12, 2022
1 parent e358f3e commit bde34c2
Show file tree
Hide file tree
Showing 118 changed files with 502 additions and 622 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-04-12)

- Azure Resource Manager SecurityInsights client library for Java. This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager SecurityInsights client library for Java.

This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-securityinsights</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
380 changes: 177 additions & 203 deletions sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for SecurityInsights Management</name>
<description>This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-01.</description>
<description>This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-04.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand Down Expand Up @@ -190,6 +192,19 @@ public static SecurityInsightsManager authenticate(TokenCredential credential, A
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of SecurityInsights service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the SecurityInsights service API instance.
*/
public static SecurityInsightsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new SecurityInsightsManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create SecurityInsightsManager with optional configuration.
*
Expand All @@ -208,6 +223,7 @@ public static final class Configurable {
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -268,6 +284,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
Expand Down Expand Up @@ -301,7 +330,7 @@ public SecurityInsightsManager authenticate(TokenCredential credential, AzurePro
.append("-")
.append("com.azure.resourcemanager.securityinsights")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -319,10 +348,15 @@ public SecurityInsightsManager authenticate(TokenCredential credential, AzurePro
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,38 @@

package com.azure.resourcemanager.securityinsights.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.models.EntityProviders;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** EntityAnalytics property bag. */
@Immutable
@Fluent
public final class EntityAnalyticsProperties {
/*
* Determines whether the setting is enable or disabled.
* The relevant entity providers that are synced
*/
@JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY)
private Boolean isEnabled;
@JsonProperty(value = "entityProviders")
private List<EntityProviders> entityProviders;

/**
* Get the isEnabled property: Determines whether the setting is enable or disabled.
* Get the entityProviders property: The relevant entity providers that are synced.
*
* @return the isEnabled value.
* @return the entityProviders value.
*/
public Boolean isEnabled() {
return this.isEnabled;
public List<EntityProviders> entityProviders() {
return this.entityProviders;
}

/**
* Set the entityProviders property: The relevant entity providers that are synced.
*
* @param entityProviders the entityProviders value to set.
* @return the EntityAnalyticsProperties object itself.
*/
public EntityAnalyticsProperties withEntityProviders(List<EntityProviders> entityProviders) {
this.entityProviders = entityProviders;
return this;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package com.azure.resourcemanager.securityinsights.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.models.ProvisioningState;
import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag;
import com.azure.resourcemanager.securityinsights.models.SourceType;
import com.azure.resourcemanager.securityinsights.models.UserInfo;
Expand Down Expand Up @@ -455,31 +454,6 @@ public WatchlistInner withRawContent(String rawContent) {
return this;
}

/**
* Get the sasUri property: The Shared Access Signature (SAS) URI under which the large csv watchlist file is
* located and from which the watchlist and its items will be created.
*
* @return the sasUri value.
*/
public String sasUri() {
return this.innerProperties() == null ? null : this.innerProperties().sasUri();
}

/**
* Set the sasUri property: The Shared Access Signature (SAS) URI under which the large csv watchlist file is
* located and from which the watchlist and its items will be created.
*
* @param sasUri the sasUri value to set.
* @return the WatchlistInner object itself.
*/
public WatchlistInner withSasUri(String sasUri) {
if (this.innerProperties() == null) {
this.innerProperties = new WatchlistProperties();
}
this.innerProperties().withSasUri(sasUri);
return this;
}

/**
* Get the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for
* joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then
Expand Down Expand Up @@ -555,15 +529,6 @@ public WatchlistInner withUploadStatus(String uploadStatus) {
return this;
}

/**
* Get the provisioningState property: The provisioning state of the watchlist resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}

/**
* Validates the instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.securityinsights.models.ProvisioningState;
import com.azure.resourcemanager.securityinsights.models.SourceType;
import com.azure.resourcemanager.securityinsights.models.UserInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -127,14 +126,6 @@ public final class WatchlistProperties {
@JsonProperty(value = "rawContent")
private String rawContent;

/*
* The Shared Access Signature (SAS) URI under which the large csv
* watchlist file is located and from which the watchlist and its items
* will be created
*/
@JsonProperty(value = "sasUri")
private String sasUri;

/*
* The search key is used to optimize query performance when using
* watchlists for joins with other data. For example, enable a column with
Expand All @@ -158,12 +149,6 @@ public final class WatchlistProperties {
@JsonProperty(value = "uploadStatus")
private String uploadStatus;

/*
* The provisioning state of the watchlist resource.
*/
@JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private ProvisioningState provisioningState;

/**
* Get the watchlistId property: The id (a Guid) of the watchlist.
*
Expand Down Expand Up @@ -526,28 +511,6 @@ public WatchlistProperties withRawContent(String rawContent) {
return this;
}

/**
* Get the sasUri property: The Shared Access Signature (SAS) URI under which the large csv watchlist file is
* located and from which the watchlist and its items will be created.
*
* @return the sasUri value.
*/
public String sasUri() {
return this.sasUri;
}

/**
* Set the sasUri property: The Shared Access Signature (SAS) URI under which the large csv watchlist file is
* located and from which the watchlist and its items will be created.
*
* @param sasUri the sasUri value to set.
* @return the WatchlistProperties object itself.
*/
public WatchlistProperties withSasUri(String sasUri) {
this.sasUri = sasUri;
return this;
}

/**
* Get the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for
* joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then
Expand Down Expand Up @@ -614,15 +577,6 @@ public WatchlistProperties withUploadStatus(String uploadStatus) {
return this;
}

/**
* Get the provisioningState property: The provisioning state of the watchlist resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.provisioningState;
}

/**
* Validates the instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.AzureEnvironment;
Expand Down Expand Up @@ -67,34 +66,34 @@ public SecurityInsightsBuilder environment(AzureEnvironment environment) {
}

/*
* The default poll interval for long-running operation
* The HTTP pipeline to send requests through
*/
private Duration defaultPollInterval;
private HttpPipeline pipeline;

/**
* Sets The default poll interval for long-running operation.
* Sets The HTTP pipeline to send requests through.
*
* @param defaultPollInterval the defaultPollInterval value.
* @param pipeline the pipeline value.
* @return the SecurityInsightsBuilder.
*/
public SecurityInsightsBuilder defaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = defaultPollInterval;
public SecurityInsightsBuilder pipeline(HttpPipeline pipeline) {
this.pipeline = pipeline;
return this;
}

/*
* The HTTP pipeline to send requests through
* The default poll interval for long-running operation
*/
private HttpPipeline pipeline;
private Duration defaultPollInterval;

/**
* Sets The HTTP pipeline to send requests through.
* Sets The default poll interval for long-running operation.
*
* @param pipeline the pipeline value.
* @param defaultPollInterval the defaultPollInterval value.
* @return the SecurityInsightsBuilder.
*/
public SecurityInsightsBuilder pipeline(HttpPipeline pipeline) {
this.pipeline = pipeline;
public SecurityInsightsBuilder defaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = defaultPollInterval;
return this;
}

Expand All @@ -120,21 +119,21 @@ public SecurityInsightsBuilder serializerAdapter(SerializerAdapter serializerAda
* @return an instance of SecurityInsightsImpl.
*/
public SecurityInsightsImpl buildClient() {
if (pipeline == null) {
this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
}
if (endpoint == null) {
this.endpoint = "https://management.azure.com";
}
if (environment == null) {
this.environment = AzureEnvironment.AZURE;
}
if (pipeline == null) {
this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
}
if (defaultPollInterval == null) {
this.defaultPollInterval = Duration.ofSeconds(30);
}
if (pipeline == null) {
this.pipeline =
new HttpPipelineBuilder()
.policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
.build();
}
if (serializerAdapter == null) {
this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
}
Expand Down
Loading

0 comments on commit bde34c2

Please sign in to comment.