forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 13
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 29330 in Azure/azure-rest-api-specs
Merge 8d22b7e5cc45dcad545f00a1115d396758f69d0a into c1d839d48ee936c9338431c38f2cbbfbc9879ea2
- Loading branch information
SDKAuto
committed
Aug 7, 2024
1 parent
b250c11
commit 40d0c79
Showing
87 changed files
with
2,531 additions
and
210 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
sdk/mongocluster/azure-resourcemanager-mongocluster/CHANGELOG.md
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
229 changes: 211 additions & 18 deletions
229
sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md
Large diffs are not rendered by default.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
...gocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.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,43 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.mongocluster.fluent; | ||
|
||
import com.azure.core.annotation.ReturnType; | ||
import com.azure.core.annotation.ServiceMethod; | ||
import com.azure.core.http.rest.PagedIterable; | ||
import com.azure.core.util.Context; | ||
import com.azure.resourcemanager.mongocluster.fluent.models.ReplicaInner; | ||
|
||
/** | ||
* An instance of this class provides access to all the operations defined in ReplicasClient. | ||
*/ | ||
public interface ReplicasClient { | ||
/** | ||
* List all the replicas for the mongo cluster. | ||
* | ||
* @param resourceGroupName The name of the resource group. The name is case insensitive. | ||
* @param mongoClusterName The name of the mongo cluster. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation. | ||
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. | ||
* @return the response of a Replica list operation as paginated response with {@link PagedIterable}. | ||
*/ | ||
@ServiceMethod(returns = ReturnType.COLLECTION) | ||
PagedIterable<ReplicaInner> listByParent(String resourceGroupName, String mongoClusterName); | ||
|
||
/** | ||
* List all the replicas for the mongo cluster. | ||
* | ||
* @param resourceGroupName The name of the resource group. The name is case insensitive. | ||
* @param mongoClusterName The name of the mongo cluster. | ||
* @param context The context to associate with this operation. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation. | ||
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. | ||
* @return the response of a Replica list operation as paginated response with {@link PagedIterable}. | ||
*/ | ||
@ServiceMethod(returns = ReturnType.COLLECTION) | ||
PagedIterable<ReplicaInner> listByParent(String resourceGroupName, String mongoClusterName, Context context); | ||
} |
155 changes: 155 additions & 0 deletions
155
...ster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.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,155 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package com.azure.resourcemanager.mongocluster.fluent.models; | ||
|
||
import com.azure.core.annotation.Immutable; | ||
import com.azure.core.management.ProxyResource; | ||
import com.azure.core.management.SystemData; | ||
import com.azure.json.JsonReader; | ||
import com.azure.json.JsonToken; | ||
import com.azure.json.JsonWriter; | ||
import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Represents a mongo cluster replica. | ||
*/ | ||
@Immutable | ||
public final class ReplicaInner extends ProxyResource { | ||
/* | ||
* The resource-specific properties for this resource. | ||
*/ | ||
private MongoClusterProperties properties; | ||
|
||
/* | ||
* Azure Resource Manager metadata containing createdBy and modifiedBy information. | ||
*/ | ||
private SystemData systemData; | ||
|
||
/* | ||
* Fully qualified resource Id for the resource. | ||
*/ | ||
private String id; | ||
|
||
/* | ||
* The name of the resource. | ||
*/ | ||
private String name; | ||
|
||
/* | ||
* The type of the resource. | ||
*/ | ||
private String type; | ||
|
||
/** | ||
* Creates an instance of ReplicaInner class. | ||
*/ | ||
private ReplicaInner() { | ||
} | ||
|
||
/** | ||
* Get the properties property: The resource-specific properties for this resource. | ||
* | ||
* @return the properties value. | ||
*/ | ||
public MongoClusterProperties properties() { | ||
return this.properties; | ||
} | ||
|
||
/** | ||
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. | ||
* | ||
* @return the systemData value. | ||
*/ | ||
public SystemData systemData() { | ||
return this.systemData; | ||
} | ||
|
||
/** | ||
* Get the id property: Fully qualified resource Id for the resource. | ||
* | ||
* @return the id value. | ||
*/ | ||
@Override | ||
public String id() { | ||
return this.id; | ||
} | ||
|
||
/** | ||
* Get the name property: The name of the resource. | ||
* | ||
* @return the name value. | ||
*/ | ||
@Override | ||
public String name() { | ||
return this.name; | ||
} | ||
|
||
/** | ||
* Get the type property: The type of the resource. | ||
* | ||
* @return the type value. | ||
*/ | ||
@Override | ||
public String type() { | ||
return this.type; | ||
} | ||
|
||
/** | ||
* Validates the instance. | ||
* | ||
* @throws IllegalArgumentException thrown if the instance is not valid. | ||
*/ | ||
public void validate() { | ||
if (properties() != null) { | ||
properties().validate(); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
jsonWriter.writeStartObject(); | ||
jsonWriter.writeJsonField("properties", this.properties); | ||
return jsonWriter.writeEndObject(); | ||
} | ||
|
||
/** | ||
* Reads an instance of ReplicaInner from the JsonReader. | ||
* | ||
* @param jsonReader The JsonReader being read. | ||
* @return An instance of ReplicaInner if the JsonReader was pointing to an instance of it, or null if it was | ||
* pointing to JSON null. | ||
* @throws IllegalStateException If the deserialized JSON object was missing any required properties. | ||
* @throws IOException If an error occurs while reading the ReplicaInner. | ||
*/ | ||
public static ReplicaInner fromJson(JsonReader jsonReader) throws IOException { | ||
return jsonReader.readObject(reader -> { | ||
ReplicaInner deserializedReplicaInner = new ReplicaInner(); | ||
while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
String fieldName = reader.getFieldName(); | ||
reader.nextToken(); | ||
|
||
if ("id".equals(fieldName)) { | ||
deserializedReplicaInner.id = reader.getString(); | ||
} else if ("name".equals(fieldName)) { | ||
deserializedReplicaInner.name = reader.getString(); | ||
} else if ("type".equals(fieldName)) { | ||
deserializedReplicaInner.type = reader.getString(); | ||
} else if ("properties".equals(fieldName)) { | ||
deserializedReplicaInner.properties = MongoClusterProperties.fromJson(reader); | ||
} else if ("systemData".equals(fieldName)) { | ||
deserializedReplicaInner.systemData = SystemData.fromJson(reader); | ||
} else { | ||
reader.skipChildren(); | ||
} | ||
} | ||
|
||
return deserializedReplicaInner; | ||
}); | ||
} | ||
} |
Oops, something went wrong.