public static Operation fromJson()

in extension-base/src/main/java/com/azure/autorest/extension/base/model/codemodel/Operation.java [459:509]


    public static Operation fromJson(JsonReader jsonReader) throws IOException {
        return JsonUtils.readObject(jsonReader, Operation::new, (operation, fieldName, reader) -> {
            if (operation.tryConsumeParentProperties(operation, fieldName, reader)) {
                return;
            }

            if ("operationId".equals(fieldName)) {
                operation.operationId = reader.getString();
            } else if ("parameters".equals(fieldName)) {
                operation.parameters = reader.readArray(Parameter::fromJson);
            } else if ("signatureParameters".equals(fieldName)) {
                operation.signatureParameters = reader.readArray(Parameter::fromJson);
            } else if ("requests".equals(fieldName)) {
                operation.requests = reader.readArray(Request::fromJson);
            } else if ("responses".equals(fieldName)) {
                operation.responses = reader.readArray(Response::fromJson);
            } else if ("exceptions".equals(fieldName)) {
                operation.exceptions = reader.readArray(Response::fromJson);
            } else if ("profile".equals(fieldName)) {
                operation.profile = DictionaryApiVersion.fromJson(reader);
            } else if ("$key".equals(fieldName)) {
                operation.$key = reader.getString();
            } else if ("description".equals(fieldName)) {
                operation.description = reader.getString();
            } else if ("uid".equals(fieldName)) {
                operation.uid = reader.getString();
            } else if ("summary".equals(fieldName)) {
                operation.summary = reader.getString();
            } else if ("apiVersions".equals(fieldName)) {
                operation.apiVersions = reader.readArray(ApiVersion::fromJson);
            } else if ("deprecated".equals(fieldName)) {
                operation.deprecated = Deprecation.fromJson(reader);
            } else if ("externalDocs".equals(fieldName)) {
                operation.externalDocs = ExternalDocumentation.fromJson(reader);
            } else if ("specialHeaders".equals(fieldName)) {
                operation.specialHeaders = reader.readArray(JsonReader::getString);
            } else if ("lroMetadata".equals(fieldName)) {
                operation.lroMetadata = LongRunningMetadata.fromJson(reader);
            } else if ("convenienceApi".equals(fieldName)) {
                operation.convenienceApi = ConvenienceApi.fromJson(reader);
            } else if ("generateProtocolApi".equals(fieldName)) {
                operation.generateProtocolApi = reader.getBoolean();
            } else if ("internalApi".equals(fieldName)) {
                operation.internalApi = reader.getBoolean();
            } else if ("crossLanguageDefinitionId".equals(fieldName)) {
                operation.crossLanguageDefinitionId = reader.getString();
            } else {
                reader.skipChildren();
            }
        });
    }