Skip to content

Commit

Permalink
CodeGen from PR 31045 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge ad75094089f6e30c27e91210a93acc640e0d3da3 into e6094e6653921fca7b0b61fbc3e6e7c351e58093
  • Loading branch information
SDKAuto committed Oct 25, 2024
1 parent 655ec0c commit 6034cdd
Show file tree
Hide file tree
Showing 60 changed files with 1,792 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public final class AuditTrailItem implements JsonSerializable<AuditTrailItem> {

/*
* The system generated unique id for the resource.
* This is typically the same as the name but might be different for different models.
*/
@Generated
private String id;
Expand Down Expand Up @@ -55,7 +55,7 @@ private AuditTrailItem() {
}

/**
* Get the id property: The system generated unique id for the resource.
* Get the id property: This is typically the same as the name but might be different for different models.
*
* @return the id value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class AzureDataExplorerDataConnection extends DataConnection {
private final AzureDataExplorerDataConnectionProperties properties;

/*
* The system generated unique id for the resource.
* This is typically the same as the name but might be different for different models.
*/
@Generated
private String id;
Expand Down Expand Up @@ -61,7 +61,7 @@ public final class AzureDataExplorerDataConnection extends DataConnection {
private DataConnectionFrequency frequency;

/*
* The day to update the data connection on.
* The day to update the data connection on. (1-7 for weekly, 1-31 for monthly)
*/
@Generated
private Integer frequencyOffset;
Expand Down Expand Up @@ -122,7 +122,7 @@ public AzureDataExplorerDataConnectionProperties getProperties() {
}

/**
* Get the id property: The system generated unique id for the resource.
* Get the id property: This is typically the same as the name but might be different for different models.
*
* @return the id value.
*/
Expand Down Expand Up @@ -177,7 +177,7 @@ public DataConnectionFrequency getFrequency() {
}

/**
* Get the frequencyOffset property: The day to update the data connection on.
* Get the frequencyOffset property: The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
*
* @return the frequencyOffset value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class DataConnection implements JsonSerializable<DataConnection> {
private String kind = "DataConnection";

/*
* The system generated unique id for the resource.
* This is typically the same as the name but might be different for different models.
*/
@Generated
private String id;
Expand Down Expand Up @@ -62,7 +62,7 @@ public class DataConnection implements JsonSerializable<DataConnection> {
private DataConnectionFrequency frequency;

/*
* The day to update the data connection on.
* The day to update the data connection on. (1-7 for weekly, 1-31 for monthly)
*/
@Generated
private Integer frequencyOffset;
Expand Down Expand Up @@ -109,7 +109,7 @@ public String getKind() {
}

/**
* Get the id property: The system generated unique id for the resource.
* Get the id property: This is typically the same as the name but might be different for different models.
*
* @return the id value.
*/
Expand All @@ -119,7 +119,7 @@ public String getId() {
}

/**
* Set the id property: The system generated unique id for the resource.
* Set the id property: This is typically the same as the name but might be different for different models.
*
* @param id the id value to set.
* @return the DataConnection object itself.
Expand Down Expand Up @@ -241,7 +241,7 @@ DataConnection setFrequency(DataConnectionFrequency frequency) {
}

/**
* Get the frequencyOffset property: The day to update the data connection on.
* Get the frequencyOffset property: The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
*
* @return the frequencyOffset value.
*/
Expand All @@ -251,7 +251,7 @@ public Integer getFrequencyOffset() {
}

/**
* Set the frequencyOffset property: The day to update the data connection on.
* Set the frequencyOffset property: The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
*
* @param frequencyOffset the frequencyOffset value to set.
* @return the DataConnection object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public final class DiscoGroup implements JsonSerializable<DiscoGroup> {

/*
* The system generated unique id for the resource.
* This is typically the same as the name but might be different for different models.
*/
@Generated
private String id;
Expand Down Expand Up @@ -101,7 +101,7 @@ private DiscoGroup() {
}

/**
* Get the id property: The system generated unique id for the resource.
* Get the id property: This is typically the same as the name but might be different for different models.
*
* @return the id value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class LogAnalyticsDataConnection extends DataConnection {
private final LogAnalyticsDataConnectionProperties properties;

/*
* The system generated unique id for the resource.
* This is typically the same as the name but might be different for different models.
*/
@Generated
private String id;
Expand Down Expand Up @@ -61,7 +61,7 @@ public final class LogAnalyticsDataConnection extends DataConnection {
private DataConnectionFrequency frequency;

/*
* The day to update the data connection on.
* The day to update the data connection on. (1-7 for weekly, 1-31 for monthly)
*/
@Generated
private Integer frequencyOffset;
Expand Down Expand Up @@ -122,7 +122,7 @@ public LogAnalyticsDataConnectionProperties getProperties() {
}

/**
* Get the id property: The system generated unique id for the resource.
* Get the id property: This is typically the same as the name but might be different for different models.
*
* @return the id value.
*/
Expand Down Expand Up @@ -177,7 +177,7 @@ public DataConnectionFrequency getFrequency() {
}

/**
* Get the frequencyOffset property: The day to update the data connection on.
* Get the frequencyOffset property: The day to update the data connection on. (1-7 for weekly, 1-31 for monthly).
*
* @return the frequencyOffset value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public final class SavedFilter implements JsonSerializable<SavedFilter> {

/*
* The system generated unique id for the resource.
* This is typically the same as the name but might be different for different models.
*/
@Generated
private String id;
Expand Down Expand Up @@ -55,7 +55,7 @@ private SavedFilter() {
}

/**
* Get the id property: The system generated unique id for the resource.
* Get the id property: This is typically the same as the name but might be different for different models.
*
* @return the id value.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.AssetResource;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class AssetsGetAssetResource {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.getassetresource.assetsgetassetresource
AssetResource response = easmClient.getAssetResource("aG9zdCQkY29udG9zby5jb20");
// END:com.azure.analytics.defender.easm.generated.getassetresource.assetsgetassetresource
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.AssetResource;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class AssetsListAssetResource {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.listassetresource.assetslistassetresource
PagedIterable<AssetResource> response = easmClient.listAssetResource("state = \"confirmed\"", null, 0, null);
// END:com.azure.analytics.defender.easm.generated.listassetresource.assetslistassetresource
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.AssetUpdateData;
import com.azure.analytics.defender.easm.models.AssetUpdateState;
import com.azure.analytics.defender.easm.models.Task;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;
import java.util.HashMap;
import java.util.Map;

public class AssetsUpdateAssets {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.updateassets.assetsupdateassets
Task response = easmClient.updateAssets("state = \"confirmed\" AND name ^= \"contoso.com\"",
new AssetUpdateData().setState(AssetUpdateState.CONFIRMED)
.setExternalId("contosoInternalId")
.setLabels(mapOf("contosoLabel", true)));
// END:com.azure.analytics.defender.easm.generated.updateassets.assetsupdateassets
}

// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.DataConnection;
import com.azure.analytics.defender.easm.models.DataConnectionFrequency;
import com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionData;
import com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionProperties;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class DataConnectionsCreateOrReplaceDataConnection {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.createorreplacedataconnection.dataconnectionscreateorreplacedataconnection
DataConnection response = easmClient.createOrReplaceDataConnection("ThisisaDataConnection",
new LogAnalyticsDataConnectionData(
new LogAnalyticsDataConnectionProperties().setApiKey("fakeTokenPlaceholder")
.setWorkspaceId("ThisisWorkspaceId")).setFrequency(DataConnectionFrequency.WEEKLY)
.setFrequencyOffset(1));
// END:com.azure.analytics.defender.easm.generated.createorreplacedataconnection.dataconnectionscreateorreplacedataconnection
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class DataConnectionsDeleteDataConnection {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.deletedataconnection.dataconnectionsdeletedataconnection
easmClient.deleteDataConnection("ThisisaDataConnection");
// END:com.azure.analytics.defender.easm.generated.deletedataconnection.dataconnectionsdeletedataconnection
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.DataConnection;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class DataConnectionsGetDataConnection {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.getdataconnection.dataconnectionsgetdataconnection
DataConnection response = easmClient.getDataConnection("ThisisaDataConnection");
// END:com.azure.analytics.defender.easm.generated.getdataconnection.dataconnectionsgetdataconnection
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.DataConnection;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class DataConnectionsListDataConnection {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.listdataconnection.dataconnectionslistdataconnection
PagedIterable<DataConnection> response = easmClient.listDataConnection(null);
// END:com.azure.analytics.defender.easm.generated.listdataconnection.dataconnectionslistdataconnection
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.analytics.defender.easm.generated;

import com.azure.analytics.defender.easm.EasmClient;
import com.azure.analytics.defender.easm.EasmClientBuilder;
import com.azure.analytics.defender.easm.models.DataConnectionFrequency;
import com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionData;
import com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionProperties;
import com.azure.analytics.defender.easm.models.ValidateResult;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class DataConnectionsValidateDataConnection {
public static void main(String[] args) {
EasmClient easmClient = new EasmClientBuilder().credential(new DefaultAzureCredentialBuilder().build())
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
.buildClient();
// BEGIN:com.azure.analytics.defender.easm.generated.validatedataconnection.dataconnectionsvalidatedataconnection
ValidateResult response = easmClient.validateDataConnection(new LogAnalyticsDataConnectionData(
new LogAnalyticsDataConnectionProperties().setApiKey("fakeTokenPlaceholder")
.setWorkspaceId("ThisisWorkspaceId")).setName("ThisisaDataConnection")
.setFrequency(DataConnectionFrequency.WEEKLY)
.setFrequencyOffset(1));
// END:com.azure.analytics.defender.easm.generated.validatedataconnection.dataconnectionsvalidatedataconnection
}
}
Loading

0 comments on commit 6034cdd

Please sign in to comment.