package com.ss.android.ugc.aweme.openshare;

import X.OLT;
import android.os.Bundle;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.openshare.entity.DYBaseRequest;
import com.ss.android.ugc.aweme.openshare.entity.DYBaseResp;
import com.ss.android.ugc.aweme.openshare.entity.DYMediaContent;
import java.util.ArrayList;

public final class Share {
    static {
        Covode.recordClassIndex(96542);
    }

    public static class Response extends DYBaseResp {
        public String state;
        public int subErrorCode;

        static {
            Covode.recordClassIndex(96544);
        }

        public int getType() {
            return 4;
        }

        public Response() {
        }

        public Response(Bundle bundle) {
            fromBundle(bundle);
        }

        public void fromBundle(Bundle bundle) {
            super.fromBundle(bundle);
            this.state = bundle.getString("_aweme_open_sdk_params_state");
            this.subErrorCode = bundle.getInt("_aweme_open_sdk_params_sub_error_code");
        }

        public void toBundle(Bundle bundle) {
            super.toBundle(bundle);
            bundle.putString("_aweme_open_sdk_params_state", this.state);
            bundle.putInt("_aweme_open_sdk_params_sub_error_code", this.subErrorCode);
        }
    }

    public static class Request extends DYBaseRequest {
        public ArrayList<String> mHashTagList = new ArrayList<>();
        public DYMediaContent mMediaContent;
        public int mTargetSceneType;

        static {
            Covode.recordClassIndex(96543);
        }

        public int getType() {
            return 3;
        }

        public Request() {
        }

        public boolean checkArgs() {
            DYMediaContent dYMediaContent = this.mMediaContent;
            if (dYMediaContent == null) {
                return false;
            }
            return dYMediaContent.checkArgs();
        }

        public Request(Bundle bundle) {
            fromBundle(bundle);
        }

        public void fromBundle(Bundle bundle) {
            super.fromBundle(bundle);
            this.mTargetSceneType = bundle.getInt("_aweme_open_sdk_params_target_landpage_scene", 0);
            this.mHashTagList = bundle.getStringArrayList("_aweme_open_sdk_params_hashtag_list");
            this.mMediaContent = OLT.LIZ(bundle);
        }

        public void toBundle(Bundle bundle) {
            super.toBundle(bundle);
            DYMediaContent dYMediaContent = this.mMediaContent;
            Bundle bundle2 = new Bundle();
            if (dYMediaContent.mMediaObject != null) {
                bundle2.putString("_dyobject_identifier_", dYMediaContent.mMediaObject.getClass().getName());
                dYMediaContent.mMediaObject.serialize(bundle2);
            }
            bundle.putAll(bundle2);
            bundle.putInt("_aweme_open_sdk_params_target_landpage_scene", this.mTargetSceneType);
            bundle.putStringArrayList("_aweme_open_sdk_params_hashtag_list", this.mHashTagList);
        }
    }
}
