-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Case Management): add service to project (#13)
Co-authored-by: Chong Lee <[email protected]>
- Loading branch information
Showing
71 changed files
with
7,606 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<!-- >>> Replace this with the parent pom's artifactId --> | ||
<artifactId>platform-services</artifactId> | ||
<groupId>com.ibm.cloud</groupId> | ||
<version>99-SNAPSHOT</version> | ||
<relativePath>../..</relativePath> | ||
</parent> | ||
|
||
<!-- >>> Replace this with the service module's artifactId (e.g. "example-service") --> | ||
<artifactId>case-management</artifactId> | ||
|
||
<!-- >>> Replace this with a text description of this module (e.g. "Example Service") --> | ||
<name>Case Management APIs</name> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.ibm.cloud</groupId> | ||
<artifactId>sdk-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<!-- >>> Replace this with the "common" module's artifactId (e.g. my-services-common) --> | ||
<artifactId>platform-services-common</artifactId> | ||
<groupId>com.ibm.cloud</groupId> | ||
</dependency> | ||
<dependency> | ||
<!-- >>> Replace this with the "common" module's artifactId (e.g. my-services-common) --> | ||
<artifactId>platform-services-common</artifactId> | ||
<groupId>${project.groupId}</groupId> | ||
<type>test-jar</type> | ||
<classifier>tests</classifier> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okhttp3</groupId> | ||
<artifactId>mockwebserver</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.powermock</groupId> | ||
<artifactId>powermock-api-mockito2</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.powermock</groupId> | ||
<artifactId>powermock-module-testng</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
458 changes: 458 additions & 0 deletions
458
...ment/src/main/java/com/ibm/cloud/platform_services/case_management/v1/CaseManagement.java
Large diffs are not rendered by default.
Oops, something went wrong.
108 changes: 108 additions & 0 deletions
108
...src/main/java/com/ibm/cloud/platform_services/case_management/v1/model/AcceptPayload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2020. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.ibm.cloud.platform_services.case_management.v1.model; | ||
|
||
/** | ||
* Payload to accept the proposed resolution of the case. | ||
*/ | ||
public class AcceptPayload extends StatusPayload { | ||
|
||
/** | ||
* action to perform on the case. | ||
*/ | ||
public interface Action { | ||
/** resolve. */ | ||
String RESOLVE = "resolve"; | ||
/** unresolve. */ | ||
String UNRESOLVE = "unresolve"; | ||
/** accept. */ | ||
String ACCEPT = "accept"; | ||
} | ||
|
||
|
||
/** | ||
* Builder. | ||
*/ | ||
public static class Builder { | ||
private String action; | ||
private String comment; | ||
|
||
public Builder(StatusPayload acceptPayload) { | ||
this.action = acceptPayload.action; | ||
this.comment = acceptPayload.comment; | ||
} | ||
|
||
/** | ||
* Instantiates a new builder. | ||
*/ | ||
public Builder() { | ||
} | ||
|
||
/** | ||
* Instantiates a new builder with required properties. | ||
* | ||
* @param action the action | ||
*/ | ||
public Builder(String action) { | ||
this.action = action; | ||
} | ||
|
||
/** | ||
* Builds a AcceptPayload. | ||
* | ||
* @return the new AcceptPayload instance | ||
*/ | ||
public AcceptPayload build() { | ||
return new AcceptPayload(this); | ||
} | ||
|
||
/** | ||
* Set the action. | ||
* | ||
* @param action the action | ||
* @return the AcceptPayload builder | ||
*/ | ||
public Builder action(String action) { | ||
this.action = action; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set the comment. | ||
* | ||
* @param comment the comment | ||
* @return the AcceptPayload builder | ||
*/ | ||
public Builder comment(String comment) { | ||
this.comment = comment; | ||
return this; | ||
} | ||
} | ||
|
||
protected AcceptPayload(Builder builder) { | ||
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, | ||
"action cannot be null"); | ||
action = builder.action; | ||
comment = builder.comment; | ||
} | ||
|
||
/** | ||
* New builder. | ||
* | ||
* @return a AcceptPayload builder | ||
*/ | ||
public Builder newBuilder() { | ||
return new Builder(this); | ||
} | ||
} | ||
|
126 changes: 126 additions & 0 deletions
126
...main/java/com/ibm/cloud/platform_services/case_management/v1/model/AddCommentOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2020. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.ibm.cloud.platform_services.case_management.v1.model; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.GenericModel; | ||
|
||
/** | ||
* The addComment options. | ||
*/ | ||
public class AddCommentOptions extends GenericModel { | ||
|
||
protected String caseNumber; | ||
protected String comment; | ||
|
||
/** | ||
* Builder. | ||
*/ | ||
public static class Builder { | ||
private String caseNumber; | ||
private String comment; | ||
|
||
private Builder(AddCommentOptions addCommentOptions) { | ||
this.caseNumber = addCommentOptions.caseNumber; | ||
this.comment = addCommentOptions.comment; | ||
} | ||
|
||
/** | ||
* Instantiates a new builder. | ||
*/ | ||
public Builder() { | ||
} | ||
|
||
/** | ||
* Instantiates a new builder with required properties. | ||
* | ||
* @param caseNumber the caseNumber | ||
* @param comment the comment | ||
*/ | ||
public Builder(String caseNumber, String comment) { | ||
this.caseNumber = caseNumber; | ||
this.comment = comment; | ||
} | ||
|
||
/** | ||
* Builds a AddCommentOptions. | ||
* | ||
* @return the new AddCommentOptions instance | ||
*/ | ||
public AddCommentOptions build() { | ||
return new AddCommentOptions(this); | ||
} | ||
|
||
/** | ||
* Set the caseNumber. | ||
* | ||
* @param caseNumber the caseNumber | ||
* @return the AddCommentOptions builder | ||
*/ | ||
public Builder caseNumber(String caseNumber) { | ||
this.caseNumber = caseNumber; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set the comment. | ||
* | ||
* @param comment the comment | ||
* @return the AddCommentOptions builder | ||
*/ | ||
public Builder comment(String comment) { | ||
this.comment = comment; | ||
return this; | ||
} | ||
} | ||
|
||
protected AddCommentOptions(Builder builder) { | ||
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.caseNumber, | ||
"caseNumber cannot be empty"); | ||
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.comment, | ||
"comment cannot be null"); | ||
caseNumber = builder.caseNumber; | ||
comment = builder.comment; | ||
} | ||
|
||
/** | ||
* New builder. | ||
* | ||
* @return a AddCommentOptions builder | ||
*/ | ||
public Builder newBuilder() { | ||
return new Builder(this); | ||
} | ||
|
||
/** | ||
* Gets the caseNumber. | ||
* | ||
* Unique identifier of a case. | ||
* | ||
* @return the caseNumber | ||
*/ | ||
public String caseNumber() { | ||
return caseNumber; | ||
} | ||
|
||
/** | ||
* Gets the comment. | ||
* | ||
* Comment to add to the case. | ||
* | ||
* @return the comment | ||
*/ | ||
public String comment() { | ||
return comment; | ||
} | ||
} | ||
|
Oops, something went wrong.