cloudflare 0.14.0

Rust library for the Cloudflare v4 API
Documentation
use crate::framework::endpoint::{EndpointSpec, Method};
use crate::framework::response::{ApiResult, ApiSuccess};

use serde::Deserialize;

/// Delete Load Balancer
/// <https://api.cloudflare.com/#load-balancers-delete-load-balancer>
#[derive(Debug)]
pub struct DeleteLoadBalancer<'a> {
    /// The Zone to which this Load Balancer belongs.
    pub zone_identifier: &'a str,
    /// Which load balancer to delete.
    pub identifier: &'a str,
}

impl EndpointSpec for DeleteLoadBalancer<'_> {
    type JsonResponse = Response;
    type ResponseType = ApiSuccess<Self::JsonResponse>;

    fn method(&self) -> Method {
        Method::DELETE
    }
    fn path(&self) -> String {
        format!(
            "zones/{}/load_balancers/{}",
            self.zone_identifier, self.identifier
        )
    }
}

#[derive(Deserialize, Clone, Debug)]
pub struct Response {
    pub id: String,
}
impl ApiResult for Response {}