Skip to content

Commit

Permalink
CodeGen from PR 30768 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge f857628ff2d7bfaaefb117ed52ddcd5f082fdad0 into 139840784c38414085b3d799cee5545f9b6e8dec
  • Loading branch information
SDKAuto committed Sep 27, 2024
1 parent 4688042 commit ed39075
Show file tree
Hide file tree
Showing 85 changed files with 8,680 additions and 3,281 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import com.azure.core.client.traits.EndpointTrait;
import com.azure.core.client.traits.HttpTrait;
import com.azure.core.client.traits.KeyCredentialTrait;
import com.azure.core.client.traits.TokenCredentialTrait;
import com.azure.core.credential.KeyCredential;
import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpPipeline;
Expand All @@ -18,6 +20,7 @@
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.AddHeadersPolicy;
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpPipelinePolicy;
Expand All @@ -43,8 +46,8 @@
* A builder for creating a new instance of the RadiologyInsightsClient type.
*/
@ServiceClientBuilder(serviceClients = { RadiologyInsightsClient.class, RadiologyInsightsAsyncClient.class })
public final class RadiologyInsightsClientBuilder
implements HttpTrait<RadiologyInsightsClientBuilder>, ConfigurationTrait<RadiologyInsightsClientBuilder>,
public final class RadiologyInsightsClientBuilder implements HttpTrait<RadiologyInsightsClientBuilder>,
ConfigurationTrait<RadiologyInsightsClientBuilder>, TokenCredentialTrait<RadiologyInsightsClientBuilder>,
KeyCredentialTrait<RadiologyInsightsClientBuilder>, EndpointTrait<RadiologyInsightsClientBuilder> {

@Generated
Expand Down Expand Up @@ -288,6 +291,9 @@ private HttpPipeline createHttpPipeline() {
if (keyCredential != null) {
policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential));
}
if (tokenCredential != null) {
policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
}
this.pipelinePolicies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.forEach(p -> policies.add(p));
Expand Down Expand Up @@ -328,4 +334,23 @@ private void validateClient() {
// Developer can customize this method, to validate that the necessary conditions are met for the new client.
Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
}

@Generated
private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" };

/*
* The TokenCredential used for authentication.
*/
@Generated
private TokenCredential tokenCredential;

/**
* {@inheritDoc}.
*/
@Generated
@Override
public RadiologyInsightsClientBuilder credential(TokenCredential tokenCredential) {
this.tokenCredential = tokenCredential;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
*/
public enum RadiologyInsightsServiceVersion implements ServiceVersion {
/**
* Enum value 2023-09-01-preview.
* Enum value 2024-04-01.
*/
V2023_09_01_PREVIEW("2023-09-01-preview");
V2024_04_01("2024-04-01");

private final String version;

Expand All @@ -35,6 +35,6 @@ public String getVersion() {
* @return The latest {@link RadiologyInsightsServiceVersion}.
*/
public static RadiologyInsightsServiceVersion getLatest() {
return V2023_09_01_PREVIEW;
return V2024_04_01;
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
* A notification for age mismatch is displayed when the age mentioned in a document for a specific patient does not
* match the age specified in the patient information.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AgeMismatchInference.class, visible = true)
@JsonTypeName("ageMismatch")
@Immutable
public final class AgeMismatchInference extends RadiologyInsightsInference {

/*
* Discriminator property for RadiologyInsightsInference.
*/
@Generated
@JsonTypeId
@JsonProperty(value = "kind")
private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.AGE_MISMATCH;

/**
Expand All @@ -44,4 +41,62 @@ private AgeMismatchInference() {
public RadiologyInsightsInferenceType getKind() {
return this.kind;
}

/*
* Additional Content defined by implementations
*/
@Generated
private List<FhirR4Extension> extension;

/**
* Get the extension property: Additional Content defined by implementations.
*
* @return the extension value.
*/
@Generated
@Override
public List<FhirR4Extension> getExtension() {
return this.extension;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AgeMismatchInference from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AgeMismatchInference if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IOException If an error occurs while reading the AgeMismatchInference.
*/
@Generated
public static AgeMismatchInference fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AgeMismatchInference deserializedAgeMismatchInference = new AgeMismatchInference();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("extension".equals(fieldName)) {
List<FhirR4Extension> extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1));
deserializedAgeMismatchInference.extension = extension;
} else if ("kind".equals(fieldName)) {
deserializedAgeMismatchInference.kind
= RadiologyInsightsInferenceType.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedAgeMismatchInference;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/**
Expand Down Expand Up @@ -78,7 +77,6 @@ public ClinicalDocumentType() {
* @return the corresponding ClinicalDocumentType.
*/
@Generated
@JsonCreator
public static ClinicalDocumentType fromString(String name) {
return fromString(name, ClinicalDocumentType.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,41 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
* A complete order discrepancy is shown when one or more body parts and/or measurements that should be in the document
* (because there is a complete order) are not present.
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
property = "kind",
defaultImpl = CompleteOrderDiscrepancyInference.class,
visible = true)
@JsonTypeName("completeOrderDiscrepancy")
@Immutable
public final class CompleteOrderDiscrepancyInference extends RadiologyInsightsInference {

/*
* Discriminator property for RadiologyInsightsInference.
*/
@Generated
@JsonTypeId
@JsonProperty(value = "kind")
private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY;

/*
* Order type : CPT ultrasound complete code for abdomen, retroperitoneal, pelvis or breast.
*/
@Generated
@JsonProperty(value = "orderType")
private final FhirR4CodeableConcept orderType;

/*
* List of missing body parts required by a complete order : SNOMED CT codes.
*/
@Generated
@JsonProperty(value = "missingBodyParts")
private List<FhirR4CodeableConcept> missingBodyParts;

/*
* List of missing body parts that require measurement by a complete order : SNOMED CT codes.
*/
@Generated
@JsonProperty(value = "missingBodyPartMeasurements")
private List<FhirR4CodeableConcept> missingBodyPartMeasurements;

/**
Expand All @@ -60,8 +48,7 @@ public final class CompleteOrderDiscrepancyInference extends RadiologyInsightsIn
* @param orderType the orderType value to set.
*/
@Generated
@JsonCreator
private CompleteOrderDiscrepancyInference(@JsonProperty(value = "orderType") FhirR4CodeableConcept orderType) {
private CompleteOrderDiscrepancyInference(FhirR4CodeableConcept orderType) {
this.orderType = orderType;
}

Expand Down Expand Up @@ -107,4 +94,82 @@ public List<FhirR4CodeableConcept> getMissingBodyParts() {
public List<FhirR4CodeableConcept> getMissingBodyPartMeasurements() {
return this.missingBodyPartMeasurements;
}

/*
* Additional Content defined by implementations
*/
@Generated
private List<FhirR4Extension> extension;

/**
* Get the extension property: Additional Content defined by implementations.
*
* @return the extension value.
*/
@Generated
@Override
public List<FhirR4Extension> getExtension() {
return this.extension;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element));
jsonWriter.writeJsonField("orderType", this.orderType);
jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
jsonWriter.writeArrayField("missingBodyParts", this.missingBodyParts,
(writer, element) -> writer.writeJson(element));
jsonWriter.writeArrayField("missingBodyPartMeasurements", this.missingBodyPartMeasurements,
(writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of CompleteOrderDiscrepancyInference from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CompleteOrderDiscrepancyInference 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 CompleteOrderDiscrepancyInference.
*/
@Generated
public static CompleteOrderDiscrepancyInference fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
List<FhirR4Extension> extension = null;
FhirR4CodeableConcept orderType = null;
RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY;
List<FhirR4CodeableConcept> missingBodyParts = null;
List<FhirR4CodeableConcept> missingBodyPartMeasurements = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("extension".equals(fieldName)) {
extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1));
} else if ("orderType".equals(fieldName)) {
orderType = FhirR4CodeableConcept.fromJson(reader);
} else if ("kind".equals(fieldName)) {
kind = RadiologyInsightsInferenceType.fromString(reader.getString());
} else if ("missingBodyParts".equals(fieldName)) {
missingBodyParts = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1));
} else if ("missingBodyPartMeasurements".equals(fieldName)) {
missingBodyPartMeasurements = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1));
} else {
reader.skipChildren();
}
}
CompleteOrderDiscrepancyInference deserializedCompleteOrderDiscrepancyInference
= new CompleteOrderDiscrepancyInference(orderType);
deserializedCompleteOrderDiscrepancyInference.extension = extension;
deserializedCompleteOrderDiscrepancyInference.kind = kind;
deserializedCompleteOrderDiscrepancyInference.missingBodyParts = missingBodyParts;
deserializedCompleteOrderDiscrepancyInference.missingBodyPartMeasurements = missingBodyPartMeasurements;
return deserializedCompleteOrderDiscrepancyInference;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/**
Expand Down Expand Up @@ -73,7 +72,6 @@ public ContactPointSystem() {
* @return the corresponding ContactPointSystem.
*/
@Generated
@JsonCreator
public static ContactPointSystem fromString(String name) {
return fromString(name, ContactPointSystem.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/**
Expand Down Expand Up @@ -61,7 +60,6 @@ public ContactPointUse() {
* @return the corresponding ContactPointUse.
*/
@Generated
@JsonCreator
public static ContactPointUse fromString(String name) {
return fromString(name, ContactPointUse.class);
}
Expand Down
Loading

0 comments on commit ed39075

Please sign in to comment.