Skip to content

Commit

Permalink
CodeGen from PR 19888 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge e15fd771942bff65c8cff1c728d55a374b1db0c8 into 9d67b48d784fb4a47ebe8819a437d5e4d388c9f2
  • Loading branch information
SDKAuto committed Jul 21, 2022
1 parent 92b7424 commit f4833ca
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 8 deletions.
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.1 (2022-07-21)

- Azure Resource Manager AzureTrafficCollector client library for Java. This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-05-01. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-networkfunction</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public final class CollectorPoliciesCreateOrUpdateSamples {
manager
.collectorPolicies()
.define("cp1")
.withRegion("West US")
.withExistingAzureTrafficCollector("rg1", "atc")
.withIngestionPolicy(
new IngestionPolicyPropertiesFormat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
package com.azure.resourcemanager.networkfunction.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.networkfunction.models.EmissionPoliciesPropertiesFormat;
import com.azure.resourcemanager.networkfunction.models.IngestionPolicyPropertiesFormat;
import com.azure.resourcemanager.networkfunction.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Collector policy resource. */
@Fluent
public final class CollectorPolicyInner extends ProxyResource {
public final class CollectorPolicyInner extends Resource {
/*
* Properties of the Collector Policy.
*/
Expand Down Expand Up @@ -61,6 +62,20 @@ public SystemData systemData() {
return this.systemData;
}

/** {@inheritDoc} */
@Override
public CollectorPolicyInner withLocation(String location) {
super.withLocation(location);
return this;
}

/** {@inheritDoc} */
@Override
public CollectorPolicyInner withTags(Map<String, String> tags) {
super.withTags(tags);
return this;
}

/**
* Get the ingestionPolicy property: Ingestion policies.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package com.azure.resourcemanager.networkfunction.implementation;

import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
Expand All @@ -13,6 +14,7 @@
import com.azure.resourcemanager.networkfunction.models.ProvisioningState;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public final class CollectorPolicyImpl implements CollectorPolicy, CollectorPolicy.Definition, CollectorPolicy.Update {
private CollectorPolicyInner innerObject;
Expand All @@ -31,6 +33,19 @@ public String type() {
return this.innerModel().type();
}

public String location() {
return this.innerModel().location();
}

public Map<String, String> tags() {
Map<String, String> inner = this.innerModel().tags();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}

public String etag() {
return this.innerModel().etag();
}
Expand All @@ -56,6 +71,14 @@ public ProvisioningState provisioningState() {
return this.innerModel().provisioningState();
}

public Region region() {
return Region.fromName(this.regionName());
}

public String regionName() {
return this.location();
}

public String resourceGroupName() {
return resourceGroupName;
}
Expand Down Expand Up @@ -162,6 +185,21 @@ public CollectorPolicy refresh(Context context) {
return this;
}

public CollectorPolicyImpl withRegion(Region location) {
this.innerModel().withLocation(location.toString());
return this;
}

public CollectorPolicyImpl withRegion(String location) {
this.innerModel().withLocation(location);
return this;
}

public CollectorPolicyImpl withTags(Map<String, String> tags) {
this.innerModel().withTags(tags);
return this;
}

public CollectorPolicyImpl withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy) {
this.innerModel().withIngestionPolicy(ingestionPolicy);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

package com.azure.resourcemanager.networkfunction.models;

import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
import java.util.List;
import java.util.Map;

/** An immutable client-side representation of CollectorPolicy. */
public interface CollectorPolicy {
Expand All @@ -32,6 +34,20 @@ public interface CollectorPolicy {
*/
String type();

/**
* Gets the location property: The geo-location where the resource lives.
*
* @return the location value.
*/
String location();

/**
* Gets the tags property: Resource tags.
*
* @return the tags value.
*/
Map<String, String> tags();

/**
* Gets the etag property: A unique read-only string that changes whenever the resource is updated.
*
Expand Down Expand Up @@ -67,6 +83,20 @@ public interface CollectorPolicy {
*/
ProvisioningState provisioningState();

/**
* Gets the region of the resource.
*
* @return the region of the resource.
*/
Region region();

/**
* Gets the name of the resource region.
*
* @return the name of the resource region.
*/
String regionName();

/**
* Gets the name of the resource group.
*
Expand All @@ -83,12 +113,33 @@ public interface CollectorPolicy {

/** The entirety of the CollectorPolicy definition. */
interface Definition
extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
extends DefinitionStages.Blank,
DefinitionStages.WithLocation,
DefinitionStages.WithParentResource,
DefinitionStages.WithCreate {
}
/** The CollectorPolicy definition stages. */
interface DefinitionStages {
/** The first stage of the CollectorPolicy definition. */
interface Blank extends WithParentResource {
interface Blank extends WithLocation {
}
/** The stage of the CollectorPolicy definition allowing to specify location. */
interface WithLocation {
/**
* Specifies the region for the resource.
*
* @param location The geo-location where the resource lives.
* @return the next definition stage.
*/
WithParentResource withRegion(Region location);

/**
* Specifies the region for the resource.
*
* @param location The geo-location where the resource lives.
* @return the next definition stage.
*/
WithParentResource withRegion(String location);
}
/** The stage of the CollectorPolicy definition allowing to specify parent resource. */
interface WithParentResource {
Expand All @@ -105,7 +156,10 @@ interface WithParentResource {
* The stage of the CollectorPolicy definition which contains all the minimum required properties for the
* resource to be created, but also allows for any other optional properties to be specified.
*/
interface WithCreate extends DefinitionStages.WithIngestionPolicy, DefinitionStages.WithEmissionPolicies {
interface WithCreate
extends DefinitionStages.WithTags,
DefinitionStages.WithIngestionPolicy,
DefinitionStages.WithEmissionPolicies {
/**
* Executes the create request.
*
Expand All @@ -121,6 +175,16 @@ interface WithCreate extends DefinitionStages.WithIngestionPolicy, DefinitionSta
*/
CollectorPolicy create(Context context);
}
/** The stage of the CollectorPolicy definition allowing to specify tags. */
interface WithTags {
/**
* Specifies the tags property: Resource tags..
*
* @param tags Resource tags.
* @return the next definition stage.
*/
WithCreate withTags(Map<String, String> tags);
}
/** The stage of the CollectorPolicy definition allowing to specify ingestionPolicy. */
interface WithIngestionPolicy {
/**
Expand Down Expand Up @@ -150,7 +214,8 @@ interface WithEmissionPolicies {
CollectorPolicy.Update update();

/** The template for CollectorPolicy update. */
interface Update extends UpdateStages.WithIngestionPolicy, UpdateStages.WithEmissionPolicies {
interface Update
extends UpdateStages.WithTags, UpdateStages.WithIngestionPolicy, UpdateStages.WithEmissionPolicies {
/**
* Executes the update request.
*
Expand All @@ -168,6 +233,16 @@ interface Update extends UpdateStages.WithIngestionPolicy, UpdateStages.WithEmis
}
/** The CollectorPolicy update stages. */
interface UpdateStages {
/** The stage of the CollectorPolicy update allowing to specify tags. */
interface WithTags {
/**
* Specifies the tags property: Resource tags..
*
* @param tags Resource tags.
* @return the next definition stage.
*/
Update withTags(Map<String, String> tags);
}
/** The stage of the CollectorPolicy update allowing to specify ingestionPolicy. */
interface WithIngestionPolicy {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static void createACollectionPolicy(
manager
.collectorPolicies()
.define("cp1")
.withRegion("West US")
.withExistingAzureTrafficCollector("rg1", "atc")
.withIngestionPolicy(
new IngestionPolicyPropertiesFormat()
Expand Down

0 comments on commit f4833ca

Please sign in to comment.