text:
package org.dasein.cloud.google.network;

import com.google.api.client.repackaged.com.google.common.base.Preconditions;
import com.google.api.services.compute.Compute;
import com.google.api.services.compute.model.Network;
import com.google.api.services.compute.model.NetworkList;
import com.google.api.services.compute.model.Operation;
import com.google.common.collect.FluentIterable;
import org.dasein.cloud.*;
import org.dasein.cloud.google.Google;
import org.dasein.cloud.google.capabilities.GCENetworkCapabilities;
import org.dasein.cloud.google.common.NoContextException;
import org.dasein.cloud.google.compute.server.OperationSupport;
import org.dasein.cloud.google.util.GoogleExceptionUtils;
import org.dasein.cloud.google.util.GoogleLogger;
import org.dasein.cloud.google.util.model.GoogleNetworks;
import org.dasein.cloud.google.util.model.GoogleOperations;
import org.dasein.cloud.network.*;
import org.slf4j.Logger;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;

/**
 * Implements the network services supported in the Google API.
 *
 * @author ebakaev
 * @version 2013.01 initial version
 * @since 2013.01
 */
public class GoogleNetworkSupport extends AbstractVLANSupport {

	static private final Logger logger = GoogleLogger.getLogger(GoogleNetworkSupport.class);
	private Google provider;
	private OperationSupport<Operation> operationSupport;

	GoogleNetworkSupport(Google provider) {
		super(provider);
		this.provider = provider;
		this.operationSupport = provider.getComputeServices().getOperationsSupport();
	}

  private transient volatile GCENetworkCapabilities capabilities;
  @Override
  public @Nonnull GCENetworkCapabilities getCapabilities(){
    if(capabilities == null){
      capabilities = new GCENetworkCapabilities(provider);
    }
    return capabilities;
  }

	@Override
	public
	@Nullable
	String getAttachedInternetGatewayId(@Nonnull String vlanId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Internet gateways not supported.");
	}

	@Override
	public
	@Nullable
	InternetGateway getInternetGatewayById(@Nonnull String gatewayId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Internet gateways not supported.");
	}

	@Override
	public
	@Nullable
	Collection<InternetGateway> listInternetGateways(@Nullable String vlanId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Internet gateways not supported.");
	}

	@Override
	public void removeInternetGatewayById(@Nonnull String id) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Internet gateways not supported.");
	}

	@Nonnull
	@Override
	public VLAN createVlan(@Nonnull VlanCreateOptions vco) throws CloudException, InternalException {
		if (!provider.isInitialized()) {
			throw new NoContextException();
		}

		Compute compute = provider.getGoogleCompute();
		Operation operation = null;
		try {
			Network newNetwork = new Network();
			newNetwork.setName(vco.getName());
			newNetwork.setIPv4Range(vco.getCidr());
			newNetwork.setDescription(vco.getDescription());
			Compute.Networks.Insert createAction = compute.networks().insert(provider.getContext().getAccountNumber(), newNetwork);
			operation = createAction.execute();
			//waiting until network is created.
			operation = operationSupport.waitUntilOperationCompletes(operation);
			if (operation != null && operation.getStatus() != null
					&& GoogleOperations.OperationStatus.DONE.equals(GoogleOperations.OperationStatus.fromOperation(operation))) {
				return getVlan(vco.getName());
			}
		} catch (IOException e) {
			logger.error("Failed to create the new Google Network object '" + vco.getName() + "' : " + e.getMessage());
			GoogleExceptionUtils.handleGoogleResponseError(e);
		}

		throw new IllegalStateException("The new Google Network '" + vco.getName() + "' wasn't created");
	}

	@Override
	public VLAN createVlan(String cidr, String name, String description,
	                       String domainName, String[] dnsServers, String[] ntpServers)
			throws CloudException, InternalException {
		return createVlan(VlanCreateOptions.getInstance(name, description, cidr, domainName, dnsServers, ntpServers));
	}

	@Override
	public String getProviderTermForNetworkInterface(Locale locale) {
		return "network interface";
	}

	@Override
	public String getProviderTermForSubnet(Locale locale) {
		return "";
	}

	@Override
	public String getProviderTermForVlan(Locale locale) {
		return "network";
	}

	@Override
	public RoutingTable getRoutingTableForSubnet(String subnetId)
			throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables and subnets not supported.");
	}

	@Override
	public RoutingTable getRoutingTableForVlan(String vlanId)
			throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables not supported.");
	}

	@Override
	public Subnet getSubnet(String subnetId) throws CloudException,
			InternalException {
		return null;
	}

	/**
	 * Gets VLAN by its id.
	 * Google API is used.
	 *
	 * @param vlanId to search
	 * @return VLAN
	 * @throws CloudException
	 * @throws InternalException
	 */
	@Override
	public VLAN getVlan(String vlanId) throws CloudException, InternalException {
		Preconditions.checkNotNull(vlanId, "VLAN id has to be specified");
		if (!provider.isInitialized()) {
			throw new NoContextException();
		}
		ProviderContext ctx = provider.getContext();

		Compute compute = provider.getGoogleCompute();
		try {
			Compute.Networks.Get getNetworkAction = compute.networks().get(provider.getContext().getAccountNumber(), vlanId);
			Network network = getNetworkAction.execute();
			if (network != null) {
				return GoogleNetworks.toNetwork(network, ctx);
			}
		} catch (IOException e) {
			logger.error("Failed to get Google Network : " + e.getMessage());
			GoogleExceptionUtils.handleGoogleResponseError(e);
		}

		return null;
	}

	@Override
	public boolean isNetworkInterfaceSupportEnabled() throws CloudException,
			InternalException {
		return true;
	}

	@Override
	public boolean isSubscribed() throws CloudException, InternalException {
		return true;
	}

	@Override
	public boolean isSubnetDataCenterConstrained() throws CloudException,
			InternalException {
		return false;
	}

	@Override
	public boolean isVlanDataCenterConstrained() throws CloudException,
			InternalException {
		return false;
	}

	@Override
	public Collection<String> listFirewallIdsForNIC(String nicId)
			throws CloudException, InternalException {
		Iterable<NetworkInterface> nics = listNetworkInterfaces();
		List<String> firewallList = new ArrayList<String>();
		for (NetworkInterface nic : nics) {
			if (nic.getName().equals(nicId)) {
				String network = nic.getProviderVlanId();
				Iterable<Firewall> firewalls = provider.getNetworkServices().getFirewallSupport().list();
				for (Firewall firewall : firewalls) {
					if (firewall.getProviderVlanId().equals(network)) {
						firewallList.add(firewall.getProviderFirewallId());
					}
				}
			}
		}
		return firewallList;
	}

	@Override
	public Iterable<ResourceStatus> listNetworkInterfaceStatus()
			throws CloudException, InternalException {
		Iterable<NetworkInterface> nicList = listNetworkInterfaces();
		List<ResourceStatus> status = new ArrayList<ResourceStatus>();
		for (NetworkInterface nic : nicList) {
			status.add(new ResourceStatus(nic.getName(), nic.getCurrentState()));
		}
		return status;
	}

	@Override
	public Iterable<NetworkInterface> listNetworkInterfaces() throws CloudException, InternalException {
		throw new OperationNotSupportedException("Is not implemented yet");
	}

	@Override
	public Iterable<NetworkInterface> listNetworkInterfacesForVM(String forVmId)
			throws CloudException, InternalException {
		Iterable<NetworkInterface> nics = listNetworkInterfaces();
		List<NetworkInterface> vmNics = new ArrayList<NetworkInterface>();
		for (NetworkInterface nic : nics) {
			if (nic.getProviderVirtualMachineId().equals(forVmId)) {
				vmNics.add(nic);
			}
		}
		return vmNics;
	}

	@Override
	public Iterable<NetworkInterface> listNetworkInterfacesInSubnet(
			String subnetId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Subnets not supported.");
	}

	@Override
	public Iterable<NetworkInterface> listNetworkInterfacesInVLAN(String vlanId) throws CloudException, InternalException {
		Iterable<NetworkInterface> nics = listNetworkInterfaces();
		List<NetworkInterface> vlanNics = new ArrayList<NetworkInterface>();
		for (NetworkInterface nic : nics) {
			if (nic.getProviderVlanId().equals(vlanId)) {
				vlanNics.add(nic);
			}
		}
		return vlanNics;
	}

	@Override
	public Iterable<Networkable> listResources(String inVlanId)
			throws CloudException, InternalException {
		Collection<Networkable> resources = new ArrayList<Networkable>();
		Iterable<NetworkInterface> nics = listNetworkInterfacesInVLAN(inVlanId);
		for (NetworkInterface nic : nics) {
			IpAddress ip = new IpAddress();
			ip.setVersion(IPVersion.IPV4);
			ip.setProviderNetworkInterfaceId(nic.getProviderNetworkInterfaceId());
			ip.setRegionId(nic.getProviderRegionId());
			ip.setServerId(nic.getProviderVirtualMachineId());
			ip.setProviderVlanId(nic.getProviderVlanId());
			resources.add(ip);
		}

		return resources;

	}

	@Override
	public Iterable<RoutingTable> listRoutingTables(String inVlanId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables and subnets not supported.");
	}

	@Override
	public Iterable<Subnet> listSubnets(String inVlanId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Subnets not supported.");
	}

	@Override
	public Iterable<ResourceStatus> listVlanStatus() throws CloudException, InternalException {
		if (!provider.isInitialized()) {
			throw new NoContextException();
		}
		List<VLAN> networks = FluentIterable.from(listVlans()).toList();
		ArrayList<ResourceStatus> status = new ArrayList<ResourceStatus>();
		if (networks != null) {
			for (VLAN vlan : networks) {
				status.add(new ResourceStatus(vlan.getName(), VLANState.AVAILABLE));
			}
		}
		return status;
	}

	/**
	 * Returns list of available google networks for provided context.
	 *
	 * @return list of networks (VLANs)
	 * @throws CloudException
	 */
	@Override
	public Iterable<VLAN> listVlans() throws CloudException, InternalException {
		ProviderContext ctx = provider.getContext();
		if (!provider.isInitialized()) {
			throw new NoContextException();
		}
		ArrayList<VLAN> networks = new ArrayList<VLAN>();
		Compute compute = provider.getGoogleCompute();
		try {
			Compute.Networks.List networkList = compute.networks().list(provider.getContext().getAccountNumber());
			NetworkList list = networkList.execute();
			if (list != null && list.size() > 0) {
				for (Network network : list.getItems()) {
					VLAN vlan = GoogleNetworks.toNetwork(network, ctx);
					if (vlan != null) {
						networks.add(vlan);
					}
				}
			}
		} catch (IOException e) {
			logger.error("Failed to get list of Networks : " + e.getMessage());
			GoogleExceptionUtils.handleGoogleResponseError(e);
		}

		return networks;
	}

	@Override
	public void removeInternetGateway(String forVlanId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Removing internet gateways not supported.");
	}

	@Override
	public void removeNetworkInterface(String nicId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("De-provisioning network interfaces is not supported.");
	}

	@Override
	public void removeRoute(String inRoutingTableId, String destinationCidr) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables not supported.");

	}

	@Override
	public void removeRoutingTable(String routingTableId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables not supported.");
	}

	@Override
	public void removeSubnet(String providerSubnetId) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Subnets not supported");
	}

	@Override
	public void removeVLANTags(String arg0, Tag... arg1) throws CloudException,
			InternalException {
		throw new OperationNotSupportedException("Google does not support removing vlan tags");

	}

	@Override
	public void removeVLANTags(String[] arg0, Tag... arg1)
			throws CloudException, InternalException {
		throw new OperationNotSupportedException("Google does not support removing vlan tags");

	}

	/**
	 * Removes Google network by its Id
	 *
	 * @param vlanId to remove
	 * @throws CloudException
	 * @throws InternalException
	 */
	@Override
	public void removeVlan(String vlanId) throws CloudException, InternalException {
		Preconditions.checkNotNull(vlanId, "VLAN is has to be specified");
		Compute compute = provider.getGoogleCompute();
		Operation operation = null;
		try {
			Compute.Networks.Delete deleteAction = compute.networks().delete(provider.getContext().getAccountNumber(), vlanId);
			operation = deleteAction.execute();
		} catch (IOException e) {
			logger.error("Failed to delete Google Network object '" + vlanId + "' : " + e.getMessage());
			GoogleExceptionUtils.handleGoogleResponseError(e);
		}
	}

	@Override
	public boolean supportsInternetGatewayCreation() throws CloudException, InternalException {
		return false;
	}

	@Override
	public boolean supportsRawAddressRouting() throws CloudException, InternalException {
		return false;
	}

	@Override
	public void updateVLANTags(String arg0, Tag... arg1) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Google does not support updating vlan tags");
	}

	@Override
	public void updateVLANTags(String[] arg0, Tag... arg1) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Google does not support updating vlan tags");
	}

	@Override
	public void removeInternetGatewayTags(@Nonnull String internetGatewayId, @Nonnull Tag... tags) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Internet gateways not supported.");
	}

	@Override
	public void removeRoutingTableTags(@Nonnull String routingTableId, @Nonnull Tag... tags) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables are not supported");
	}

	@Override
	public void removeSubnetTags(@Nonnull String providerSubnetId, @Nonnull Tag... tags) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Subnets are not supported");
	}

    @Override
	public void updateRoutingTableTags(@Nonnull String routingTableId, @Nonnull Tag... tags) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Routing tables are not supported");
	}

  @Override
	public void updateSubnetTags(@Nonnull String providerSubnetId, @Nonnull Tag... tags) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Subnets are not supported");
	}

  @Override
	public void updateInternetGatewayTags(@Nonnull String internetGatewayId, @Nonnull Tag... tags) throws CloudException, InternalException {
		throw new OperationNotSupportedException("Internet gateways not supported.");
	}

}


text:
//
//  QQApi.h
//  QQApi
//
//  Created by Tencent on 5/1/12.
//  Copyright (c) 2012 Tencent. All rights reserved.
//

/** @file */

#import <Foundation/Foundation.h>

@class QQApiObject;
@class QQApiMessage;
@class QQApiAdItem;

typedef enum
{
    EQQAPISENDSUCESS = 0,
    EQQAPIQQNOTINSTALLED = 1,
    EQQAPIQQNOTSUPPORTAPI = 2,
    EQQAPIMESSAGETYPEINVALID = 3,
    EQQAPIMESSAGECONTENTNULL = 4,
    EQQAPIMESSAGECONTENTINVALID = 5,
    EQQAPIAPPNOTREGISTED = 6,
    EQQAPIAPPSHAREASYNC = 7,
    EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 8,
    EQQAPISENDFAILD = -1,
    //qzone分享不支持text类型分享
    EQQAPIQZONENOTSUPPORTTEXT = 10000,
    //qzone分享不支持image类型分享
    EQQAPIQZONENOTSUPPORTIMAGE = 10001,
} QQApiSendResultCode;

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// QQApi
////////////////////////////////////////////////////////////////////////////////////////////////////////////

/** \brief QQApi主要接口类。.

 可以通过其中的接口注册插件,发送、接收消息,打开QQ,测试QQ是否支持插件等
 */
@interface QQApi : NSObject

/**
 向QQ App发送消息
 @param message 待发送的消息对象

 @return 发送结果错误码
 */
+ (QQApiSendResultCode)sendMessage:(QQApiMessage *)message;

/**
 把URL反序列化成QQApiMessage对象,在AppDelegate的handleOpenURL中调用
 @return
     如果这是来自QQ的调用,一个QQApiMessage实例将被返回,否则返回nil。
 @note
     App应通过QQApiMessage.type来判断具体消息类型以作出进一步的处理。
 */
+ (QQApiMessage *)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)source annotation:(id)annotation;

/**
 @see QQApi#handleOpenURL:sourceApplication:annotation:
 */
+ (QQApiMessage *)handleOpenURL:(NSURL *)url;

/**
 获取广告数据列表
 @return
     QQApiAdItem数组
 */
+ (NSArray*)getAdItemArray;

/**
 检测是否已安装QQ
 @return
     如果QQ已安装则返回TRUE,否则返回FALSE
 */
+ (BOOL)isQQInstalled;

/**
 批量检测QQ号码是否在线
 */
+ (void)getQQUinOnlineStatues:(NSArray *)QQUins delegate:(id)target;

/**
 检测QQ是否支持API调用
 @return
     如果当前安装QQ版本支持API调用则返回TRUE,否则返回FALSE
 */
+ (BOOL)isQQSupportApi;

/**
 获取QQ下载地址

 如果App通过QQApi#isQQInstalled和QQApi#isQQSupportApi检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。
 @return
     iPhoneQQ下载地址
 */
+ (NSString*)getQQInstallURL;

/**
 启动QQ
 @return
     成功返回TRUE,否则返回FALSE
 */
+ (BOOL)openQQApp;

@end

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Message definition
////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
 消息类型定义
 */
enum
{
    // Message from QQ to Plugin app. Plugin app is required to display the data object attached in this message
	QQApiMessageTypeShowMessageFromQQRequest  = 0x01,///< QQ发给插件App的请求
    QQApiMessageTypeShowMessageFromQQResponse = 0x02,

    // Message from QQ to Plugin app. Plugin app is required to send data to QQ
	QQApiMessageTypeGetMessageFromQQRequest   = 0x03,
    QQApiMessageTypeGetMessageFromQQResponse  = 0x04,

    // Message from Plugin app to QQ. Plugin app is sharing data with QQ
    QQApiMessageTypeSendMessageToQQRequest    = 0x05,
    // Message from QQ to Plugin app.
    QQApiMessageTypeSendMessageToQQResponse   = 0x06,

    // Message from Plugin app to QZone,
    QQApiMessageTypeSendMessageToQQQZoneRequest = 0x07,

    // Message from Plugin app to QQ GroupTribe
    QQApiMessageTypeSendMessageToQQGroupTribeRequest = 0x08,

	QQApiMessageTypeReserved   = 0xF0
};

/**
 用来区分消息是发送给哪个平台
 */
typedef enum
{
    //分享到qq
    kShareMsgToQQ = 0x0,
    //分享到qzone结合版
    kShareMsgToQQQZone = 0x1,
    //分享到群部落
    kShareMsgToGroupTribe = 0x2,
}QQShareType;

typedef NSUInteger QQApiMessageType;

// QQApiMessage
/** @brief API MESSAGE对象.

 用于在QQ和插件间发送消息、数据等。
 */
@interface QQApiMessage : NSObject<NSCoding>
/**
 消息类型.
 @note 参见QQApi.h中的 QQApiMessageType 定义
 */
@property (nonatomic) QQApiMessageType type;
/**
 */
@property (nonatomic, retain)QQApiObject* object;

/**
 初始化函数
 */
- (id)initWithObject:(QQApiObject*)obj andType:(QQApiMessageType)type;
/**
 通过ApiObject获取QQApiMessage对象
 @note 通过此接口获取的对象类型为APP发送到QQ的请求
 */
+ (QQApiMessage*) messageWithObject:(QQApiObject*)obj;
/**
 通过ApiObject及MessageType获取QQApiMessage对象
 */
+ (QQApiMessage*) messageWithObject:(QQApiObject*)obj andType:(QQApiMessageType)type;
@end

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Payload object definition
////////////////////////////////////////////////////////////////////////////////////////////////////////////

// QQApiObject control flags
enum
{
    kQQAPICtrlFlagQZoneShareOnStart = 0x01,
    kQQAPICtrlFlagQZoneShareForbid = 0x02,
    kQQAPICtrlFlagQQShare = 0x04,
    kQQAPICtrlFlagQQShareFavorites = 0x08, //收藏
    kQQAPICtrlFlagQQShareDataline = 0x10,  //数据线
};

// QQApiObject
/** \brief 所有在QQ及插件间发送的数据对象的根类。
 */
@interface QQApiObject : NSObject
@property(nonatomic,retain) NSString* title; ///< 标题,最长128个字符
@property(nonatomic,retain) NSString* description; ///<简要描述,最长512个字符

@property (nonatomic, assign) uint64_t cflag;

@end

// QQApiResultObject
/** \brief 用于请求回应的数据类型。

可能错误码及描述如下:

error	errorDescription	注释

0	nil	成功

-1	param error	参数错误

-2	group code is invalid	该群不在自己的群列表里面

-3	upload photo failed	上传图片失败

-4	user give up the current operation	用户放弃当前操作

-5	client internal error	客户端内部处理错误

 */
@interface QQApiResultObject : QQApiObject
@property(nonatomic,retain) NSString* error; ///<错误
@property(nonatomic,retain) NSString* errorDescription; ///<错误描述
@property(nonatomic,retain) NSString* extendInfo; ///<扩展信息
@end

// QQApiTextObject
/** \brief 文本对象
 */
@interface QQApiTextObject : QQApiObject
@property(nonatomic,retain)NSString* text; ///<文本内容,必填,最长1536个字符

-(id)initWithText:(NSString*)text; ///<初始化方法
+(id)objectWithText:(NSString*)text;///<工厂方法,获取一个QQApiTextObject对象.
@end

// QQApiURLObject
typedef enum QQApiURLTargetType{
	QQApiURLTargetTypeNotSpecified = 0x00,
	QQApiURLTargetTypeAudio   = 0x01,
	QQApiURLTargetTypeVideo   = 0x02,
	QQApiURLTargetTypeNews    = 0x03
}QQApiURLTargetType;

/** @brief URL对象类型。

 包括URL地址,URL地址所指向的目标类型及预览图像。
 */
@interface QQApiURLObject : QQApiObject
/**
 URL地址所指向的目标类型.
 @note 参见QQApi.h 中的 QQApiURLTargetType 定义.
 */
@property(nonatomic)QQApiURLTargetType targetContentType;

@property(nonatomic,retain)NSURL* url; ///<URL地址,必填,最长512个字符
@property(nonatomic,retain)NSData* previewImageData;///<预览图像数据,最大1M字节
@property(nonatomic, retain) NSURL *previewImageURL;    ///<预览图像URL **预览图像数据与预览图像URL可二选一

/**
 初始化方法
 */
-(id)initWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data targetContentType:(QQApiURLTargetType)targetContentType;
-(id)initWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL targetContentType:(QQApiURLTargetType)targetContentType;
/**
 工厂方法,获取一个QQApiURLObject对象
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data targetContentType:(QQApiURLTargetType)targetContentType;
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL targetContentType:(QQApiURLTargetType)targetContentType;
@end

// QQApiExtendObject
/** @brief 扩展数据类型
 */
@interface QQApiExtendObject : QQApiObject
@property(nonatomic,retain) NSData* data;///<具体数据内容,必填,最大5M字节
@property(nonatomic,retain) NSData* previewImageData;///<预览图像,最大1M字节
@property(nonatomic,retain) NSArray* imageDataArray;///图片数组(多图暂只支持分享到手机QQ收藏功能)

/**
 初始化方法
 @param data 数据内容
 @param previewImageData 用于预览的图片
 @param title 标题
 @param description 此对象,分享的描述
 */
- (id)initWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description;

/**
 初始化方法
 @param data 数据内容
 @param title 标题
 @param description 此对象,分享的描述
 @param imageDataArray 发送的多张图片队列
 */
- (id)initWithData:(NSData *)data previewImageData:(NSData*)previewImageData title:(NSString *)title description:(NSString *)description imageDataArray:(NSArray *)imageDataArray;

/**
 helper方法获取一个autorelease的QQApiExtendObject对象
 @param data 数据内容
 @param previewImageData 用于预览的图片
 @param title 标题
 @param description 此对象,分享的描述
 @return
     一个自动释放的QQApiExtendObject实例
 */
+ (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description;

/**
 helper方法获取一个autorelease的QQApiExtendObject对象
 @param data 数据内容
 @param previewImageData 用于预览的图片
 @param title 标题
 @param description 此对象,分享的描述
 @param imageDataArray 发送的多张图片队列
 @return
 一个自动释放的QQApiExtendObject实例
 */
+ (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description imageDataArray:(NSArray*)imageDataArray;

@end

// QQApiImageObject
/** @brief 图片对象
     用于分享图片内容的对象,是一个指定为图片类型的QQApiExtendObject
 */
@interface QQApiImageObject : QQApiExtendObject
@end

// QQApiGroupTribeImageObject
/** @brief 群部落图片对象
 用于分享图片内容的对象,是一个指定为图片类型的 可以指定一些其他的附加数据QQApiExtendObject
 */
@interface QQApiGroupTribeImageObject : QQApiImageObject
{
    NSString *_bid;
    NSString *_bname;
}
// 群部落id
@property (nonatomic, retain)NSString* bid;

// 群部落名称
@property (nonatomic, retain)NSString* bname;

@end

//QQApiFileObject
/** @brief 本地文件对象(暂只支持分享到手机QQ数据线功能)
 用于分享文件内容的对象,是一个指定为文件类型的QQApiExtendObject
 */
@interface QQApiFileObject : QQApiExtendObject
{
    NSString* _fileName;
}
@property(nonatomic, retain)NSString* fileName;
@end

// QQApiAudioObject
/** @brief 音频URL对象
     用于分享目标内容为音频的URL的对象
 */
@interface QQApiAudioObject : QQApiURLObject

@property (nonatomic, retain) NSURL *flashURL;      ///<音频URL地址,最长512个字符

/**
 获取一个autorelease的QQApiAudioObject
 @param url 音频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param data 分享内容的预览图像
 @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data;

/**
 获取一个autorelease的QQApiAudioObject
 @param url 音频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param previewURL 分享内容的预览图像URL
 @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL;

@end

// QQApiVideoObject
/** @brief 视频URL对象
     用于分享目标内容为视频的URL的对象
 */
@interface QQApiVideoObject : QQApiURLObject

@property (nonatomic, retain) NSURL *flashURL;      ///<视频URL地址,最长512个字符

/**
 获取一个autorelease的QQApiVideoObject
 @param url 视频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param data 分享内容的预览图像
 @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data;

/**
 获取一个autorelease的QQApiVideoObject
 @param url 视频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param previewURL 分享内容的预览图像URL
 @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL;

@end

// QQApiNewsObject
/** @brief 新闻URL对象
     用于分享目标内容为新闻的URL的对象
 */
@interface QQApiNewsObject : QQApiURLObject
/**
 获取一个autorelease的QQApiNewsObject
 @param url 视频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param data 分享内容的预览图像
 @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data;

/**
 获取一个autorelease的QQApiNewsObject
 @param url 视频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param previewURL 分享内容的预览图像URL
 @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE
 */
+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL;

@end

// QQApiPayObject
/** \brief 支付对象
 */
@interface QQApiPayObject : QQApiObject
@property(nonatomic,retain)NSString* OrderNo; ///<支付订单号,必填
@property(nonatomic,retain)NSString* AppInfo; ///<支付来源信息,必填

-(id)initWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo; ///<初始化方法
+(id)objectWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo;///<工厂方法,获取一个QQApiPayObject对象.
@end

// QQApiCommonContentObject;
/** @brief 通用模板类型对象
    用于分享一个固定显示模板的图文混排对象
    @note 图片列表和文本列表不能同时为空
*/
@interface QQApiCommonContentObject : QQApiObject
/**
 预定义的界面布局类型
 */
@property(nonatomic,assign) unsigned int layoutType;
@property(nonatomic,assign) NSData* previewImageData;///<预览图
@property(nonatomic,retain) NSArray* textArray;///<文本列表
@property(nonatomic,retain) NSArray* pictureDataArray;///<图片列表
+(id)objectWithLayoutType:(int)layoutType textArray:(NSArray*)textArray pictureArray:(NSArray*)pictureArray previewImageData:(NSData*)data;
/**
 将一个NSDictionary对象转化为QQApiCommomContentObject,如果无法转换,则返回空
 */
+(id)objectWithDictionary:(NSDictionary*)dic;
-(NSDictionary*)toDictionary;
@end

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Ad item object definition
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** @brief 广告数据对象
 */
@interface QQApiAdItem : NSObject
@property(nonatomic,retain) NSString* title; ///<名称
@property(nonatomic,retain) NSString* description;///<描述
@property(nonatomic,retain) NSData* imageData;///<广告图片
@property(nonatomic,retain) NSURL* target;///<广告目标链接
@end

// QQApiWPAObject
/** \brief 发起WPA对象
 */
@interface QQApiWPAObject : QQApiObject
@property(nonatomic,retain)NSString* uin; ///<想要对话的QQ号

-(id)initWithUin:(NSString*)uin; ///<初始化方法
+(id)objectWithUin:(NSString*)uin;///<工厂方法,获取一个QQApiWPAObject对象.
@end

// QQApiAddFriendObject
/** \brief 添加好友
 */
@interface QQApiAddFriendObject : QQApiObject
@property (nonatomic,retain)NSString* openID;
@property (nonatomic,retain)NSString* subID;
@property (nonatomic,retain)NSString* remark;

-(id)initWithOpenID:(NSString*)openID; ///<初始化方法
+(id)objecWithOpenID:(NSString*)openID; ///<工厂方法,获取一个QQApiAddFriendObject对象.

@end

// QQApiGameConsortiumBindingGroupObject
/** \brief 游戏公会绑定群
 */
@interface QQApiGameConsortiumBindingGroupObject : QQApiObject
@property (nonatomic,retain)NSString* signature;
@property (nonatomic,retain)NSString* unionid;
@property (nonatomic,retain)NSString* zoneID;
@property (nonatomic,retain)NSString* appDisplayName;

-(id)initWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<初始化方法
+(id)objectWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<工厂方法,获取一个QQApiAddFriendObject对象.

@end

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.simpleemail.model;

/**
 *

 * Represents the message to be sent, composed of a subject and a body.
 *

 */
public class Message {

    /**
     * The subject of the message: A short summary of the content, which will
     * appear in the recipient's inbox.
     */
    private Content subject;

    /**
     * The message body.
     */
    private Body body;

    /**
     * Default constructor for a new Message object.  Callers should use the
     * setter or fluent setter (with...) methods to initialize this object after creating it.
     */
    public Message() {}

    /**
     * Constructs a new Message object.
     * Callers should use the setter or fluent setter (with...) methods to
     * initialize any additional object members.
     *
     * @param subject The subject of the message: A short summary of the
     * content, which will appear in the recipient's inbox.
     * @param body The message body.
     */
    public Message(Content subject, Body body) {
        this.subject = subject;
        this.body = body;
    }

    /**
     * The subject of the message: A short summary of the content, which will
     * appear in the recipient's inbox.
     *
     * @return The subject of the message: A short summary of the content, which will
     *         appear in the recipient's inbox.
     */
    public Content getSubject() {
        return subject;
    }

    /**
     * The subject of the message: A short summary of the content, which will
     * appear in the recipient's inbox.
     *
     * @param subject The subject of the message: A short summary of the content, which will
     *         appear in the recipient's inbox.
     */
    public void setSubject(Content subject) {
        this.subject = subject;
    }

    /**
     * The subject of the message: A short summary of the content, which will
     * appear in the recipient's inbox.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param subject The subject of the message: A short summary of the content, which will
     *         appear in the recipient's inbox.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public Message withSubject(Content subject) {
        this.subject = subject;
        return this;
    }

    /**
     * The message body.
     *
     * @return The message body.
     */
    public Body getBody() {
        return body;
    }

    /**
     * The message body.
     *
     * @param body The message body.
     */
    public void setBody(Body body) {
        this.body = body;
    }

    /**
     * The message body.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param body The message body.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public Message withBody(Body body) {
        this.body = body;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("Subject: " + subject + ", ");
        sb.append("Body: " + body + ", ");
        sb.append("}");
        return sb.toString();
    }

}