/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.contentwarehouse.v1.model;

/**
 * Link metadata, for LINK segments. Anchor text should be stored in the "text" field of the
 * Segment, which can also serve as a fallback.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Document AI Warehouse API. For a detailed explanation
 * see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class SocialCommonLinkData extends com.google.api.client.json.GenericJson {

  /**
   * An Attachment represents the structured entity to which we are linking. It contains an Embed
   * (apps/tacotown/proto/embeds/embed_client.proto) with fields specific to the appropriate type of
   * linked entity. For example, if we are linking to a photo album, the Embed may include the album
   * ID and gaia ID of the creator. Clients that understand the Embed type within the Attachment may
   * construct and/or decorate their link appropriately e.g. to make use of type-specific
   * functionality or first-party integrations. The link_target and (if appropriate) display_url
   * fields must still be set even when an Attachment is present, so that clients who do not know
   * how to interpret the Attachment can fall back to those fields, and render the Segment as an
   * ordinary web link. N.B. Even when an Attachment is present, the intention of a "LINK" Segment
   * is for the Segment to be presented inline with the rest of the text of a post or comment, with
   * a clickable link or other UI suitable for inlining (though the client may modify the UI based
   * on Attachment data, e.g. to add appropriate hovers, icons, etc.). When an entity is intended to
   * be rendered separately from the main body of the post/comment, a separate Attachment proto can
   * be added outside the set of Segments. N.B. Within the Attachment, fields of EmbedClientItem
   * have their own visibility annotations, which should be enforced separately from Segment
   * visibility annotations. See: apps/tacotown/proto/embeds/embed_annotations.proto
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private SocialCommonAttachmentAttachment attachment;

  /**
   * The hint to use when rendering the associated attachment. Ignored if there is no associated
   * attachment.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String attachmentRenderHint;

  /**
   * If we wish to show the user a different (e.g. shortened) version of the URL for display
   * purposes, then that version should be set here. If this field isn't set, link_target will be
   * used for both purposes.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayUrl;

  /**
   * link_target is the URL to navigate to when clicked. This could be the original URL, or a URL
   * signed by the GWS URL signing service.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String linkTarget;

  /**
   * LinkType is an optional field that provides additional information regarding link target. For
   * example, link type can be identified as the SELF_LINK when the request was executed from the
   * same link as the link target.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String linkType;

  /**
   * Title is an optional field that provides a short string that describes the link or its
   * destination. User interfaces often use title as a tooltip or for accessibility purposes.
   * However, they are of course free to present this data in any form. This field is plain text.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String title;

  /**
   * An Attachment represents the structured entity to which we are linking. It contains an Embed
   * (apps/tacotown/proto/embeds/embed_client.proto) with fields specific to the appropriate type of
   * linked entity. For example, if we are linking to a photo album, the Embed may include the album
   * ID and gaia ID of the creator. Clients that understand the Embed type within the Attachment may
   * construct and/or decorate their link appropriately e.g. to make use of type-specific
   * functionality or first-party integrations. The link_target and (if appropriate) display_url
   * fields must still be set even when an Attachment is present, so that clients who do not know
   * how to interpret the Attachment can fall back to those fields, and render the Segment as an
   * ordinary web link. N.B. Even when an Attachment is present, the intention of a "LINK" Segment
   * is for the Segment to be presented inline with the rest of the text of a post or comment, with
   * a clickable link or other UI suitable for inlining (though the client may modify the UI based
   * on Attachment data, e.g. to add appropriate hovers, icons, etc.). When an entity is intended to
   * be rendered separately from the main body of the post/comment, a separate Attachment proto can
   * be added outside the set of Segments. N.B. Within the Attachment, fields of EmbedClientItem
   * have their own visibility annotations, which should be enforced separately from Segment
   * visibility annotations. See: apps/tacotown/proto/embeds/embed_annotations.proto
   * @return value or {@code null} for none
   */
  public SocialCommonAttachmentAttachment getAttachment() {
    return attachment;
  }

  /**
   * An Attachment represents the structured entity to which we are linking. It contains an Embed
   * (apps/tacotown/proto/embeds/embed_client.proto) with fields specific to the appropriate type of
   * linked entity. For example, if we are linking to a photo album, the Embed may include the album
   * ID and gaia ID of the creator. Clients that understand the Embed type within the Attachment may
   * construct and/or decorate their link appropriately e.g. to make use of type-specific
   * functionality or first-party integrations. The link_target and (if appropriate) display_url
   * fields must still be set even when an Attachment is present, so that clients who do not know
   * how to interpret the Attachment can fall back to those fields, and render the Segment as an
   * ordinary web link. N.B. Even when an Attachment is present, the intention of a "LINK" Segment
   * is for the Segment to be presented inline with the rest of the text of a post or comment, with
   * a clickable link or other UI suitable for inlining (though the client may modify the UI based
   * on Attachment data, e.g. to add appropriate hovers, icons, etc.). When an entity is intended to
   * be rendered separately from the main body of the post/comment, a separate Attachment proto can
   * be added outside the set of Segments. N.B. Within the Attachment, fields of EmbedClientItem
   * have their own visibility annotations, which should be enforced separately from Segment
   * visibility annotations. See: apps/tacotown/proto/embeds/embed_annotations.proto
   * @param attachment attachment or {@code null} for none
   */
  public SocialCommonLinkData setAttachment(SocialCommonAttachmentAttachment attachment) {
    this.attachment = attachment;
    return this;
  }

  /**
   * The hint to use when rendering the associated attachment. Ignored if there is no associated
   * attachment.
   * @return value or {@code null} for none
   */
  public java.lang.String getAttachmentRenderHint() {
    return attachmentRenderHint;
  }

  /**
   * The hint to use when rendering the associated attachment. Ignored if there is no associated
   * attachment.
   * @param attachmentRenderHint attachmentRenderHint or {@code null} for none
   */
  public SocialCommonLinkData setAttachmentRenderHint(java.lang.String attachmentRenderHint) {
    this.attachmentRenderHint = attachmentRenderHint;
    return this;
  }

  /**
   * If we wish to show the user a different (e.g. shortened) version of the URL for display
   * purposes, then that version should be set here. If this field isn't set, link_target will be
   * used for both purposes.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayUrl() {
    return displayUrl;
  }

  /**
   * If we wish to show the user a different (e.g. shortened) version of the URL for display
   * purposes, then that version should be set here. If this field isn't set, link_target will be
   * used for both purposes.
   * @param displayUrl displayUrl or {@code null} for none
   */
  public SocialCommonLinkData setDisplayUrl(java.lang.String displayUrl) {
    this.displayUrl = displayUrl;
    return this;
  }

  /**
   * link_target is the URL to navigate to when clicked. This could be the original URL, or a URL
   * signed by the GWS URL signing service.
   * @return value or {@code null} for none
   */
  public java.lang.String getLinkTarget() {
    return linkTarget;
  }

  /**
   * link_target is the URL to navigate to when clicked. This could be the original URL, or a URL
   * signed by the GWS URL signing service.
   * @param linkTarget linkTarget or {@code null} for none
   */
  public SocialCommonLinkData setLinkTarget(java.lang.String linkTarget) {
    this.linkTarget = linkTarget;
    return this;
  }

  /**
   * LinkType is an optional field that provides additional information regarding link target. For
   * example, link type can be identified as the SELF_LINK when the request was executed from the
   * same link as the link target.
   * @return value or {@code null} for none
   */
  public java.lang.String getLinkType() {
    return linkType;
  }

  /**
   * LinkType is an optional field that provides additional information regarding link target. For
   * example, link type can be identified as the SELF_LINK when the request was executed from the
   * same link as the link target.
   * @param linkType linkType or {@code null} for none
   */
  public SocialCommonLinkData setLinkType(java.lang.String linkType) {
    this.linkType = linkType;
    return this;
  }

  /**
   * Title is an optional field that provides a short string that describes the link or its
   * destination. User interfaces often use title as a tooltip or for accessibility purposes.
   * However, they are of course free to present this data in any form. This field is plain text.
   * @return value or {@code null} for none
   */
  public java.lang.String getTitle() {
    return title;
  }

  /**
   * Title is an optional field that provides a short string that describes the link or its
   * destination. User interfaces often use title as a tooltip or for accessibility purposes.
   * However, they are of course free to present this data in any form. This field is plain text.
   * @param title title or {@code null} for none
   */
  public SocialCommonLinkData setTitle(java.lang.String title) {
    this.title = title;
    return this;
  }

  @Override
  public SocialCommonLinkData set(String fieldName, Object value) {
    return (SocialCommonLinkData) super.set(fieldName, value);
  }

  @Override
  public SocialCommonLinkData clone() {
    return (SocialCommonLinkData) super.clone();
  }

}
