1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// GENERATED CODE

use crate::api_default_imports::*;
use graph_error::GraphFailure;
use graph_http::types::NoContent;
use graph_http::UploadSessionClient;
use std::path::Path;

register_client!(AttachmentsRequest,);
register_client!(AttachmentsIdRequest, ());

impl<'a, Client> AttachmentsRequest<'a, Client>
where
    Client: graph_http::RequestClient,
{
    pub fn id<ID: AsRef<str>>(&self, attachments_id: ID) -> AttachmentsIdRequest<'a, Client> {
        AttachmentsIdRequest::new(attachments_id.as_ref(), self.client)
    }

    get!({
        doc: "Get attachments from me",
        name: list_attachments,
        response: serde_json::Value,
        path: "attachments",
        has_body: false
    });
    post!({
        doc: "Create new navigation property to attachments for me",
        name: create_attachments,
        response: serde_json::Value,
        path: "attachments",
        has_body: true
    });
    post!({
        doc: "Invoke action createUploadSession",
        name: create_upload_session,
        path: "attachments/createUploadSession",
        has_body: true,
        upload_session: true
    });
}

impl<'a, Client> AttachmentsIdRequest<'a, Client>
where
    Client: graph_http::RequestClient,
{
    delete!({
        doc: "Delete navigation property attachments for me",
        name: delete_attachments,
        response: NoContent,
        path: "attachments/{{RID}}",
        has_body: false
    });
    patch!({
        doc: "Update the navigation property attachments in me",
        name: update_attachments,
        response: NoContent,
        path: "attachments/{{RID}}",
        has_body: true
    });
    get!({
        doc: "Get attachments from me",
        name: get_attachments,
        response: serde_json::Value,
        path: "attachments/{{RID}}",
        has_body: false
    });
    get!({
        doc: "Get attachments content",
        name: get_content,
        response: serde_json::Value,
        path: "attachments/{{RID}}/$value",
        has_body: false
    });
}