|
1 | 1 | use super::{AsNamespace, DerivedRequest, WpEndpointUrl, WpNamespace};
|
2 | 2 | use crate::{
|
3 |
| - SparseField, |
4 | 3 | api_error::WpApiError,
|
5 |
| - media::{ |
6 |
| - MediaCreateParams, MediaId, MediaListParams, MediaUpdateParams, MediaWithEditContext, |
7 |
| - SparseMediaFieldWithEditContext, SparseMediaFieldWithEmbedContext, |
8 |
| - SparseMediaFieldWithViewContext, |
9 |
| - }, |
| 4 | + media::{MediaCreateParams, MediaId, MediaListParams, MediaUpdateParams, MediaWithEditContext}, |
10 | 5 | request::{
|
11 | 6 | CONTENT_TYPE_MULTIPART, NetworkRequestAccessor, ParsedResponse, RequestMethod,
|
12 | 7 | WpNetworkHeaderMap, WpNetworkResponse,
|
@@ -44,35 +39,6 @@ impl DerivedRequest for MediaRequest {
|
44 | 39 | }
|
45 | 40 | }
|
46 | 41 |
|
47 |
| -impl SparseField for SparseMediaFieldWithEditContext { |
48 |
| - fn as_str(&self) -> &str { |
49 |
| - match self { |
50 |
| - Self::PostId => "post", |
51 |
| - Self::PostType => "type", |
52 |
| - _ => self.as_field_name(), |
53 |
| - } |
54 |
| - } |
55 |
| -} |
56 |
| - |
57 |
| -impl SparseField for SparseMediaFieldWithEmbedContext { |
58 |
| - fn as_str(&self) -> &str { |
59 |
| - match self { |
60 |
| - Self::PostType => "type", |
61 |
| - _ => self.as_field_name(), |
62 |
| - } |
63 |
| - } |
64 |
| -} |
65 |
| - |
66 |
| -impl SparseField for SparseMediaFieldWithViewContext { |
67 |
| - fn as_str(&self) -> &str { |
68 |
| - match self { |
69 |
| - Self::PostId => "post", |
70 |
| - Self::PostType => "type", |
71 |
| - _ => self.as_field_name(), |
72 |
| - } |
73 |
| - } |
74 |
| -} |
75 |
| - |
76 | 42 | impl MediaRequestEndpoint {
|
77 | 43 | pub fn create(&self) -> crate::request::endpoint::ApiEndpointUrl {
|
78 | 44 | Arc::unwrap_or_clone(self.api_url_resolver.resolve(
|
@@ -239,7 +205,10 @@ mod tests {
|
239 | 205 | use super::*;
|
240 | 206 | use crate::{
|
241 | 207 | UserId, WpApiParamOrder, generate,
|
242 |
| - media::{MediaId, MediaStatus, MediaTypeParam}, |
| 208 | + media::{ |
| 209 | + MediaId, MediaStatus, MediaTypeParam, SparseMediaFieldWithEditContext, |
| 210 | + SparseMediaFieldWithEmbedContext, SparseMediaFieldWithViewContext, |
| 211 | + }, |
243 | 212 | posts::{PostId, WpApiParamPostsOrderBy, WpApiParamPostsSearchColumn},
|
244 | 213 | request::endpoint::{
|
245 | 214 | ApiUrlResolver,
|
|
0 commit comments