forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 31045 in Azure/azure-rest-api-specs
Merge ad75094089f6e30c27e91210a93acc640e0d3da3 into e6094e6653921fca7b0b61fbc3e6e7c351e58093
- Loading branch information
SDKAuto
committed
Oct 25, 2024
1 parent
655ec0c
commit 6034cdd
Showing
60 changed files
with
1,792 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../src/samples/java/com/azure/analytics/defender/easm/generated/AssetsGetAssetResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...src/samples/java/com/azure/analytics/defender/easm/generated/AssetsListAssetResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...easm/src/samples/java/com/azure/analytics/defender/easm/generated/AssetsUpdateAssets.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...azure/analytics/defender/easm/generated/DataConnectionsCreateOrReplaceDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...java/com/azure/analytics/defender/easm/generated/DataConnectionsDeleteDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...es/java/com/azure/analytics/defender/easm/generated/DataConnectionsGetDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...s/java/com/azure/analytics/defender/easm/generated/DataConnectionsListDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...va/com/azure/analytics/defender/easm/generated/DataConnectionsValidateDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.