Exemplo n.º 1
0
 public async Task <string> UpdateIbxObject(Type type, string reference, IEnumerable <KeyValuePair <string, string> > args)
 {
     if (type.IsInfobloxType())
     {
         if (args != null)
         {
             if (!String.IsNullOrEmpty(reference))
             {
                 return(await this.PutAsync(reference, InfobloxSDKExtensionMethods.PrepareArgsForSend(type, args)));
             }
             else
             {
                 throw new ArgumentNullException("reference", "The reference data cannot be null or empty.");
             }
         }
         else
         {
             throw new ArgumentNullException("ibxObject", "The updated object cannot be null.");
         }
     }
     else
     {
         throw new ArgumentException(String.Format("The type must be a valid infoblox object type, {0} was provided.", type.Name));
     }
 }
Exemplo n.º 2
0
 public async Task <string> NewIbxObject(Type type, IEnumerable <KeyValuePair <string, string> > args)
 {
     if (type.IsInfobloxType())
     {
         if (args.Any())
         {
             return(await this.PostAsync(type.GetNameAttribute(), InfobloxSDKExtensionMethods.PrepareArgsForSend(type, args)));
         }
         else
         {
             throw new ArgumentNullException("args", "The length of arguments must be greater than 0.");
         }
     }
     else
     {
         throw new ArgumentException($"The type must be a valid infoblox object type, {type.FullName} was provided.");
     }
 }