Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/terraform/azure-resourcemanager-terraform/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.2 (2025-02-28)

- 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).

### Features Added

Expand Down
8 changes: 3 additions & 5 deletions sdk/terraform/azure-resourcemanager-terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-terraform</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
AzureTerraformManager manager = AzureTerraformManager
.authenticate(credential, profile);
```

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

See [Authentication][authenticate] for more options.

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


1 change: 0 additions & 1 deletion sdk/terraform/azure-resourcemanager-terraform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.terraform.models;

import com.azure.core.util.ExpandableStringEnum;
import java.util.Collection;

/**
* The Azure Resource Graph Authorization Scope Filter parameter.
*/
public final class AuthorizationScopeFilter extends ExpandableStringEnum<AuthorizationScopeFilter> {
/**
* Returns assignments for the given scope and all child scopes.
*/
public static final AuthorizationScopeFilter AT_SCOPE_AND_BELOW = fromString("AtScopeAndBelow");

/**
* Returns assignments for the given scope and all parent scopes, but not child scopes.
*/
public static final AuthorizationScopeFilter AT_SCOPE_AND_ABOVE = fromString("AtScopeAndAbove");

/**
* Returns assignments for the given scope, all parent scopes, and all child scopes.
*/
public static final AuthorizationScopeFilter AT_SCOPE_ABOVE_AND_BELOW = fromString("AtScopeAboveAndBelow");

/**
* Returns assignments only for the given scope; no parent or child scopes are included.
*/
public static final AuthorizationScopeFilter AT_SCOPE_EXACT = fromString("AtScopeExact");

/**
* Creates a new instance of AuthorizationScopeFilter value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Deprecated
public AuthorizationScopeFilter() {
}

/**
* Creates or finds a AuthorizationScopeFilter from its string representation.
*
* @param name a name to look for.
* @return the corresponding AuthorizationScopeFilter.
*/
public static AuthorizationScopeFilter fromString(String name) {
return fromString(name, AuthorizationScopeFilter.class);
}

/**
* Gets known AuthorizationScopeFilter values.
*
* @return known AuthorizationScopeFilter values.
*/
public static Collection<AuthorizationScopeFilter> values() {
return values(AuthorizationScopeFilter.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ public final class ExportQuery extends BaseExportModel {
*/
private Boolean recursive;

/*
* The ARG table name
*/
private String table;

/*
* The ARG Scope Filter parameter
*/
private AuthorizationScopeFilter authorizationScopeFilter;

/**
* Creates an instance of ExportQuery class.
*/
Expand Down Expand Up @@ -115,6 +125,46 @@ public ExportQuery withRecursive(Boolean recursive) {
return this;
}

/**
* Get the table property: The ARG table name.
*
* @return the table value.
*/
public String table() {
return this.table;
}

/**
* Set the table property: The ARG table name.
*
* @param table the table value to set.
* @return the ExportQuery object itself.
*/
public ExportQuery withTable(String table) {
this.table = table;
return this;
}

/**
* Get the authorizationScopeFilter property: The ARG Scope Filter parameter.
*
* @return the authorizationScopeFilter value.
*/
public AuthorizationScopeFilter authorizationScopeFilter() {
return this.authorizationScopeFilter;
}

/**
* Set the authorizationScopeFilter property: The ARG Scope Filter parameter.
*
* @param authorizationScopeFilter the authorizationScopeFilter value to set.
* @return the ExportQuery object itself.
*/
public ExportQuery withAuthorizationScopeFilter(AuthorizationScopeFilter authorizationScopeFilter) {
this.authorizationScopeFilter = authorizationScopeFilter;
return this;
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -170,6 +220,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeStringField("namePattern", this.namePattern);
jsonWriter.writeBooleanField("recursive", this.recursive);
jsonWriter.writeStringField("table", this.table);
jsonWriter.writeStringField("authorizationScopeFilter",
this.authorizationScopeFilter == null ? null : this.authorizationScopeFilter.toString());
return jsonWriter.writeEndObject();
}

Expand Down Expand Up @@ -203,6 +256,11 @@ public static ExportQuery fromJson(JsonReader jsonReader) throws IOException {
deserializedExportQuery.namePattern = reader.getString();
} else if ("recursive".equals(fieldName)) {
deserializedExportQuery.recursive = reader.getNullable(JsonReader::getBoolean);
} else if ("table".equals(fieldName)) {
deserializedExportQuery.table = reader.getString();
} else if ("authorizationScopeFilter".equals(fieldName)) {
deserializedExportQuery.authorizationScopeFilter
= AuthorizationScopeFilter.fromString(reader.getString());
} else {
reader.skipChildren();
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ public final class ExportResourceGroupTests {
@org.junit.jupiter.api.Test
public void testDeserialize() throws Exception {
ExportResourceGroup model = BinaryData.fromString(
"{\"type\":\"ExportResourceGroup\",\"resourceGroupName\":\"czbysc\",\"namePattern\":\"q\",\"targetProvider\":\"azurerm\",\"fullProperties\":false,\"maskSensitive\":true}")
"{\"type\":\"ExportResourceGroup\",\"resourceGroupName\":\"wby\",\"namePattern\":\"k\",\"targetProvider\":\"azapi\",\"fullProperties\":false,\"maskSensitive\":false}")
.toObject(ExportResourceGroup.class);
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
Assertions.assertEquals(false, model.fullProperties());
Assertions.assertEquals(true, model.maskSensitive());
Assertions.assertEquals("czbysc", model.resourceGroupName());
Assertions.assertEquals("q", model.namePattern());
Assertions.assertEquals(false, model.maskSensitive());
Assertions.assertEquals("wby", model.resourceGroupName());
Assertions.assertEquals("k", model.namePattern());
}

@org.junit.jupiter.api.Test
public void testSerialize() throws Exception {
ExportResourceGroup model = new ExportResourceGroup().withTargetProvider(TargetProvider.AZURERM)
ExportResourceGroup model = new ExportResourceGroup().withTargetProvider(TargetProvider.AZAPI)
.withFullProperties(false)
.withMaskSensitive(true)
.withResourceGroupName("czbysc")
.withNamePattern("q");
.withMaskSensitive(false)
.withResourceGroupName("wby")
.withNamePattern("k");
model = BinaryData.fromObject(model).toObject(ExportResourceGroup.class);
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
Assertions.assertEquals(false, model.fullProperties());
Assertions.assertEquals(true, model.maskSensitive());
Assertions.assertEquals("czbysc", model.resourceGroupName());
Assertions.assertEquals("q", model.namePattern());
Assertions.assertEquals(false, model.maskSensitive());
Assertions.assertEquals("wby", model.resourceGroupName());
Assertions.assertEquals("k", model.namePattern());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ public final class ExportResourceTests {
@org.junit.jupiter.api.Test
public void testDeserialize() throws Exception {
ExportResource model = BinaryData.fromString(
"{\"type\":\"ExportResource\",\"resourceIds\":[\"bj\"],\"resourceName\":\"a\",\"resourceType\":\"th\",\"namePattern\":\"hab\",\"targetProvider\":\"azapi\",\"fullProperties\":true,\"maskSensitive\":false}")
"{\"type\":\"ExportResource\",\"resourceIds\":[\"s\"],\"resourceName\":\"ithxqhabifpi\",\"resourceType\":\"wczbys\",\"namePattern\":\"pqxu\",\"targetProvider\":\"azurerm\",\"fullProperties\":true,\"maskSensitive\":true}")
.toObject(ExportResource.class);
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
Assertions.assertEquals(true, model.fullProperties());
Assertions.assertEquals(false, model.maskSensitive());
Assertions.assertEquals("bj", model.resourceIds().get(0));
Assertions.assertEquals("a", model.resourceName());
Assertions.assertEquals("th", model.resourceType());
Assertions.assertEquals("hab", model.namePattern());
Assertions.assertEquals(true, model.maskSensitive());
Assertions.assertEquals("s", model.resourceIds().get(0));
Assertions.assertEquals("ithxqhabifpi", model.resourceName());
Assertions.assertEquals("wczbys", model.resourceType());
Assertions.assertEquals("pqxu", model.namePattern());
}

@org.junit.jupiter.api.Test
public void testSerialize() throws Exception {
ExportResource model = new ExportResource().withTargetProvider(TargetProvider.AZAPI)
ExportResource model = new ExportResource().withTargetProvider(TargetProvider.AZURERM)
.withFullProperties(true)
.withMaskSensitive(false)
.withResourceIds(Arrays.asList("bj"))
.withResourceName("a")
.withResourceType("th")
.withNamePattern("hab");
.withMaskSensitive(true)
.withResourceIds(Arrays.asList("s"))
.withResourceName("ithxqhabifpi")
.withResourceType("wczbys")
.withNamePattern("pqxu");
model = BinaryData.fromObject(model).toObject(ExportResource.class);
Assertions.assertEquals(TargetProvider.AZAPI, model.targetProvider());
Assertions.assertEquals(TargetProvider.AZURERM, model.targetProvider());
Assertions.assertEquals(true, model.fullProperties());
Assertions.assertEquals(false, model.maskSensitive());
Assertions.assertEquals("bj", model.resourceIds().get(0));
Assertions.assertEquals("a", model.resourceName());
Assertions.assertEquals("th", model.resourceType());
Assertions.assertEquals("hab", model.namePattern());
Assertions.assertEquals(true, model.maskSensitive());
Assertions.assertEquals("s", model.resourceIds().get(0));
Assertions.assertEquals("ithxqhabifpi", model.resourceName());
Assertions.assertEquals("wczbys", model.resourceType());
Assertions.assertEquals("pqxu", model.namePattern());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
import com.azure.resourcemanager.terraform.models.ActionType;
import org.junit.jupiter.api.Assertions;

public final class OperationInnerTests {
@org.junit.jupiter.api.Test
public void testDeserialize() throws Exception {
OperationInner model = BinaryData.fromString(
"{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}")
.toObject(OperationInner.class);
Assertions.assertEquals(ActionType.INTERNAL, model.actionType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.terraform.implementation.models.OperationListResult;
import com.azure.resourcemanager.terraform.models.ActionType;
import org.junit.jupiter.api.Assertions;

public final class OperationListResultTests {
Expand All @@ -15,7 +14,6 @@ public void testDeserialize() throws Exception {
OperationListResult model = BinaryData.fromString(
"{\"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\"}")
.toObject(OperationListResult.class);
Assertions.assertEquals(ActionType.INTERNAL, model.value().get(0).actionType());
Assertions.assertEquals("kfo", model.nextLink());
}
}
Loading