Skip to content

Commit 5b4d03f

Browse files
author
SDKAuto
committed
CodeGen from PR 33441 in Azure/azure-rest-api-specs
Merge 61986c0207f48566fd3f0238305e2ec097cb7ac1 into bc79b816272c7e12d79e8bc63d689327fc37d11f
1 parent fa0cb9b commit 5b4d03f

File tree

12 files changed

+166
-95
lines changed

12 files changed

+166
-95
lines changed

sdk/terraform/azure-resourcemanager-terraform/CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.2 (2025-03-24)
4+
5+
- Azure Resource Manager Azure Terraform client library for Java. This package contains Microsoft Azure SDK for Azure Terraform Management SDK. The Azure Terraform management API provides a RESTful set of web services that used to manage your Azure Terraform resources. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

7-
### Breaking Changes
9+
* `models.AuthorizationScopeFilter` was added
810

9-
### Bugs Fixed
11+
#### `models.ExportQuery` was modified
1012

11-
### Other Changes
13+
* `table()` was added
14+
* `authorizationScopeFilter()` was added
15+
* `withTable(java.lang.String)` was added
16+
* `withAuthorizationScopeFilter(models.AuthorizationScopeFilter)` was added
1217

1318
## 1.0.0-beta.1 (2024-11-20)
1419

sdk/terraform/azure-resourcemanager-terraform/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
5252
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
5353

5454
```java
55-
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
55+
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
5656
TokenCredential credential = new DefaultAzureCredentialBuilder()
5757
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
5858
.build();
5959
AzureTerraformManager manager = AzureTerraformManager
6060
.authenticate(credential, profile);
6161
```
6262

63-
The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
63+
The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
6464

6565
See [Authentication][authenticate] for more options.
6666

@@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
100100
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
101101
[coc]: https://opensource.microsoft.com/codeofconduct/
102102
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
103-
104-

sdk/terraform/azure-resourcemanager-terraform/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
4747
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
4848
<revapi.skip>true</revapi.skip>
49-
<spotless.skip>false</spotless.skip>
5049
</properties>
5150
<dependencies>
5251
<dependency>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.resourcemanager.terraform.models;
6+
7+
import com.azure.core.util.ExpandableStringEnum;
8+
import java.util.Collection;
9+
10+
/**
11+
* The Azure Resource Graph Authorization Scope Filter parameter.
12+
*/
13+
public final class AuthorizationScopeFilter extends ExpandableStringEnum<AuthorizationScopeFilter> {
14+
/**
15+
* Returns assignments for the given scope and all child scopes.
16+
*/
17+
public static final AuthorizationScopeFilter AT_SCOPE_AND_BELOW = fromString("AtScopeAndBelow");
18+
19+
/**
20+
* Returns assignments for the given scope and all parent scopes, but not child scopes.
21+
*/
22+
public static final AuthorizationScopeFilter AT_SCOPE_AND_ABOVE = fromString("AtScopeAndAbove");
23+
24+
/**
25+
* Returns assignments for the given scope, all parent scopes, and all child scopes.
26+
*/
27+
public static final AuthorizationScopeFilter AT_SCOPE_ABOVE_AND_BELOW = fromString("AtScopeAboveAndBelow");
28+
29+
/**
30+
* Returns assignments only for the given scope; no parent or child scopes are included.
31+
*/
32+
public static final AuthorizationScopeFilter AT_SCOPE_EXACT = fromString("AtScopeExact");
33+
34+
/**
35+
* Creates a new instance of AuthorizationScopeFilter value.
36+
*
37+
* @deprecated Use the {@link #fromString(String)} factory method.
38+
*/
39+
@Deprecated
40+
public AuthorizationScopeFilter() {
41+
}
42+
43+
/**
44+
* Creates or finds a AuthorizationScopeFilter from its string representation.
45+
*
46+
* @param name a name to look for.
47+
* @return the corresponding AuthorizationScopeFilter.
48+
*/
49+
public static AuthorizationScopeFilter fromString(String name) {
50+
return fromString(name, AuthorizationScopeFilter.class);
51+
}
52+
53+
/**
54+
* Gets known AuthorizationScopeFilter values.
55+
*
56+
* @return known AuthorizationScopeFilter values.
57+
*/
58+
public static Collection<AuthorizationScopeFilter> values() {
59+
return values(AuthorizationScopeFilter.class);
60+
}
61+
}

sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportQuery.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ public final class ExportQuery extends BaseExportModel {
3737
*/
3838
private Boolean recursive;
3939

40+
/*
41+
* The ARG table name
42+
*/
43+
private String table;
44+
45+
/*
46+
* The ARG Scope Filter parameter
47+
*/
48+
private AuthorizationScopeFilter authorizationScopeFilter;
49+
4050
/**
4151
* Creates an instance of ExportQuery class.
4252
*/
@@ -115,6 +125,46 @@ public ExportQuery withRecursive(Boolean recursive) {
115125
return this;
116126
}
117127

128+
/**
129+
* Get the table property: The ARG table name.
130+
*
131+
* @return the table value.
132+
*/
133+
public String table() {
134+
return this.table;
135+
}
136+
137+
/**
138+
* Set the table property: The ARG table name.
139+
*
140+
* @param table the table value to set.
141+
* @return the ExportQuery object itself.
142+
*/
143+
public ExportQuery withTable(String table) {
144+
this.table = table;
145+
return this;
146+
}
147+
148+
/**
149+
* Get the authorizationScopeFilter property: The ARG Scope Filter parameter.
150+
*
151+
* @return the authorizationScopeFilter value.
152+
*/
153+
public AuthorizationScopeFilter authorizationScopeFilter() {
154+
return this.authorizationScopeFilter;
155+
}
156+
157+
/**
158+
* Set the authorizationScopeFilter property: The ARG Scope Filter parameter.
159+
*
160+
* @param authorizationScopeFilter the authorizationScopeFilter value to set.
161+
* @return the ExportQuery object itself.
162+
*/
163+
public ExportQuery withAuthorizationScopeFilter(AuthorizationScopeFilter authorizationScopeFilter) {
164+
this.authorizationScopeFilter = authorizationScopeFilter;
165+
return this;
166+
}
167+
118168
/**
119169
* {@inheritDoc}
120170
*/
@@ -170,6 +220,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
170220
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
171221
jsonWriter.writeStringField("namePattern", this.namePattern);
172222
jsonWriter.writeBooleanField("recursive", this.recursive);
223+
jsonWriter.writeStringField("table", this.table);
224+
jsonWriter.writeStringField("authorizationScopeFilter",
225+
this.authorizationScopeFilter == null ? null : this.authorizationScopeFilter.toString());
173226
return jsonWriter.writeEndObject();
174227
}
175228

@@ -203,6 +256,11 @@ public static ExportQuery fromJson(JsonReader jsonReader) throws IOException {
203256
deserializedExportQuery.namePattern = reader.getString();
204257
} else if ("recursive".equals(fieldName)) {
205258
deserializedExportQuery.recursive = reader.getNullable(JsonReader::getBoolean);
259+
} else if ("table".equals(fieldName)) {
260+
deserializedExportQuery.table = reader.getString();
261+
} else if ("authorizationScopeFilter".equals(fieldName)) {
262+
deserializedExportQuery.authorizationScopeFilter
263+
= AuthorizationScopeFilter.fromString(reader.getString());
206264
} else {
207265
reader.skipChildren();
208266
}

sdk/terraform/azure-resourcemanager-terraform/src/test/java/com/azure/resourcemanager/terraform/generated/ExportQueryTests.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

sdk/terraform/azure-resourcemanager-terraform/src/test/java/com/azure/resourcemanager/terraform/generated/ExportResourceGroupTests.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ public final class ExportResourceGroupTests {
1313
@org.junit.jupiter.api.Test
1414
public void testDeserialize() throws Exception {
1515
ExportResourceGroup model = BinaryData.fromString(
16-
"{\"type\":\"ExportResourceGroup\",\"resourceGroupName\":\"czbysc\",\"namePattern\":\"q\",\"targetProvider\":\"azurerm\",\"fullProperties\":false,\"maskSensitive\":true}")
16+
"{\"type\":\"ExportResourceGroup\",\"resourceGroupName\":\"wby\",\"namePattern\":\"k\",\"targetProvider\":\"azapi\",\"fullProperties\":false,\"maskSensitive\":false}")
1717
.toObject(ExportResourceGroup.class);
18-
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
18+
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
1919
Assertions.assertEquals(false, model.fullProperties());
20-
Assertions.assertEquals(true, model.maskSensitive());
21-
Assertions.assertEquals("czbysc", model.resourceGroupName());
22-
Assertions.assertEquals("q", model.namePattern());
20+
Assertions.assertEquals(false, model.maskSensitive());
21+
Assertions.assertEquals("wby", model.resourceGroupName());
22+
Assertions.assertEquals("k", model.namePattern());
2323
}
2424

2525
@org.junit.jupiter.api.Test
2626
public void testSerialize() throws Exception {
27-
ExportResourceGroup model = new ExportResourceGroup().withTargetProvider(TargetProvider.AZURERM)
27+
ExportResourceGroup model = new ExportResourceGroup().withTargetProvider(TargetProvider.AZAPI)
2828
.withFullProperties(false)
29-
.withMaskSensitive(true)
30-
.withResourceGroupName("czbysc")
31-
.withNamePattern("q");
29+
.withMaskSensitive(false)
30+
.withResourceGroupName("wby")
31+
.withNamePattern("k");
3232
model = BinaryData.fromObject(model).toObject(ExportResourceGroup.class);
33-
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
33+
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
3434
Assertions.assertEquals(false, model.fullProperties());
35-
Assertions.assertEquals(true, model.maskSensitive());
36-
Assertions.assertEquals("czbysc", model.resourceGroupName());
37-
Assertions.assertEquals("q", model.namePattern());
35+
Assertions.assertEquals(false, model.maskSensitive());
36+
Assertions.assertEquals("wby", model.resourceGroupName());
37+
Assertions.assertEquals("k", model.namePattern());
3838
}
3939
}

sdk/terraform/azure-resourcemanager-terraform/src/test/java/com/azure/resourcemanager/terraform/generated/ExportResourceTests.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@ public final class ExportResourceTests {
1414
@org.junit.jupiter.api.Test
1515
public void testDeserialize() throws Exception {
1616
ExportResource model = BinaryData.fromString(
17-
"{\"type\":\"ExportResource\",\"resourceIds\":[\"bj\"],\"resourceName\":\"a\",\"resourceType\":\"th\",\"namePattern\":\"hab\",\"targetProvider\":\"azapi\",\"fullProperties\":true,\"maskSensitive\":false}")
17+
"{\"type\":\"ExportResource\",\"resourceIds\":[\"s\"],\"resourceName\":\"ithxqhabifpi\",\"resourceType\":\"wczbys\",\"namePattern\":\"pqxu\",\"targetProvider\":\"azurerm\",\"fullProperties\":true,\"maskSensitive\":true}")
1818
.toObject(ExportResource.class);
19-
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
19+
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
2020
Assertions.assertEquals(true, model.fullProperties());
21-
Assertions.assertEquals(false, model.maskSensitive());
22-
Assertions.assertEquals("bj", model.resourceIds().get(0));
23-
Assertions.assertEquals("a", model.resourceName());
24-
Assertions.assertEquals("th", model.resourceType());
25-
Assertions.assertEquals("hab", model.namePattern());
21+
Assertions.assertEquals(true, model.maskSensitive());
22+
Assertions.assertEquals("s", model.resourceIds().get(0));
23+
Assertions.assertEquals("ithxqhabifpi", model.resourceName());
24+
Assertions.assertEquals("wczbys", model.resourceType());
25+
Assertions.assertEquals("pqxu", model.namePattern());
2626
}
2727

2828
@org.junit.jupiter.api.Test
2929
public void testSerialize() throws Exception {
30-
ExportResource model = new ExportResource().withTargetProvider(TargetProvider.AZAPI)
30+
ExportResource model = new ExportResource().withTargetProvider(TargetProvider.AZURERM)
3131
.withFullProperties(true)
32-
.withMaskSensitive(false)
33-
.withResourceIds(Arrays.asList("bj"))
34-
.withResourceName("a")
35-
.withResourceType("th")
36-
.withNamePattern("hab");
32+
.withMaskSensitive(true)
33+
.withResourceIds(Arrays.asList("s"))
34+
.withResourceName("ithxqhabifpi")
35+
.withResourceType("wczbys")
36+
.withNamePattern("pqxu");
3737
model = BinaryData.fromObject(model).toObject(ExportResource.class);
38-
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
38+
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
3939
Assertions.assertEquals(true, model.fullProperties());
40-
Assertions.assertEquals(false, model.maskSensitive());
41-
Assertions.assertEquals("bj", model.resourceIds().get(0));
42-
Assertions.assertEquals("a", model.resourceName());
43-
Assertions.assertEquals("th", model.resourceType());
44-
Assertions.assertEquals("hab", model.namePattern());
40+
Assertions.assertEquals(true, model.maskSensitive());
41+
Assertions.assertEquals("s", model.resourceIds().get(0));
42+
Assertions.assertEquals("ithxqhabifpi", model.resourceName());
43+
Assertions.assertEquals("wczbys", model.resourceType());
44+
Assertions.assertEquals("pqxu", model.namePattern());
4545
}
4646
}

sdk/terraform/azure-resourcemanager-terraform/src/test/java/com/azure/resourcemanager/terraform/generated/OperationInnerTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66

77
import com.azure.core.util.BinaryData;
88
import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
9-
import com.azure.resourcemanager.terraform.models.ActionType;
10-
import org.junit.jupiter.api.Assertions;
119

1210
public final class OperationInnerTests {
1311
@org.junit.jupiter.api.Test
1412
public void testDeserialize() throws Exception {
1513
OperationInner model = BinaryData.fromString(
1614
"{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}")
1715
.toObject(OperationInner.class);
18-
Assertions.assertEquals(ActionType.INTERNAL, model.actionType());
1916
}
2017
}

sdk/terraform/azure-resourcemanager-terraform/src/test/java/com/azure/resourcemanager/terraform/generated/OperationListResultTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import com.azure.core.util.BinaryData;
88
import com.azure.resourcemanager.terraform.implementation.models.OperationListResult;
9-
import com.azure.resourcemanager.terraform.models.ActionType;
109
import org.junit.jupiter.api.Assertions;
1110

1211
public final class OperationListResultTests {
@@ -15,7 +14,6 @@ public void testDeserialize() throws Exception {
1514
OperationListResult model = BinaryData.fromString(
1615
"{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}")
1716
.toObject(OperationListResult.class);
18-
Assertions.assertEquals(ActionType.INTERNAL, model.value().get(0).actionType());
1917
Assertions.assertEquals("kfo", model.nextLink());
2018
}
2119
}

0 commit comments

Comments
 (0)