Skip to content

Commit 3dcecf1

Browse files
committed
Signed-off-by: C0D3 M4513R <[email protected]>
1 parent 851d987 commit 3dcecf1

File tree

12 files changed

+367
-2
lines changed

12 files changed

+367
-2
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ docs/ApiConfigReportReasons.md
2323
docs/ApiHealth.md
2424
docs/AuthenticationApi.md
2525
docs/Avatar.md
26+
docs/AvatarStyles.md
2627
docs/AvatarUnityPackageUrlObject.md
2728
docs/AvatarsApi.md
2829
docs/Badge.md
@@ -220,6 +221,7 @@ src/models/api_config_report_categories.rs
220221
src/models/api_config_report_reasons.rs
221222
src/models/api_health.rs
222223
src/models/avatar.rs
224+
src/models/avatar_styles.rs
223225
src/models/avatar_unity_package_url_object.rs
224226
src/models/badge.rs
225227
src/models/ban_group_member_request.rs

docs/Avatar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**image_url** | **String** | |
1616
**name** | **String** | |
1717
**release_status** | [**models::ReleaseStatus**](ReleaseStatus.md) | |
18+
**styles** | [**models::AvatarStyles**](Avatar_styles.md) | |
1819
**tags** | **Vec<String>** | |
1920
**thumbnail_image_url** | **String** | |
2021
**unity_package_url** | **String** | |

docs/AvatarStyles.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# AvatarStyles
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**primary** | Option<**String**> | | [optional]
8+
**secondary** | Option<**String**> | | [optional]
9+
**supplementary** | Option<**Vec<String>**> | | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

docs/File.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**animation_style** | Option<**String**> | | [optional]
8+
**mask_tag** | Option<**String**> | | [optional]
79
**extension** | **String** | |
810
**id** | **String** | |
911
**mime_type** | [**models::MimeType**](MIMEType.md) | |

docs/FilesApi.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Method | HTTP request | Description
1414
[**get_file_data_upload_status**](FilesApi.md#get_file_data_upload_status) | **GET** /file/{fileId}/{versionId}/{fileType}/status | Check FileData Upload Status
1515
[**get_files**](FilesApi.md#get_files) | **GET** /files | List Files
1616
[**start_file_data_upload**](FilesApi.md#start_file_data_upload) | **PUT** /file/{fileId}/{versionId}/{fileType}/start | Start FileData Upload
17+
[**upload_gallery_image**](FilesApi.md#upload_gallery_image) | **POST** /gallery | Upload gallery image
18+
[**upload_icon**](FilesApi.md#upload_icon) | **POST** /icon | Upload icon
19+
[**upload_image**](FilesApi.md#upload_image) | **POST** /file/image | Upload gallery image, icon, emoji or sticker
1720

1821

1922

@@ -330,3 +333,96 @@ Name | Type | Description | Required | Notes
330333

331334
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
332335

336+
337+
## upload_gallery_image
338+
339+
> models::File upload_gallery_image(file)
340+
Upload gallery image
341+
342+
Upload a gallery image
343+
344+
### Parameters
345+
346+
347+
Name | Type | Description | Required | Notes
348+
------------- | ------------- | ------------- | ------------- | -------------
349+
**file** | **std::path::PathBuf** | The binary blob of the png file. | [required] |
350+
351+
### Return type
352+
353+
[**models::File**](File.md)
354+
355+
### Authorization
356+
357+
[authCookie](../README.md#authCookie)
358+
359+
### HTTP request headers
360+
361+
- **Content-Type**: multipart/form-data
362+
- **Accept**: application/json
363+
364+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
365+
366+
367+
## upload_icon
368+
369+
> models::File upload_icon(file)
370+
Upload icon
371+
372+
Upload an icon
373+
374+
### Parameters
375+
376+
377+
Name | Type | Description | Required | Notes
378+
------------- | ------------- | ------------- | ------------- | -------------
379+
**file** | **std::path::PathBuf** | The binary blob of the png file. | [required] |
380+
381+
### Return type
382+
383+
[**models::File**](File.md)
384+
385+
### Authorization
386+
387+
[authCookie](../README.md#authCookie)
388+
389+
### HTTP request headers
390+
391+
- **Content-Type**: multipart/form-data
392+
- **Accept**: application/json
393+
394+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
395+
396+
397+
## upload_image
398+
399+
> models::File upload_image(file, tag, animation_style, mask_tag)
400+
Upload gallery image, icon, emoji or sticker
401+
402+
Upload an image, which can be an icon, gallery image, sticker or emoji
403+
404+
### Parameters
405+
406+
407+
Name | Type | Description | Required | Notes
408+
------------- | ------------- | ------------- | ------------- | -------------
409+
**file** | **std::path::PathBuf** | The binary blob of the png file. | [required] |
410+
**tag** | **String** | Needs to be either icon, gallery, sticker or emoji | [required] |
411+
**animation_style** | Option<**String**> | Animation style for sticker, required for sticker. | |
412+
**mask_tag** | Option<**String**> | Mask of the sticker, optional for sticker. | |
413+
414+
### Return type
415+
416+
[**models::File**](File.md)
417+
418+
### Authorization
419+
420+
[authCookie](../README.md#authCookie)
421+
422+
### HTTP request headers
423+
424+
- **Content-Type**: multipart/form-data
425+
- **Accept**: application/json
426+
427+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
428+

docs/GroupsApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Name | Type | Description | Required | Notes
240240
> models::GroupAnnouncement create_group_announcement(group_id, create_group_announcement_request)
241241
Create Group Announcement
242242

243-
Creates an Announcement for a Group.
243+
Creates an Announcement for a Group. Warning: This will also remove all announcements. To make proper announcements, use the posts endpoint instead
244244

245245
### Parameters
246246

src/apis/files_api.rs

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ pub enum StartFileDataUploadError {
8787
UnknownValue(serde_json::Value),
8888
}
8989

90+
/// struct for typed errors of method [`upload_gallery_image`]
91+
#[derive(Debug, Clone, Serialize, Deserialize)]
92+
#[serde(untagged)]
93+
pub enum UploadGalleryImageError {
94+
UnknownValue(serde_json::Value),
95+
}
96+
97+
/// struct for typed errors of method [`upload_icon`]
98+
#[derive(Debug, Clone, Serialize, Deserialize)]
99+
#[serde(untagged)]
100+
pub enum UploadIconError {
101+
UnknownValue(serde_json::Value),
102+
}
103+
104+
/// struct for typed errors of method [`upload_image`]
105+
#[derive(Debug, Clone, Serialize, Deserialize)]
106+
#[serde(untagged)]
107+
pub enum UploadImageError {
108+
UnknownValue(serde_json::Value),
109+
}
110+
90111
/// Creates a new File object
91112
pub async fn create_file(
92113
configuration: &configuration::Configuration,
@@ -545,3 +566,181 @@ pub async fn start_file_data_upload(
545566
Err(Error::ResponseError(local_var_error))
546567
}
547568
}
569+
570+
/// Upload a gallery image
571+
pub async fn upload_gallery_image(
572+
configuration: &configuration::Configuration,
573+
file: std::path::PathBuf,
574+
) -> Result<models::File, Error<UploadGalleryImageError>> {
575+
let local_var_configuration = configuration;
576+
577+
let local_var_client = &local_var_configuration.client;
578+
579+
let local_var_uri_str = format!("{}/gallery", local_var_configuration.base_path);
580+
let mut local_var_req_builder =
581+
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
582+
583+
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
584+
local_var_req_builder =
585+
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
586+
}
587+
let mut local_var_form = reqwest::multipart::Form::new();
588+
let part = reqwest::multipart::Part::bytes(std::fs::read(&file).unwrap())
589+
.file_name(file.file_name().unwrap().to_string_lossy().to_string())
590+
.mime_str(
591+
if file
592+
.file_name()
593+
.unwrap()
594+
.to_string_lossy()
595+
.to_string()
596+
.ends_with("png")
597+
{
598+
"image/png"
599+
} else {
600+
"application/octet-stream"
601+
},
602+
)?;
603+
local_var_form = local_var_form.part("file", part);
604+
local_var_req_builder = local_var_req_builder.multipart(local_var_form);
605+
606+
let local_var_req = local_var_req_builder.build()?;
607+
let local_var_resp = local_var_client.execute(local_var_req).await?;
608+
609+
let local_var_status = local_var_resp.status();
610+
let local_var_content = local_var_resp.text().await?;
611+
612+
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
613+
serde_json::from_str(&local_var_content).map_err(Error::from)
614+
} else {
615+
let local_var_entity: Option<UploadGalleryImageError> =
616+
serde_json::from_str(&local_var_content).ok();
617+
let local_var_error = ResponseContent {
618+
status: local_var_status,
619+
content: local_var_content,
620+
entity: local_var_entity,
621+
};
622+
Err(Error::ResponseError(local_var_error))
623+
}
624+
}
625+
626+
/// Upload an icon
627+
pub async fn upload_icon(
628+
configuration: &configuration::Configuration,
629+
file: std::path::PathBuf,
630+
) -> Result<models::File, Error<UploadIconError>> {
631+
let local_var_configuration = configuration;
632+
633+
let local_var_client = &local_var_configuration.client;
634+
635+
let local_var_uri_str = format!("{}/icon", local_var_configuration.base_path);
636+
let mut local_var_req_builder =
637+
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
638+
639+
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
640+
local_var_req_builder =
641+
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
642+
}
643+
let mut local_var_form = reqwest::multipart::Form::new();
644+
let part = reqwest::multipart::Part::bytes(std::fs::read(&file).unwrap())
645+
.file_name(file.file_name().unwrap().to_string_lossy().to_string())
646+
.mime_str(
647+
if file
648+
.file_name()
649+
.unwrap()
650+
.to_string_lossy()
651+
.to_string()
652+
.ends_with("png")
653+
{
654+
"image/png"
655+
} else {
656+
"application/octet-stream"
657+
},
658+
)?;
659+
local_var_form = local_var_form.part("file", part);
660+
local_var_req_builder = local_var_req_builder.multipart(local_var_form);
661+
662+
let local_var_req = local_var_req_builder.build()?;
663+
let local_var_resp = local_var_client.execute(local_var_req).await?;
664+
665+
let local_var_status = local_var_resp.status();
666+
let local_var_content = local_var_resp.text().await?;
667+
668+
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
669+
serde_json::from_str(&local_var_content).map_err(Error::from)
670+
} else {
671+
let local_var_entity: Option<UploadIconError> =
672+
serde_json::from_str(&local_var_content).ok();
673+
let local_var_error = ResponseContent {
674+
status: local_var_status,
675+
content: local_var_content,
676+
entity: local_var_entity,
677+
};
678+
Err(Error::ResponseError(local_var_error))
679+
}
680+
}
681+
682+
/// Upload an image, which can be an icon, gallery image, sticker or emoji
683+
pub async fn upload_image(
684+
configuration: &configuration::Configuration,
685+
file: std::path::PathBuf,
686+
tag: &str,
687+
animation_style: Option<&str>,
688+
mask_tag: Option<&str>,
689+
) -> Result<models::File, Error<UploadImageError>> {
690+
let local_var_configuration = configuration;
691+
692+
let local_var_client = &local_var_configuration.client;
693+
694+
let local_var_uri_str = format!("{}/file/image", local_var_configuration.base_path);
695+
let mut local_var_req_builder =
696+
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
697+
698+
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
699+
local_var_req_builder =
700+
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
701+
}
702+
let mut local_var_form = reqwest::multipart::Form::new();
703+
let part = reqwest::multipart::Part::bytes(std::fs::read(&file).unwrap())
704+
.file_name(file.file_name().unwrap().to_string_lossy().to_string())
705+
.mime_str(
706+
if file
707+
.file_name()
708+
.unwrap()
709+
.to_string_lossy()
710+
.to_string()
711+
.ends_with("png")
712+
{
713+
"image/png"
714+
} else {
715+
"application/octet-stream"
716+
},
717+
)?;
718+
local_var_form = local_var_form.part("file", part);
719+
local_var_form = local_var_form.text("tag", tag.to_string());
720+
if let Some(local_var_param_value) = animation_style {
721+
local_var_form = local_var_form.text("animationStyle", local_var_param_value.to_string());
722+
}
723+
if let Some(local_var_param_value) = mask_tag {
724+
local_var_form = local_var_form.text("maskTag", local_var_param_value.to_string());
725+
}
726+
local_var_req_builder = local_var_req_builder.multipart(local_var_form);
727+
728+
let local_var_req = local_var_req_builder.build()?;
729+
let local_var_resp = local_var_client.execute(local_var_req).await?;
730+
731+
let local_var_status = local_var_resp.status();
732+
let local_var_content = local_var_resp.text().await?;
733+
734+
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
735+
serde_json::from_str(&local_var_content).map_err(Error::from)
736+
} else {
737+
let local_var_entity: Option<UploadImageError> =
738+
serde_json::from_str(&local_var_content).ok();
739+
let local_var_error = ResponseContent {
740+
status: local_var_status,
741+
content: local_var_content,
742+
entity: local_var_entity,
743+
};
744+
Err(Error::ResponseError(local_var_error))
745+
}
746+
}

src/apis/groups_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ pub async fn create_group(
658658
}
659659
}
660660

661-
/// Creates an Announcement for a Group.
661+
/// Creates an Announcement for a Group. Warning: This will also remove all announcements. To make proper announcements, use the posts endpoint instead
662662
pub async fn create_group_announcement(
663663
configuration: &configuration::Configuration,
664664
group_id: &str,

0 commit comments

Comments
 (0)