Skip to content

Commit

Permalink
Generated from 984c12a568b2dd36acb521eb3b1c00fbd5b42995 (#165)
Browse files Browse the repository at this point in the history
Update CognitiveService ComputerVision Swagger for new extensions (#1)

* Merged PR 17875: Add new languages

Add new languages

Also tidy up the enum definition so that AutoRest generates C# that actually compiles

* Merged PR 17942: Replace fancy quotes with plain single quotes

Make javac compile without complaint even without setting the codepage to utf-8 by dropping the gratuitous typographic quotes.

* Merged PR 17956: Rename url argument for overloaded endpoint to imageUrl

This name will become the name of the argument in Python.  Since you can used named arguments in Python, give them less ambiguous names.

* Changes to make --azure-validator run more cleanly

Errors Fixed
* XmsExamplesRequired/D5001/Documentation (7)
* XmsPathsMustOverloadPaths/R2058/SDKViolation (7)

Errors Ignored
* SecurityDefinitionsStructure/R2054/SDKViolation (1) - API Key scheme for Cognitive Services
* APIVersionPattern/R3012/ARMViolation (1) - Keeping with the Cognitive Services numbering scheme
* OperationsAPIImplementation/R3023/ARMViolation (1) - Not sure what this is

Warnings Fixed
* XmsEnumValidation/R2018/SDKViolation (1)
* DescriptionAndTitleMissing/R4000/SDKViolation (1)

Warnings Ignored
* DescriptionAndTitleMissing/R4000/SDKViolation (35) - description is contained in #ref
* EnumInsteadOfBoolean/R3018/ARMViolation (5) - fix would be a breaking change
* ListInOperationName/R1003/SDKViolation (1) - fix would be a breaking change
* LongRunningOperationsWithLongRunningExtension/R2007/SDKViolation (2) - endpoint will not ultimately yield a 200, as this extension would require
* NonApplicationJsonType/R2004/ARMViolation (15) - fix would be breaking change
* PageableOperation/R2029/SDKViolation (1) - not actually pageable
* ParameterNotDefinedInGlobalParameters/R2015/SDKViolation (1) - All our own parameters specify x-ms-parameter-location
* PostOperationIdContainsUrlVerb/R2066/SDKViolation (7) - fix would be breaking change
  • Loading branch information
AutorestCI authored May 23, 2018
1 parent e9b6d3f commit f09e779
Show file tree
Hide file tree
Showing 42 changed files with 5,825 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.vision.computervision;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* An object describing whether the image contains adult-oriented content
* and/or is racy.
*/
public class AdultInfo {
/**
* A value indicating if the image contains adult-oriented content.
*/
@JsonProperty(value = "isAdultContent")
private boolean isAdultContent;

/**
* A value indicating if the image is race.
*/
@JsonProperty(value = "isRacyContent")
private boolean isRacyContent;

/**
* Score from 0 to 1 that indicates how much of adult content is within the
* image.
*/
@JsonProperty(value = "adultScore")
private double adultScore;

/**
* Score from 0 to 1 that indicates how suggestive is the image.
*/
@JsonProperty(value = "racyScore")
private double racyScore;

/**
* Get the isAdultContent value.
*
* @return the isAdultContent value
*/
public boolean isAdultContent() {
return this.isAdultContent;
}

/**
* Set the isAdultContent value.
*
* @param isAdultContent the isAdultContent value to set
* @return the AdultInfo object itself.
*/
public AdultInfo withIsAdultContent(boolean isAdultContent) {
this.isAdultContent = isAdultContent;
return this;
}

/**
* Get the isRacyContent value.
*
* @return the isRacyContent value
*/
public boolean isRacyContent() {
return this.isRacyContent;
}

/**
* Set the isRacyContent value.
*
* @param isRacyContent the isRacyContent value to set
* @return the AdultInfo object itself.
*/
public AdultInfo withIsRacyContent(boolean isRacyContent) {
this.isRacyContent = isRacyContent;
return this;
}

/**
* Get the adultScore value.
*
* @return the adultScore value
*/
public double adultScore() {
return this.adultScore;
}

/**
* Set the adultScore value.
*
* @param adultScore the adultScore value to set
* @return the AdultInfo object itself.
*/
public AdultInfo withAdultScore(double adultScore) {
this.adultScore = adultScore;
return this;
}

/**
* Get the racyScore value.
*
* @return the racyScore value
*/
public double racyScore() {
return this.racyScore;
}

/**
* Set the racyScore value.
*
* @param racyScore the racyScore value to set
* @return the AdultInfo object itself.
*/
public AdultInfo withRacyScore(double racyScore) {
this.racyScore = racyScore;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.vision.computervision;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for AzureRegions.
*/
public enum AzureRegions {
/** Enum value westus. */
WESTUS("westus"),

/** Enum value westeurope. */
WESTEUROPE("westeurope"),

/** Enum value southeastasia. */
SOUTHEASTASIA("southeastasia"),

/** Enum value eastus2. */
EASTUS2("eastus2"),

/** Enum value westcentralus. */
WESTCENTRALUS("westcentralus"),

/** Enum value westus2. */
WESTUS2("westus2"),

/** Enum value eastus. */
EASTUS("eastus"),

/** Enum value southcentralus. */
SOUTHCENTRALUS("southcentralus"),

/** Enum value northeurope. */
NORTHEUROPE("northeurope"),

/** Enum value eastasia. */
EASTASIA("eastasia"),

/** Enum value australiaeast. */
AUSTRALIAEAST("australiaeast"),

/** Enum value brazilsouth. */
BRAZILSOUTH("brazilsouth");

/** The actual serialized value for a AzureRegions instance. */
private String value;

AzureRegions(String value) {
this.value = value;
}

/**
* Parses a serialized value to a AzureRegions instance.
*
* @param value the serialized value to parse.
* @return the parsed AzureRegions object, or null if unable to parse.
*/
@JsonCreator
public static AzureRegions fromString(String value) {
AzureRegions[] items = AzureRegions.values();
for (AzureRegions item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.vision.computervision;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* An object describing identified category.
*/
public class Category {
/**
* Name of the category.
*/
@JsonProperty(value = "name")
private String name;

/**
* Scoring of the category.
*/
@JsonProperty(value = "score")
private Double score;

/**
* The detail property.
*/
@JsonProperty(value = "detail")
private CategoryDetail detail;

/**
* Get the name value.
*
* @return the name value
*/
public String name() {
return this.name;
}

/**
* Set the name value.
*
* @param name the name value to set
* @return the Category object itself.
*/
public Category withName(String name) {
this.name = name;
return this;
}

/**
* Get the score value.
*
* @return the score value
*/
public Double score() {
return this.score;
}

/**
* Set the score value.
*
* @param score the score value to set
* @return the Category object itself.
*/
public Category withScore(Double score) {
this.score = score;
return this;
}

/**
* Get the detail value.
*
* @return the detail value
*/
public CategoryDetail detail() {
return this.detail;
}

/**
* Set the detail value.
*
* @param detail the detail value to set
* @return the Category object itself.
*/
public Category withDetail(CategoryDetail detail) {
this.detail = detail;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.vision.computervision;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* An object describing additional category details.
*/
public class CategoryDetail {
/**
* An array of celebrities if any identified.
*/
@JsonProperty(value = "celebrities")
private List<CelebritiesModel> celebrities;

/**
* Get the celebrities value.
*
* @return the celebrities value
*/
public List<CelebritiesModel> celebrities() {
return this.celebrities;
}

/**
* Set the celebrities value.
*
* @param celebrities the celebrities value to set
* @return the CategoryDetail object itself.
*/
public CategoryDetail withCelebrities(List<CelebritiesModel> celebrities) {
this.celebrities = celebrities;
return this;
}

}
Loading

0 comments on commit f09e779

Please sign in to comment.