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
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// GENERATED CODE

use crate::api_default_imports::*;
use crate::buckets::{BucketsIdRequest, BucketsRequest};
use crate::tasks::{TasksIdRequest, TasksRequest};
use graph_http::types::NoContent;

register_client!(PlansRequest,);
register_client!(PlansIdRequest, ());

impl<'a, Client> PlansRequest<'a, Client>
where
    Client: graph_http::RequestClient,
{
    post!({
        doc: "Create new navigation property to plans",
        name: create_plans,
        response: serde_json::Value,
        path: "plans",
        has_body: true
    });
    get!({
        doc: "Get plans",
        name: list_plans,
        response: serde_json::Value,
        path: "plans",
        has_body: false
    });
}

impl<'a, Client> PlansIdRequest<'a, Client>
where
    Client: graph_http::RequestClient,
{
    pub fn buckets(&self) -> BucketsRequest<'a, Client> {
        self.client
            .request
            .extend_path(&[self.client.ident().as_ref(), self.id.as_str()]);
        self.client.set_ident(ResourceIdentity::Buckets);
        BucketsRequest::new(self.client)
    }

    pub fn bucket<ID: AsRef<str>>(&self, id: ID) -> BucketsIdRequest<'a, Client> {
        self.client
            .request
            .extend_path(&[self.client.ident().as_ref(), self.id.as_str()]);
        self.client.set_ident(ResourceIdentity::Buckets);
        BucketsIdRequest::new(id.as_ref(), self.client)
    }

    pub fn tasks(&self) -> TasksRequest<'a, Client> {
        self.client
            .request
            .extend_path(&[self.client.ident().as_ref(), self.id.as_str()]);
        self.client.set_ident(ResourceIdentity::Tasks);
        TasksRequest::new(self.client)
    }

    pub fn task<ID: AsRef<str>>(&self, id: ID) -> TasksIdRequest<'a, Client> {
        self.client
            .request
            .extend_path(&[self.client.ident().as_ref(), self.id.as_str()]);
        self.client.set_ident(ResourceIdentity::Tasks);
        TasksIdRequest::new(id.as_ref(), self.client)
    }

    patch!({
        doc: "Update the navigation property plans",
        name: update_plans,
        response: NoContent,
        path: "plans/{{RID}}",
        has_body: true
    });
    get!({
        doc: "Get plans",
        name: get_plans,
        response: serde_json::Value,
        path: "plans/{{RID}}",
        has_body: false
    });
    delete!({
        doc: "Delete navigation property plans",
        name: delete_plans,
        response: NoContent,
        path: "plans/{{RID}}",
        has_body: false
    });
    get!({
        doc: "Get buckets",
        name: list_buckets,
        response: serde_json::Value,
        path: "plans/{{RID}}/buckets",
        has_body: false
    });
    post!({
        doc: "Create new navigation property to buckets",
        name: create_buckets,
        response: serde_json::Value,
        path: "plans/{{RID}}/buckets",
        has_body: true
    });
    get!({
        doc: "Get details",
        name: get_details,
        response: serde_json::Value,
        path: "plans/{{RID}}/details",
        has_body: false
    });
    delete!({
        doc: "Delete navigation property details",
        name: delete_details,
        response: NoContent,
        path: "plans/{{RID}}/details",
        has_body: false
    });
    patch!({
        doc: "Update the navigation property details",
        name: update_details,
        response: NoContent,
        path: "plans/{{RID}}/details",
        has_body: true
    });
    get!({
        doc: "Get tasks",
        name: list_tasks,
        response: serde_json::Value,
        path: "plans/{{RID}}/tasks",
        has_body: false
    });
    post!({
        doc: "Create new navigation property to tasks",
        name: create_tasks,
        response: serde_json::Value,
        path: "plans/{{RID}}/tasks",
        has_body: true
    });
}