All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.coveo.pushapiclient.BatchIdentity Maven / Gradle / Ivy

The newest version!
package com.coveo.pushapiclient;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

import java.util.List;

/**
 * See [Manage Batches of Security Identities](https://docs.coveo.com/en/55)
 */
public class BatchIdentity {

    private List members;
    private List mappings;
    private List deleted;

    public BatchIdentity(List members, List mappings, List deleted) {
        this.members = members;
        this.mappings = mappings;
        this.deleted = deleted;
    }

    public BatchIdentityRecord marshal() {
        return new BatchIdentityRecord(
                this.members.stream().map(s -> new Gson().toJsonTree(s).getAsJsonObject()).toArray(JsonObject[]::new),
                this.mappings.stream().map(s -> new Gson().toJsonTree(s).getAsJsonObject()).toArray(JsonObject[]::new),
                this.deleted.stream().map(s -> new Gson().toJsonTree(s).getAsJsonObject()).toArray(JsonObject[]::new)
        );
    }

    public List getMembers() {
        return members;
    }

    public List getMappings() {
        return mappings;
    }

    public List getDeleted() {
        return deleted;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy