/** * Creates a new label. * * Create a request for the method "labels.create". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Create#execute()} method to invoke the remote operation. <p> {@link * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param content the {@link com.google.api.services.gmail.model.Label} * @since 1.13 */ protected Create(java.lang.String userId, com.google.api.services.gmail.model.Label content) { super(Gmail.this, "POST", REST_PATH, content, com.google.api.services.gmail.model.Label.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getLabelListVisibility(), "Label.getLabelListVisibility()"); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getMessageListVisibility(), "Label.getMessageListVisibility()"); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getName(), "Label.getName()"); }
/** * Updates the specified label. * * Create a request for the method "labels.update". * * This request holds the parameters needed by the the gmail server. After setting any optional * parameters, call the {@link Update#execute()} method to invoke the remote operation. <p> {@link * Update#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor. </p> * * @param userId The user's email address. The special value me can be used to indicate the authenticated user. * [default: me] * @param id The ID of the label to update. * @param content the {@link com.google.api.services.gmail.model.Label} * @since 1.13 */ protected Update(java.lang.String userId, java.lang.String id, com.google.api.services.gmail.model.Label content) { super(Gmail.this, "PUT", REST_PATH, content, com.google.api.services.gmail.model.Label.class); this.userId = com.google.api.client.util.Preconditions.checkNotNull(userId, "Required parameter userId must be specified."); this.id = com.google.api.client.util.Preconditions.checkNotNull(id, "Required parameter id must be specified."); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getId(), "Label.getId()"); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getLabelListVisibility(), "Label.getLabelListVisibility()"); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getMessageListVisibility(), "Label.getMessageListVisibility()"); checkRequiredParameter(content, "content"); checkRequiredParameter(content.getName(), "Label.getName()"); }