All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twitter.clientlib.model.ReplySettings Maven / Gradle / Ivy

/*
Copyright 2020 Twitter, Inc.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
https://openapi-generator.tech
Do not edit the class manually.
*/


package com.twitter.clientlib.model;

import java.util.Objects;
import java.util.Arrays;
import io.swagger.annotations.ApiModel;
import com.google.gson.annotations.SerializedName;

import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

/**
 * Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following.
 */
@JsonAdapter(ReplySettings.Adapter.class)
public enum ReplySettings {
  
  EVERYONE("everyone"),
  
  MENTIONEDUSERS("mentionedUsers"),
  
  FOLLOWING("following"),
  
  OTHER("other");

  private String value;

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

  public String getValue() {
    return value;
  }

  @Override
  public String toString() {
    return String.valueOf(value);
  }

  public static ReplySettings fromValue(String value) {
    for (ReplySettings b : ReplySettings.values()) {
      if (b.value.equals(value)) {
        return b;
      }
    }
    throw new IllegalArgumentException("Unexpected value '" + value + "'");
  }

  public static class Adapter extends TypeAdapter {
    @Override
    public void write(final JsonWriter jsonWriter, final ReplySettings enumeration) throws IOException {
      jsonWriter.value(enumeration.getValue());
    }

    @Override
    public ReplySettings read(final JsonReader jsonReader) throws IOException {
      String value = jsonReader.nextString();
      return ReplySettings.fromValue(value);
    }
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy