-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: DynamicEndpoint for Video API
- Loading branch information
Showing
7 changed files
with
1,294 additions
and
185 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
src/main/java/com/vonage/client/video/MuteSessionResponse.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,80 @@ | ||
/* | ||
* Copyright 2023 Vonage | ||
* | ||
* 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.vonage.client.video; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.vonage.client.Jsonable; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class MuteSessionResponse implements Jsonable { | ||
private String applicationId, name; | ||
private ProjectStatus status; | ||
private ProjectEnvironment environment; | ||
private Long createdAt; | ||
|
||
protected MuteSessionResponse() { | ||
} | ||
|
||
/** | ||
* | ||
* @return The Vonage application ID. | ||
*/ | ||
public String getApplicationId() { | ||
return applicationId; | ||
} | ||
|
||
/** | ||
* | ||
* @return Whether the project is active or suspended. | ||
*/ | ||
public ProjectStatus getStatus() { | ||
return status; | ||
} | ||
|
||
/** | ||
* | ||
* @return The project name, if specified when created. | ||
*/ | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
/** | ||
* | ||
* @return The environment the project is running on. | ||
*/ | ||
public ProjectEnvironment getEnvironment() { | ||
return environment; | ||
} | ||
|
||
/** | ||
* | ||
* @return The time at which the project was created (a UNIX timestamp, in milliseconds). | ||
*/ | ||
public Long getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
/** | ||
* Creates an instance of this class from a JSON payload. | ||
* | ||
* @param json The JSON string to parse. | ||
* @return An instance of this class with the fields populated, if present. | ||
*/ | ||
public static MuteSessionResponse fromJson(String json) { | ||
return Jsonable.fromJson(json, MuteSessionResponse.class); | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
src/main/java/com/vonage/client/video/VideoResponseException.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,45 @@ | ||
/* | ||
* Copyright 2023 Vonage | ||
* | ||
* 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.vonage.client.video; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.vonage.client.Jsonable; | ||
import com.vonage.client.VonageApiResponseException; | ||
|
||
/** | ||
* Response returned when an error is encountered (i.e. the API returns a non-2xx status code). | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public final class VideoResponseException extends VonageApiResponseException { | ||
|
||
void setStatusCode(int statusCode) { | ||
this.statusCode = statusCode; | ||
} | ||
|
||
/** | ||
* Creates an instance of this class from a JSON payload. | ||
* | ||
* @param json The JSON string to parse. | ||
* @return An instance of this class with all known fields populated from the JSON payload, if present. | ||
*/ | ||
@JsonCreator | ||
public static VideoResponseException fromJson(String json) { | ||
return Jsonable.fromJson(json); | ||
} | ||
} |
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
Oops, something went wrong.