Organization

Struct Organization 

Source
pub struct Organization {
    pub id: Option<String>,
    pub href: Option<String>,
    pub name: Option<String>,
    pub name_type: Option<String>,
    pub organization_type: Option<String>,
    pub trading_name: Option<String>,
    pub exists_during: Option<TimePeriod>,
    pub status: Option<OrganizationStateType>,
    pub contact_medium: Option<Vec<ContactMedium>>,
    pub related_party: Option<Vec<RelatedParty>>,
    pub party_characteristic: Option<Vec<Characteristic>>,
    /* private fields */
}
Expand description

Organisation record (sic)

Fields§

§id: Option<String>

Unique id of this organization record

§href: Option<String>

HTML reference to this organization record

§name: Option<String>

Name of this Organization

§name_type: Option<String>

Type of name of this Organization

§organization_type: Option<String>

Type of Organization

§trading_name: Option<String>

Trading Name of this Organization

§exists_during: Option<TimePeriod>

Existence Period

§status: Option<OrganizationStateType>

Status

§contact_medium: Option<Vec<ContactMedium>>

Contact medium for organization

§related_party: Option<Vec<RelatedParty>>

Related Party

§party_characteristic: Option<Vec<Characteristic>>

Party Characteristics

Implementations§

Source§

impl Organization

Source

pub fn new(name: impl Into<String>) -> Organization

Create a new organization record with a name

Examples found in repository?
examples/create_customer_event.rs (line 12)
11fn main() {
12    let org = Organization::new("An Organization");
13    let cust = Customer::from(&org);
14
15    let event = cust
16        .to_event(CustomerEventType::CustomerCreateEvent)
17        .path("status");
18
19    dbg!(event);
20}
More examples
Hide additional examples
examples/create_organization.rs (line 12)
8fn main() {
9    // Two methods to create an org object
10
11    // 1) use native constructor new()
12    let org1 = Organization::new("My Organization");
13    // 2) Use conversion from a String.
14    let org2: Organization = String::from("Organisation from String").into();
15
16    dbg!(org1);
17    dbg!(org2);
18}
examples/create_party_role.rs (line 22)
20fn main() {
21    let individual = Individual::new("John Smith");
22    let organisation = Organization::new("A Customer".to_string());
23    let customer = Customer::new(organisation);
24    let mut role = PartyRole::new("Account Manager", RelatedParty::from(&individual));
25    role.add_party(RelatedParty::from(&customer));
26    dbg!(role);
27}
examples/create_catalog.rs (line 14)
13fn main() {
14    let org = Organization::new("A Customer");
15    let cust = Customer::new(org);
16    let mut catalog = Catalog::new("Customer A Catalog");
17    let rel_party = RelatedParty::from(&cust);
18    let cat = Category::new("Customer Category");
19    catalog.add_party(rel_party);
20    catalog.add_category(CategoryRef::from(&cat));
21
22    dbg!(catalog);
23}
examples/create_resource.rs (line 19)
15fn main() {
16    #[cfg(all(feature = "tmf639", feature = "build-V4"))]
17    {
18        // Create an organisation
19        let organisation = Organization::new("An Organisation");
20        let customer = Customer::from(&organisation);
21        let mut resource = Resource::new("VLAN");
22        resource.add_party(RelatedParty::from(&customer));
23
24        dbg!(resource);
25    }
26}
examples/create_poq.rs (line 22)
19fn main() {
20    #[cfg(all(feature = "tmf679", feature = "build-V4"))]
21    {
22        let org = Organization::new("ACustomer");
23        let customer = Customer::new(org);
24        let offering = ProductOffering::new("MyOffer");
25        let mut poq = ProductOfferingQualification::new(Some(ProductOfferingRef::from(offering)));
26        poq.add_party(RelatedParty::from(&customer));
27
28        dbg!(poq);
29    }
30}
Source

pub fn generate_code(&mut self, offset: Option<u32>)

Generate a new site code based on available fields

Source

pub fn replace_characteristic( &mut self, characteristic: Characteristic, ) -> Option<Characteristic>

Replace a characteristic returning the old value if found

Trait Implementations§

Source§

impl Clone for Organization

Source§

fn clone(&self) -> Organization

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Organization

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Organization

Source§

fn default() -> Organization

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Organization

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl EventPayload<OrganizationEvent> for Organization

Source§

type Subject = Organization

Object the event pertains to
Source§

type EventType = OrganizationEventType

Type of event generated
Source§

fn to_event( &self, event_type: Self::EventType, ) -> Event<OrganizationEvent, Self::EventType>

Convert the item into an event
Source§

impl From<&Organization> for Customer

Source§

fn from(value: &Organization) -> Self

Converts to this type from the input type.
Source§

impl From<&Organization> for RelatedParty

Source§

fn from(org: &Organization) -> Self

Converts to this type from the input type.
Source§

impl From<Organization> for OrganizationRef

Source§

fn from(value: Organization) -> Self

Converts to this type from the input type.
Source§

impl From<Organization> for RelatedParty

Source§

fn from(org: Organization) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Organization

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl HasId for Organization

Source§

fn generate_id(&mut self)

Generate and store a new ID. This will also regenerated the HREF field via generate_href()
Source§

fn generate_href(&mut self)

Generate a new HTML reference. Read more
Source§

fn get_id(&self) -> String

Extract the id of this object into a new String
Source§

fn get_href(&self) -> String

Extract the HREF of this object into a new String
Source§

fn get_class() -> String

Get the class of this object. This is also used to form part of the URL via generate_href()
Source§

fn get_class_href() -> String

Get Class HREF, this represents the generate path to the class.
Source§

fn get_mod_path() -> String

Get the module path
Source§

fn set_id(&mut self, id: impl Into<String>)

Set the id on the object, also triggers generate_href().
Source§

fn id(self, id: impl Into<String>) -> Self

Builder pattern to set id on create() NB: This can be used to set an explicit id on create instead of auto-generate via [create]
Source§

fn get_uuid() -> String

Get a new UUID in simple format (no seperators)
Source§

fn get_full_href(&self, hostname: impl Into<String>) -> String

Generate a complete URL for a given hostname
Source§

fn create() -> Self

Create a new instance of a TMF object that has id and href fields. Read more
Source§

impl HasName for Organization

Source§

fn get_name(&self) -> String

Return name of object
Source§

fn set_name(&mut self, name: impl Into<String>)

Set the name, trimming any whitespace
Source§

fn name(self, name: impl Into<String>) -> Self

Builder pattern to set name on create, usually coverered by new()
Source§

fn find(&self, pattern: &str) -> bool

Match against the name
Source§

fn as_entity(&self) -> EntityRef

Return a EntityRef for this object
Source§

impl HasReference for Organization

Source§

type RefType = RelatedParty

Reference type assocaited with Self.
Source§

fn as_ref(&self) -> Option<Self::RefType>

Return a reference version of an object, if none exists, return None.
Source§

fn as_entity_ref(&self) -> RelatedEntity

Get object as an EntityRef
Source§

impl Serialize for Organization

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TMFEvent<OrganizationEvent> for Organization

Source§

fn event(&self) -> OrganizationEvent

Geneate container for an TMF payload to be used in an event

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,