/*
 * Copyright 2014 Uwe Trottmann
 *
 * 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.
 */

package com.battlelancer.seriesguide.billing.amazon;

/**
 * Contains all In App Purchase products definition.
 */
public enum AmazonSku {

    SERIESGUIDE_SUB("seriesguide-sub");

    private final String sku;

    public String getSku() {
        return this.sku;
    }

    private AmazonSku(final String sku) {
        this.sku = sku;
    }

    public static AmazonSku fromSku(final String sku) {
        if (SERIESGUIDE_SUB.getSku().equals(sku)) {
            return SERIESGUIDE_SUB;
        }
        return null;
    }

}

/*
 * Copyright 2014 Uwe Trottmann
 *
 * 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.
 */

package com.battlelancer.seriesguide.billing.amazon;

/**
 * Contains all Amazon in-app purchase products definitions.
 */
public enum AmazonSku {

    /**
     * The yearly subscription with a trial month. Unlocks access to everything.
     */
    SERIESGUIDE_SUB("seriesguide-sub"),
    /**
     * The one-time purchase. Unlocks access to everything.
     */
    SERIESGUIDE_PASS("x-pass-2014-10");

    private final String sku;

    public String getSku() {
        return this.sku;
    }

    AmazonSku(final String sku) {
        this.sku = sku;
    }

    public static AmazonSku fromSku(final String sku) {
        if (SERIESGUIDE_SUB.getSku().equals(sku)) {
            return SERIESGUIDE_SUB;
        }
        if (SERIESGUIDE_PASS.getSku().equals(sku)) {
            return SERIESGUIDE_PASS;
        }
        return null;
    }

}

Add pass Amazon SKU.