package com.vimeo.networking.model.iap;

import com.google.gson.annotations.SerializedName;
import com.vimeo.networking.model.Metadata;
import com.vimeo.stag.UseStag;
import com.vimeo.stag.UseStag.FieldOption;

import org.jetbrains.annotations.Nullable;

import java.io.Serializable;

/**
 * Represents a Product that can be purchased, such as a Vimeo subscription.
 *
 * Created by brentwatson on 10/30/17.
 */
@SuppressWarnings("unused")
@UseStag(FieldOption.SERIALIZED_NAME)
public class Product implements Serializable {

    private static final long serialVersionUID = 3597655131745491159L;

    @Nullable
    @SerializedName("product_id")
    private String mProductId;

    @Nullable
    @SerializedName("name")
    private String mName;

    @Nullable
    @SerializedName("description")
    private String mDescription;

    @Nullable
    @SerializedName("uri")
    private String mUri;

    @Nullable
    @SerializedName("metadata")
    private Metadata mMetadata;

    /**
     * Equals and hashCode use {@link #mProductId} to check for equality.
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) { return true; }
        if (!(o instanceof Product)) { return false; }

        Product product = (Product) o;
        return mProductId != null ? mProductId.equals(product.mProductId) : product.mProductId == null;
    }

    @Override
    public int hashCode() {
        return mProductId != null ? mProductId.hashCode() : 0;
    }

    /**
     * @return ID for the product (aka product SKU).  This is a unique value for the product.
     */
    @Nullable
    public String getProductId() {
        return mProductId;
    }

    void setProductId(@Nullable String productId) {
        mProductId = productId;
    }

    /**
     * @return Product name.
     */
    @Nullable
    public String getName() {
        return mName;
    }

    void setName(@Nullable String name) {
        mName = name;
    }

    /**
     * @return Product description.
     */
    @Nullable
    public String getDescription() {
        return mDescription;
    }

    void setDescription(@Nullable String description) {
        mDescription = description;
    }

    /**
     * @return relative URI that can be used to request product details.
     */
    @Nullable
    public String getUri() {
        return mUri;
    }

    void setUri(@Nullable String uri) {
        mUri = uri;
    }

    /**
     * @return {@link #mMetadata}.
     */
    @Nullable
    public Metadata getMetadata() {
        return mMetadata;
    }

    void setMetadata(@Nullable Metadata metadata) {
        mMetadata = metadata;
    }

    @Override
    public String toString() {
        return "Product{" +
               "mProductId='" + mProductId + '\'' +
               ", mName='" + mName + '\'' +
               ", mDescription='" + mDescription + '\'' +
               ", mUri='" + mUri + '\'' +
               ", mMetadata='" + mMetadata + '\'' +
               '}';
    }
}

@@ -361,17 +361,21 @@
 tion.%0A *
+ %3Cp%3E
 %0A
-
  * Creat
@@ -827,16 +827,104 @@
 ption;%0A%0A
+    @Nullable%0A    @SerializedName(%22billing_period%22)%0A    private String mBillingPeriod;%0A%0A
     @Nul
@@ -2264,32 +2264,230 @@
 ription;%0A    %7D%0A%0A
+    @Nullable%0A    public String getBillingPeriod() %7B%0A        return mBillingPeriod;%0A    %7D%0A%0A    void setBillingPeriod(@Nullable String billingPeriod) %7B%0A        mBillingPeriod = billingPeriod;%0A    %7D%0A%0A
     /**%0A     * @
@@ -3081,32 +3081,32 @@
  mName + '%5C'' +%0A
-
                %22
@@ -3139,32 +3139,95 @@
 iption + '%5C'' +%0A
+               %22, mBillingPeriod ='%22 + mBillingPeriod + '%5C'' +%0A
                %22

Add billing_period field to Product object