Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Objective-C Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Objective-C) Google Calendar -- Generate Event JSON

See more Google Calendar Examples

Demonstrates how to generate the JSON for an event resource. This code can be used as a template for generating JSON to insert new events.

See https://developers.google.com/google-apps/calendar/v3/reference/events#resource for details about the Calender Event Resource JSON.

Chilkat Objective-C Library Downloads

MAC OS X (Cocoa) Libs

iOS Libs

#import <CkoJsonObject.h>

// This example (below) generates the following JSON:
// Note: Your application code would construct the event JSON using your
// desired subset of members.  For boolean values, you would pass YES or NO.
// For date or date/time values, you would pass the appropriately formatted date/time string.

// {
//   "kind": "calendar#event",
//   "etag": "some_etag",
//   "id": "string value",
//   "status": "string value",
//   "htmlLink": "string value",
//   "created": "datetime value",
//   "updated": "datetime value",
//   "summary": "string value",
//   "description": "string value",
//   "location": "string value",
//   "colorId": "string value",
//   "creator": {
//     "id": "string value",
//     "email": "string value",
//     "displayName": "string value",
//     "self": true
//   },
//   "organizer": {
//     "id": "string value",
//     "email": "string value",
//     "displayName": "string value",
//     "self": true
//   },
//   "start": {
//     "date": "date value",
//     "dateTime": "datetime value",
//     "timeZone": "string value"
//   },
//   "end": {
//     "date": "date value",
//     "dateTime": "datetime value",
//     "timeZone": "string value"
//   },
//   "endTimeUnspecified": true,
//   "recurrence": [
//     "string value"
//   ],
//   "recurringEventId": "string value",
//   "originalStartTime": {
//     "date": "date value",
//     "dateTime": "datetime value",
//     "timeZone": "string value"
//   },
//   "transparency": "string value",
//   "visibility": "string value",
//   "iCalUID": "string value",
//   "sequence": 1234,
//   "attendees": [
//     {
//       "id": "string value",
//       "email": "string value",
//       "displayName": "string value",
//       "organizer": true,
//       "self": true,
//       "resource": true,
//       "optional": true,
//       "responseStatus": "string value",
//       "comment": "string value",
//       "additionalGuests": 1234
//     },
//     {
//       "id": "string value",
//       "email": "string value",
//       "displayName": "string value",
//       "organizer": true,
//       "self": true,
//       "resource": true,
//       "optional": true,
//       "responseStatus": "string value",
//       "comment": "string value",
//       "additionalGuests": 1234
//     }
//   ],
//   "attendeesOmitted": true,
//   "extendedProperties": {
//     "private": {
//       "someKey": "string value"
//     },
//     "shared": {
//       "someKey": "string value"
//     }
//   },
//   "hangoutLink": "string value",
//   "gadget": {
//     "type": "string value",
//     "title": "string value",
//     "link": "string value",
//     "iconLink": "string value",
//     "width": 1234,
//     "height": 1234,
//     "display": "string value",
//     "preferences": {
//       "someKey": "string value"
//     }
//   },
//   "anyoneCanAddSelf": true,
//   "guestsCanInviteOthers": true,
//   "guestsCanModify": true,
//   "guestsCanSeeOtherGuests": true,
//   "privateCopy": true,
//   "locked": true,
//   "reminders": {
//     "useDefault": true,
//     "overrides": [
//       {
//         "method": "string value",
//         "minutes": 1234
//       }
//     ]
//   },
//   "source": {
//     "url": "string value",
//     "title": "string value"
//   },
//   "attachments": [
//     {
//       "fileUrl": "string value",
//       "title": "string value",
//       "mimeType": "string value",
//       "iconLink": "string value",
//       "fileId": "string value"
//     },
//     {
//       "fileUrl": "string value",
//       "title": "string value",
//       "mimeType": "string value",
//       "iconLink": "string value",
//       "fileId": "string value"
//     }
//   ]
// }

CkoJsonObject *json = [[CkoJsonObject alloc] init];
[json UpdateString: @"kind" value: @"calendar#event"];
[json UpdateString: @"etag" value: @"some_etag"];
[json UpdateString: @"id" value: @"string value"];
[json UpdateString: @"status" value: @"string value"];
[json UpdateString: @"htmlLink" value: @"string value"];
[json UpdateString: @"created" value: @"datetime value"];
[json UpdateString: @"updated" value: @"datetime value"];
[json UpdateString: @"summary" value: @"string value"];
[json UpdateString: @"description" value: @"string value"];
[json UpdateString: @"location" value: @"string value"];
[json UpdateString: @"colorId" value: @"string value"];
[json UpdateString: @"creator.id" value: @"string value"];
[json UpdateString: @"creator.email" value: @"string value"];
[json UpdateString: @"creator.displayName" value: @"string value"];
[json UpdateBool: @"creator.self" value: YES];
[json UpdateString: @"organizer.id" value: @"string value"];
[json UpdateString: @"organizer.email" value: @"string value"];
[json UpdateString: @"organizer.displayName" value: @"string value"];
[json UpdateBool: @"organizer.self" value: YES];
[json UpdateString: @"start.date" value: @"date value"];
[json UpdateString: @"start.dateTime" value: @"datetime value"];
[json UpdateString: @"start.timeZone" value: @"string value"];
[json UpdateString: @"end.date" value: @"date value"];
[json UpdateString: @"end.dateTime" value: @"datetime value"];
[json UpdateString: @"end.timeZone" value: @"string value"];
[json UpdateBool: @"endTimeUnspecified" value: YES];
[json UpdateString: @"recurrence[0]" value: @"string value"];
[json UpdateString: @"recurringEventId" value: @"string value"];
[json UpdateString: @"originalStartTime.date" value: @"date value"];
[json UpdateString: @"originalStartTime.dateTime" value: @"datetime value"];
[json UpdateString: @"originalStartTime.timeZone" value: @"string value"];
[json UpdateString: @"transparency" value: @"string value"];
[json UpdateString: @"visibility" value: @"string value"];
[json UpdateString: @"iCalUID" value: @"string value"];
[json UpdateNumber: @"sequence" numericStr: @"1234"];

[json UpdateString: @"attendees[0].id" value: @"string value"];
[json UpdateString: @"attendees[0].email" value: @"string value"];
[json UpdateString: @"attendees[0].displayName" value: @"string value"];

// Note: We could alternately specify an index using "i", which allows
// for an application to construct using a loop with a variable..
json.I = [NSNumber numberWithInt:0];
[json UpdateBool: @"attendees[i].organizer" value: YES];
[json UpdateBool: @"attendees[i].self" value: YES];
[json UpdateBool: @"attendees[i].resource" value: YES];
[json UpdateBool: @"attendees[i].optional" value: YES];
[json UpdateString: @"attendees[i].responseStatus" value: @"string value"];
[json UpdateString: @"attendees[i].comment" value: @"string value"];
[json UpdateNumber: @"attendees[i].additionalGuests" numericStr: @"1234"];

json.I = [NSNumber numberWithInt:1];
[json UpdateString: @"attendees[i].id" value: @"string value"];
[json UpdateString: @"attendees[i].email" value: @"string value"];
[json UpdateString: @"attendees[i].displayName" value: @"string value"];

[json UpdateBool: @"attendees[1].organizer" value: YES];
[json UpdateBool: @"attendees[1].self" value: YES];
[json UpdateBool: @"attendees[1].resource" value: YES];
[json UpdateBool: @"attendees[1].optional" value: YES];
[json UpdateString: @"attendees[1].responseStatus" value: @"string value"];
[json UpdateString: @"attendees[1].comment" value: @"string value"];
[json UpdateNumber: @"attendees[1].additionalGuests" numericStr: @"1234"];

[json UpdateBool: @"attendeesOmitted" value: YES];
[json UpdateString: @"extendedProperties.private.someKey" value: @"string value"];
[json UpdateString: @"extendedProperties.shared.someKey" value: @"string value"];
[json UpdateString: @"hangoutLink" value: @"string value"];
[json UpdateString: @"gadget.type" value: @"string value"];
[json UpdateString: @"gadget.title" value: @"string value"];
[json UpdateString: @"gadget.link" value: @"string value"];
[json UpdateString: @"gadget.iconLink" value: @"string value"];
[json UpdateNumber: @"gadget.width" numericStr: @"1234"];
[json UpdateNumber: @"gadget.height" numericStr: @"1234"];
[json UpdateString: @"gadget.display" value: @"string value"];
[json UpdateString: @"gadget.preferences.someKey" value: @"string value"];
[json UpdateBool: @"anyoneCanAddSelf" value: YES];
[json UpdateBool: @"guestsCanInviteOthers" value: YES];
[json UpdateBool: @"guestsCanModify" value: YES];
[json UpdateBool: @"guestsCanSeeOtherGuests" value: YES];
[json UpdateBool: @"privateCopy" value: YES];
[json UpdateBool: @"locked" value: YES];
[json UpdateBool: @"reminders.useDefault" value: YES];
[json UpdateString: @"reminders.overrides[0].method" value: @"string value"];
[json UpdateNumber: @"reminders.overrides[0].minutes" numericStr: @"1234"];
[json UpdateString: @"source.url" value: @"string value"];
[json UpdateString: @"source.title" value: @"string value"];
[json UpdateString: @"attachments[0].fileUrl" value: @"string value"];
[json UpdateString: @"attachments[0].title" value: @"string value"];
[json UpdateString: @"attachments[0].mimeType" value: @"string value"];
[json UpdateString: @"attachments[0].iconLink" value: @"string value"];
[json UpdateString: @"attachments[0].fileId" value: @"string value"];
[json UpdateString: @"attachments[1].fileUrl" value: @"string value"];
[json UpdateString: @"attachments[1].title" value: @"string value"];
[json UpdateString: @"attachments[1].mimeType" value: @"string value"];
[json UpdateString: @"attachments[1].iconLink" value: @"string value"];
[json UpdateString: @"attachments[1].fileId" value: @"string value"];

json.EmitCompact = NO;
NSLog(@"%@",[json Emit]);
 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.