-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
251 additions
and
1 deletion.
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
119 changes: 119 additions & 0 deletions
119
delivery-sdk/src/main/java/kontent/ai/delivery/AssetRendition.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,119 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2019 | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package kontent.ai.delivery; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Object model for asset rendition | ||
*/ | ||
@lombok.Data | ||
@lombok.NoArgsConstructor | ||
@lombok.AllArgsConstructor | ||
@lombok.Builder | ||
public class AssetRendition { | ||
|
||
@JsonProperty("rendition_id") | ||
String renditionId; | ||
|
||
@JsonProperty("preset_id") | ||
String presetId; | ||
|
||
@JsonProperty("width") | ||
String width; | ||
|
||
@JsonProperty("height") | ||
String height; | ||
|
||
@JsonProperty("query") | ||
String query; | ||
|
||
/** | ||
* Asset rendition ID | ||
* | ||
* @return rendition ID | ||
*/ | ||
public String getRenditionId() { | ||
return renditionId; | ||
} | ||
|
||
void setRenditionId(String renditionId) { | ||
this.renditionId = renditionId; | ||
} | ||
|
||
/** | ||
* Asset rendition preset ID | ||
* | ||
* @return rendition preset ID | ||
*/ | ||
public String getPresetId() { | ||
return presetId; | ||
} | ||
|
||
void setPresetId(String presetId) { | ||
this.presetId = presetId; | ||
} | ||
|
||
/** | ||
* Width of the asset rendition | ||
* | ||
* @return Width of the asset rendition | ||
*/ | ||
|
||
public String getWidth() { | ||
return width; | ||
} | ||
|
||
public void setWidth(String width) { | ||
this.width = width; | ||
} | ||
|
||
/** | ||
* Height of the asset rendition | ||
* | ||
* @return Height of the asset rendition | ||
*/ | ||
|
||
public String getHeight() { | ||
return height; | ||
} | ||
|
||
public void setHeight(String height) { | ||
this.height = height; | ||
} | ||
|
||
/** | ||
* Asset rendition query | ||
* | ||
* @return rendition query | ||
*/ | ||
public String getQuery() { | ||
return query; | ||
} | ||
|
||
void setQuery(String query) { | ||
this.query = query; | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...very-sdk/src/test/resources/kontent/ai/delivery/SampleAssetElementWithEmptyRendition.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"type": "asset", | ||
"name": "Teaser image", | ||
"value": [ | ||
{ | ||
"name": "coffee-beverages-explained-1080px.jpg", | ||
"type": "image/jpeg", | ||
"size": "90895", | ||
"description": null, | ||
"url": "https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/e700596b-03b0-4cee-ac5c-9212762c027a/coffee-beverages-explained-1080px.jpg", | ||
"width": "1600", | ||
"height": "800", | ||
"renditions": {} | ||
} | ||
], | ||
"testing_unknown_field_does_not_break_jackson": true | ||
} |
25 changes: 25 additions & 0 deletions
25
delivery-sdk/src/test/resources/kontent/ai/delivery/SampleAssetElementWithRendition.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"type": "asset", | ||
"name": "Teaser image", | ||
"value": [ | ||
{ | ||
"name": "coffee-beverages-explained-1080px.jpg", | ||
"type": "image/jpeg", | ||
"size": "90895", | ||
"description": null, | ||
"url": "https://assets-us-01.kc-usercontent.com:443/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/e700596b-03b0-4cee-ac5c-9212762c027a/coffee-beverages-explained-1080px.jpg", | ||
"width": "1600", | ||
"height": "800", | ||
"renditions": { | ||
"default": { | ||
"rendition_id": "dc448f45-161e-4268-8155-b9d9e33497c8", | ||
"preset_id": "a6d98cd5-8b2c-4e50-99c9-15192bce2490", | ||
"width": 640, | ||
"height": 480, | ||
"query": "w=640&h=480&fit=clip&rect=146,425,788,590" | ||
} | ||
} | ||
} | ||
], | ||
"testing_unknown_field_does_not_break_jackson": true | ||
} |