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

com.huaweicloud.sdk.osm.v2.model.CreateRelationsReq Maven / Gradle / Ivy

There is a newer version: 3.1.114
Show newest version
package com.huaweicloud.sdk.osm.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * CreateRelationsReq
 */
public class CreateRelationsReq {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "related_id_list")

    private List relatedIdList = null;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "group_id")

    private String groupId;

    public CreateRelationsReq withRelatedIdList(List relatedIdList) {
        this.relatedIdList = relatedIdList;
        return this;
    }

    public CreateRelationsReq addRelatedIdListItem(String relatedIdListItem) {
        if (this.relatedIdList == null) {
            this.relatedIdList = new ArrayList<>();
        }
        this.relatedIdList.add(relatedIdListItem);
        return this;
    }

    public CreateRelationsReq withRelatedIdList(Consumer> relatedIdListSetter) {
        if (this.relatedIdList == null) {
            this.relatedIdList = new ArrayList<>();
        }
        relatedIdListSetter.accept(this.relatedIdList);
        return this;
    }

    /**
     * 要关联的工单id列表,最多3个
     * @return relatedIdList
     */
    public List getRelatedIdList() {
        return relatedIdList;
    }

    public void setRelatedIdList(List relatedIdList) {
        this.relatedIdList = relatedIdList;
    }

    public CreateRelationsReq withGroupId(String groupId) {
        this.groupId = groupId;
        return this;
    }

    /**
     * 组id
     * @return groupId
     */
    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        CreateRelationsReq that = (CreateRelationsReq) obj;
        return Objects.equals(this.relatedIdList, that.relatedIdList) && Objects.equals(this.groupId, that.groupId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(relatedIdList, groupId);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CreateRelationsReq {\n");
        sb.append("    relatedIdList: ").append(toIndentedString(relatedIdList)).append("\n");
        sb.append("    groupId: ").append(toIndentedString(groupId)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy