urbanairship-core/src/main/java/com/urbanairship/automation/ActionScheduleEdits.java
public static ActionScheduleEdits fromJson(@NonNull JsonValue value) throws JsonException {
        JsonMap jsonMap = value.optMap();

        Builder builder = newBuilder();

        if (jsonMap.containsKey(ActionScheduleInfo.ACTIONS_KEY)) {
            builder.setActions(jsonMap.opt(ActionScheduleInfo.ACTIONS_KEY).optMap().getMap());
        }

        if (jsonMap.containsKey(ActionScheduleInfo.LIMIT_KEY)) {
            builder.setLimit(jsonMap.opt(ActionScheduleInfo.LIMIT_KEY).getInt(1));
        }

        if (jsonMap.containsKey(ActionScheduleInfo.PRIORITY_KEY)) {
            builder.setPriority(jsonMap.opt(ActionScheduleInfo.PRIORITY_KEY).getInt(0));
        }

        if (jsonMap.containsKey(ActionScheduleInfo.END_KEY)) {
            try {
                builder.setEnd(DateUtils.parseIso8601(jsonMap.opt(ActionScheduleInfo.END_KEY).getString()));
            } catch (ParseException e) {
                throw new JsonException("Invalid schedule end time", e);
            }
        }

        if (jsonMap.containsKey(ActionScheduleInfo.START_KEY)) {
            try {
                builder.setStart(DateUtils.parseIso8601(jsonMap.opt(ActionScheduleInfo.START_KEY).getString()));
            } catch (ParseException e) {
                throw new JsonException("Invalid schedule start time", e);
            }
        }

        if (jsonMap.containsKey(ActionScheduleInfo.EDIT_GRACE_PERIOD)) {
            builder.setEditGracePeriod(jsonMap.opt(ActionScheduleInfo.EDIT_GRACE_PERIOD).getLong(0), TimeUnit.DAYS);
        }

        if (jsonMap.containsKey(ActionScheduleInfo.INTERVAL)) {
            builder.setInterval(jsonMap.opt(ActionScheduleInfo.INTERVAL).getLong(0), TimeUnit.SECONDS);
        }

        return builder.build();
    }
/**
     * Parses a json value for an in-app message edits.
     *
     * @param value The json value.
     * @return The edit info.
     * @throws JsonException If the json is invalid.
     */
Parses a json value for an in-app message edits.
@param value The json value.
@return The edit info.
@throws JsonException If the json is invalid.
Parses a json value for an in - app message edits . @param value The json value . @return The edit info . @throws JsonException If the json is invalid .
public static ActionScheduleEdits fromJson(@NonNull JsonValue value) throws JsonException {
        JsonMap jsonMap = value.optMap();
        Builder builder = newBuilder();
        if (jsonMap.containsKey(ActionScheduleInfo.ACTIONS_KEY)) {
            builder.setActions(jsonMap.opt(ActionScheduleInfo.ACTIONS_KEY).optMap().getMap());
        }
        if (jsonMap.containsKey(ActionScheduleInfo.LIMIT_KEY)) {
            builder.setLimit(jsonMap.opt(ActionScheduleInfo.LIMIT_KEY).getInt(1));
        }
        if (jsonMap.containsKey(ActionScheduleInfo.PRIORITY_KEY)) {
            builder.setPriority(jsonMap.opt(ActionScheduleInfo.PRIORITY_KEY).getInt(0));
        }
        if (jsonMap.containsKey(ActionScheduleInfo.END_KEY)) {
            try {
                builder.setEnd(DateUtils.parseIso8601(jsonMap.opt(ActionScheduleInfo.END_KEY).getString()));
            } catch (ParseException e) {
                throw new JsonException("Invalid schedule end time", e);
            }
        }
        if (jsonMap.containsKey(ActionScheduleInfo.START_KEY)) {
            try {
                builder.setStart(DateUtils.parseIso8601(jsonMap.opt(ActionScheduleInfo.START_KEY).getString()));
            } catch (ParseException e) {
                throw new JsonException("Invalid schedule start time", e);
            }
        }
        if (jsonMap.containsKey(ActionScheduleInfo.EDIT_GRACE_PERIOD)) {
            builder.setEditGracePeriod(jsonMap.opt(ActionScheduleInfo.EDIT_GRACE_PERIOD).getLong(0), TimeUnit.DAYS);
        }
        if (jsonMap.containsKey(ActionScheduleInfo.INTERVAL)) {
            builder.setInterval(jsonMap.opt(ActionScheduleInfo.INTERVAL).getLong(0), TimeUnit.SECONDS);
        }
        return builder.build();
    }
public static ActionScheduleEdits fromJson ( @ NonNull JsonValue value ) throws JsonException { JsonMap jsonMap = value . optMap ( ) ; Builder builder = newBuilder ( ) ; if ( jsonMap . containsKey ( ActionScheduleInfo . ACTIONS_KEY ) ) { builder . setActions ( jsonMap . opt ( ActionScheduleInfo . ACTIONS_KEY ) . optMap ( ) . getMap ( ) ) ; } if ( jsonMap . containsKey ( ActionScheduleInfo . LIMIT_KEY ) ) { builder . setLimit ( jsonMap . opt ( ActionScheduleInfo . LIMIT_KEY ) . getInt ( 1 ) ) ; } if ( jsonMap . containsKey ( ActionScheduleInfo . PRIORITY_KEY ) ) { builder . setPriority ( jsonMap . opt ( ActionScheduleInfo . PRIORITY_KEY ) . getInt ( 0 ) ) ; } if ( jsonMap . containsKey ( ActionScheduleInfo . END_KEY ) ) { try { builder . setEnd ( DateUtils . parseIso8601 ( jsonMap . opt ( ActionScheduleInfo . END_KEY ) . getString ( ) ) ) ; } catch ( ParseException e ) { throw new JsonException ( "Invalid schedule end time" , e ) ; } } if ( jsonMap . containsKey ( ActionScheduleInfo . START_KEY ) ) { try { builder . setStart ( DateUtils . parseIso8601 ( jsonMap . opt ( ActionScheduleInfo . START_KEY ) . getString ( ) ) ) ; } catch ( ParseException e ) { throw new JsonException ( "Invalid schedule start time" , e ) ; } } if ( jsonMap . containsKey ( ActionScheduleInfo . EDIT_GRACE_PERIOD ) ) { builder . setEditGracePeriod ( jsonMap . opt ( ActionScheduleInfo . EDIT_GRACE_PERIOD ) . getLong ( 0 ) , TimeUnit . DAYS ) ; } if ( jsonMap . containsKey ( ActionScheduleInfo . INTERVAL ) ) { builder . setInterval ( jsonMap . opt ( ActionScheduleInfo . INTERVAL ) . getLong ( 0 ) , TimeUnit . SECONDS ) ; } return builder . build ( ) ; }
Parses a json value for an in-app message edits.
Parses a json value for an in - app message edits .