|
| 1 | +/* |
| 2 | + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 3 | + * This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 4 | + * Copyright 2019-Present Datadog, Inc. |
| 5 | + */ |
| 6 | + |
| 7 | +package com.datadog.api.client.v1.model; |
| 8 | + |
| 9 | +import com.datadog.api.client.ModelEnum; |
| 10 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 11 | +import com.fasterxml.jackson.core.JsonGenerator; |
| 12 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 13 | +import com.fasterxml.jackson.databind.SerializerProvider; |
| 14 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| 15 | +import com.fasterxml.jackson.databind.ser.std.StdSerializer; |
| 16 | +import java.io.IOException; |
| 17 | +import java.util.Arrays; |
| 18 | +import java.util.HashSet; |
| 19 | +import java.util.Set; |
| 20 | + |
| 21 | +/** Property of the Synthetic Test Response to extract into a local variable. */ |
| 22 | +@JsonSerialize( |
| 23 | + using = |
| 24 | + SyntheticsLocalVariableParsingOptionsType |
| 25 | + .SyntheticsLocalVariableParsingOptionsTypeSerializer.class) |
| 26 | +public class SyntheticsLocalVariableParsingOptionsType extends ModelEnum<String> { |
| 27 | + |
| 28 | + private static final Set<String> allowedValues = |
| 29 | + new HashSet<String>( |
| 30 | + Arrays.asList( |
| 31 | + "grpc_message", "grpc_metadata", "http_body", "http_header", "http_status_code")); |
| 32 | + |
| 33 | + public static final SyntheticsLocalVariableParsingOptionsType GRPC_MESSAGE = |
| 34 | + new SyntheticsLocalVariableParsingOptionsType("grpc_message"); |
| 35 | + public static final SyntheticsLocalVariableParsingOptionsType GRPC_METADATA = |
| 36 | + new SyntheticsLocalVariableParsingOptionsType("grpc_metadata"); |
| 37 | + public static final SyntheticsLocalVariableParsingOptionsType HTTP_BODY = |
| 38 | + new SyntheticsLocalVariableParsingOptionsType("http_body"); |
| 39 | + public static final SyntheticsLocalVariableParsingOptionsType HTTP_HEADER = |
| 40 | + new SyntheticsLocalVariableParsingOptionsType("http_header"); |
| 41 | + public static final SyntheticsLocalVariableParsingOptionsType HTTP_STATUS_CODE = |
| 42 | + new SyntheticsLocalVariableParsingOptionsType("http_status_code"); |
| 43 | + |
| 44 | + SyntheticsLocalVariableParsingOptionsType(String value) { |
| 45 | + super(value, allowedValues); |
| 46 | + } |
| 47 | + |
| 48 | + public static class SyntheticsLocalVariableParsingOptionsTypeSerializer |
| 49 | + extends StdSerializer<SyntheticsLocalVariableParsingOptionsType> { |
| 50 | + public SyntheticsLocalVariableParsingOptionsTypeSerializer( |
| 51 | + Class<SyntheticsLocalVariableParsingOptionsType> t) { |
| 52 | + super(t); |
| 53 | + } |
| 54 | + |
| 55 | + public SyntheticsLocalVariableParsingOptionsTypeSerializer() { |
| 56 | + this(null); |
| 57 | + } |
| 58 | + |
| 59 | + @Override |
| 60 | + public void serialize( |
| 61 | + SyntheticsLocalVariableParsingOptionsType value, |
| 62 | + JsonGenerator jgen, |
| 63 | + SerializerProvider provider) |
| 64 | + throws IOException, JsonProcessingException { |
| 65 | + jgen.writeObject(value.value); |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + @JsonCreator |
| 70 | + public static SyntheticsLocalVariableParsingOptionsType fromValue(String value) { |
| 71 | + return new SyntheticsLocalVariableParsingOptionsType(value); |
| 72 | + } |
| 73 | +} |
0 commit comments